Search or ask Docker

Create a config

POST /configs/create — Docker Engine API 1.57.

View Markdown
POST/configs/create

Connection and access

API connection and authentication guidance

/v1.57

No HTTP authentication requirement is declared for this operation. Transport access controls can still apply.

Parameters

No parameters are declared.

Request and responses

Request

application/json

All constraints apply

Schema: ConfigSpec

Type: object

All schema constraints and annotations
{
  "example": {
    "Data": "VEhJUyBJUyBOT1QgQSBSRUFMIENFUlRJRklDQVRFCg==",
    "Labels": {
      "foo": "bar"
    },
    "Name": "server.conf"
  },
  "type": "object"
}
All schema constraints and annotations
{
  "allOf": [
    {
      "$ref": "#/components/schemas/ConfigSpec"
    },
    {
      "example": {
        "Data": "VEhJUyBJUyBOT1QgQSBSRUFMIENFUlRJRklDQVRFCg==",
        "Labels": {
          "foo": "bar"
        },
        "Name": "server.conf"
      },
      "type": "object"
    }
  ]
}

Response 201

no error

application/json

Schema: IDResponse

Response 409

name conflicts with an existing object

application/json

Schema: ErrorResponse

Schema example

{
  "message": "Something went wrong."
}

Response 500

server error

application/json

Schema: ErrorResponse

Schema example

{
  "message": "Something went wrong."
}

Response 503

node is not part of a swarm

application/json

Schema: ErrorResponse

Schema example

{
  "message": "Something went wrong."
}

Referenced schemas

#/components/schemas/ConfigSpec

#/components/schemas/ErrorResponse

#/components/schemas/IDResponse

Complete operation contract
{
  "operationId": "ConfigCreate",
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "allOf": [
            {
              "$ref": "#/components/schemas/ConfigSpec"
            },
            {
              "example": {
                "Data": "VEhJUyBJUyBOT1QgQSBSRUFMIENFUlRJRklDQVRFCg==",
                "Labels": {
                  "foo": "bar"
                },
                "Name": "server.conf"
              },
              "type": "object"
            }
          ]
        }
      }
    },
    "x-codegen-request-body-name": "body"
  },
  "responses": {
    "201": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/IDResponse"
          }
        }
      },
      "description": "no error"
    },
    "409": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        }
      },
      "description": "name conflicts with an existing object"
    },
    "500": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        }
      },
      "description": "server error"
    },
    "503": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        }
      },
      "description": "node is not part of a swarm"
    }
  },
  "summary": "Create a config",
  "tags": [
    "Config"
  ]
}