Browse code

Merge pull request #25706 from thaJeztah/add-authorization-header-to-api-docs

Add X-Registry-Auth header to service API docs

Sebastiaan van Stijn authored on 2016/08/16 04:54:06
Showing 2 changed files
... ...
@@ -4404,7 +4404,10 @@ List services
4404 4404
 
4405 4405
 `POST /services/create`
4406 4406
 
4407
-Create a service
4407
+Create a service. When using this endpoint to create a service using a private
4408
+repository from the registry, the `X-Registry-Auth` header must be used to
4409
+include a base64-encoded AuthConfig object. Refer to the [create an
4410
+image](#create-an-image) section for more details.
4408 4411
 
4409 4412
 **Example request**:
4410 4413
 
... ...
@@ -4564,6 +4567,14 @@ JSON Parameters:
4564 4564
           of: `"Ports": { "<port>/<tcp|udp>: {}" }`
4565 4565
     - **VirtualIPs**
4566 4566
 
4567
+**Request Headers**:
4568
+
4569
+- **Content-type** – Set to `"application/json"`.
4570
+- **X-Registry-Auth** – base64-encoded AuthConfig object, containing either
4571
+  login information, or a token. Refer to the [create an image](#create-an-image)
4572
+  section for more details.
4573
+
4574
+
4567 4575
 ### Remove a service
4568 4576
 
4569 4577
 
... ...
@@ -4668,11 +4679,16 @@ Return information on the service `id`.
4668 4668
 
4669 4669
 `POST /services/(id or name)/update`
4670 4670
 
4671
-Update the service `id`.
4671
+Update a service. When using this endpoint to create a service using a
4672
+private repository from the registry, the `X-Registry-Auth` header can be used
4673
+to update the authentication information for that is stored for the service.
4674
+The header contains a base64-encoded AuthConfig object. Refer to the [create an
4675
+image](#create-an-image) section for more details.
4672 4676
 
4673 4677
 **Example request**:
4674 4678
 
4675
-    POST /services/1cb4dnqcyx6m66g2t538x3rxha/update HTTP/1.1
4679
+    POST /services/1cb4dnqcyx6m66g2t538x3rxha/update?version=23 HTTP/1.1
4680
+    Content-Type: application/json
4676 4681
 
4677 4682
     {
4678 4683
       "Name": "top",
... ...
@@ -4781,6 +4797,13 @@ Update the service `id`.
4781 4781
 - **version** – The version number of the service object being updated. This is
4782 4782
   required to avoid conflicting writes.
4783 4783
 
4784
+**Request Headers**:
4785
+
4786
+- **Content-type** – Set to `"application/json"`.
4787
+- **X-Registry-Auth** – base64-encoded AuthConfig object, containing either
4788
+  login information, or a token. Refer to the [create an image](#create-an-image)
4789
+  section for more details.
4790
+
4784 4791
 **Status codes**:
4785 4792
 
4786 4793
 -   **200** – no error
... ...
@@ -4428,7 +4428,10 @@ List services
4428 4428
 
4429 4429
 `POST /services/create`
4430 4430
 
4431
-Create a service
4431
+Create a service. When using this endpoint to create a service using a private
4432
+repository from the registry, the `X-Registry-Auth` header must be used to
4433
+include a base64-encoded AuthConfig object. Refer to the [create an
4434
+image](#create-an-image) section for more details.
4432 4435
 
4433 4436
 **Example request**:
4434 4437
 
... ...
@@ -4588,6 +4591,14 @@ JSON Parameters:
4588 4588
           of: `"Ports": { "<port>/<tcp|udp>: {}" }`
4589 4589
     - **VirtualIPs**
4590 4590
 
4591
+**Request Headers**:
4592
+
4593
+- **Content-type** – Set to `"application/json"`.
4594
+- **X-Registry-Auth** – base64-encoded AuthConfig object, containing either
4595
+  login information, or a token. Refer to the [create an image](#create-an-image)
4596
+  section for more details.
4597
+
4598
+
4591 4599
 ### Remove a service
4592 4600
 
4593 4601
 
... ...
@@ -4692,11 +4703,16 @@ Return information on the service `id`.
4692 4692
 
4693 4693
 `POST /services/(id or name)/update`
4694 4694
 
4695
-Update the service `id`.
4695
+Update a service. When using this endpoint to create a service using a
4696
+private repository from the registry, the `X-Registry-Auth` header can be used
4697
+to update the authentication information for that is stored for the service.
4698
+The header contains a base64-encoded AuthConfig object. Refer to the [create an
4699
+image](#create-an-image) section for more details.
4696 4700
 
4697 4701
 **Example request**:
4698 4702
 
4699
-    POST /services/1cb4dnqcyx6m66g2t538x3rxha/update HTTP/1.1
4703
+    POST /services/1cb4dnqcyx6m66g2t538x3rxha/update?version=23 HTTP/1.1
4704
+    Content-Type: application/json
4700 4705
 
4701 4706
     {
4702 4707
       "Name": "top",
... ...
@@ -4805,6 +4821,13 @@ Update the service `id`.
4805 4805
 - **version** – The version number of the service object being updated. This is
4806 4806
   required to avoid conflicting writes.
4807 4807
 
4808
+**Request Headers**:
4809
+
4810
+- **Content-type** – Set to `"application/json"`.
4811
+- **X-Registry-Auth** – base64-encoded AuthConfig object, containing either
4812
+  login information, or a token. Refer to the [create an image](#create-an-image)
4813
+  section for more details.
4814
+
4808 4815
 **Status codes**:
4809 4816
 
4810 4817
 -   **200** – no error