# Service


[API catalog](/reference/api/) · [Docker Engine overview](/reference/api/engine/version/v1.57/) · [Product manual](https://docs.docker.com/engine/) · [OpenAPI specification](/reference/api/engine/version/v1.57.yaml)

API version: 1.57





Schema constraints and annotations:

```json
{
  "example": {
    "CreatedAt": "2016-06-07T21:05:51.880065305Z",
    "Endpoint": {
      "Ports": [
        {
          "Protocol": "tcp",
          "PublishedPort": 30001,
          "TargetPort": 6379
        }
      ],
      "Spec": {
        "Mode": "vip",
        "Ports": [
          {
            "Protocol": "tcp",
            "PublishedPort": 30001,
            "TargetPort": 6379
          }
        ]
      },
      "VirtualIPs": [
        {
          "Addr": "10.255.0.2/16",
          "NetworkID": "4qvuz4ko70xaltuqbt8956gd1"
        },
        {
          "Addr": "10.255.0.3/16",
          "NetworkID": "4qvuz4ko70xaltuqbt8956gd1"
        }
      ]
    },
    "ID": "9mnpnzenvg8p8tdbtq4wvbkcz",
    "Spec": {
      "EndpointSpec": {
        "Mode": "vip",
        "Ports": [
          {
            "Protocol": "tcp",
            "PublishedPort": 30001,
            "TargetPort": 6379
          }
        ]
      },
      "Mode": {
        "Replicated": {
          "Replicas": 1
        }
      },
      "Name": "hopeful_cori",
      "RollbackConfig": {
        "Delay": 1000000000,
        "FailureAction": "pause",
        "MaxFailureRatio": 0.15,
        "Monitor": 15000000000,
        "Parallelism": 1
      },
      "TaskTemplate": {
        "ContainerSpec": {
          "Image": "redis"
        },
        "ForceUpdate": 0,
        "Placement": {},
        "Resources": {
          "Limits": {},
          "Reservations": {}
        },
        "RestartPolicy": {
          "Condition": "any",
          "MaxAttempts": 0
        }
      },
      "UpdateConfig": {
        "Delay": 1000000000,
        "FailureAction": "pause",
        "MaxFailureRatio": 0.15,
        "Monitor": 15000000000,
        "Parallelism": 1
      }
    },
    "UpdatedAt": "2016-06-07T21:07:29.962229872Z",
    "Version": {
      "Index": 19
    }
  },
  "properties": {
    "CreatedAt": {
      "format": "dateTime",
      "type": "string"
    },
    "Endpoint": {
      "properties": {
        "Ports": {
          "items": {
            "$ref": "#/components/schemas/EndpointPortConfig"
          },
          "type": "array"
        },
        "Spec": {
          "$ref": "#/components/schemas/EndpointSpec"
        },
        "VirtualIPs": {
          "items": {
            "properties": {
              "Addr": {
                "type": "string"
              },
              "NetworkID": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "ID": {
      "type": "string"
    },
    "JobStatus": {
      "description": "The status of the service when it is in one of ReplicatedJob or\nGlobalJob modes. Absent on Replicated and Global mode services. The\nJobIteration is an ObjectVersion, but unlike the Service's version,\ndoes not need to be sent with an update request.\n",
      "properties": {
        "JobIteration": {
          "$ref": "#/components/schemas/ObjectVersion",
          "description": "JobIteration is a value increased each time a Job is executed,\nsuccessfully or otherwise. \"Executed\", in this case, means the\njob as a whole has been started, not that an individual Task has\nbeen launched. A job is \"Executed\" when its ServiceSpec is\nupdated. JobIteration can be used to disambiguate Tasks belonging\nto different executions of a job.  Though JobIteration will\nincrease with each subsequent execution, it may not necessarily\nincrease by 1, and so JobIteration should not be used to\n"
        },
        "LastExecution": {
          "description": "The last time, as observed by the server, that this job was\nstarted.\n",
          "format": "dateTime",
          "type": "string"
        }
      },
      "type": "object"
    },
    "ServiceStatus": {
      "description": "The status of the service's tasks. Provided only when requested as\npart of a ServiceList operation.\n",
      "properties": {
        "CompletedTasks": {
          "description": "The number of tasks for a job that are in the Completed state.\nThis field must be cross-referenced with the service type, as the\nvalue of 0 may mean the service is not in a job mode, or it may\nmean the job-mode service has no tasks yet Completed.\n",
          "format": "uint64",
          "type": "integer"
        },
        "DesiredTasks": {
          "description": "The number of tasks for the service desired to be running.\nFor replicated services, this is the replica count from the\nservice spec. For global services, this is computed by taking\ncount of all tasks for the service with a Desired State other\nthan Shutdown.\n",
          "example": 10,
          "format": "uint64",
          "type": "integer"
        },
        "RunningTasks": {
          "description": "The number of tasks for the service currently in the Running state.\n",
          "example": 7,
          "format": "uint64",
          "type": "integer"
        }
      },
      "type": "object"
    },
    "Spec": {
      "$ref": "#/components/schemas/ServiceSpec"
    },
    "UpdateStatus": {
      "description": "The status of a service update.",
      "properties": {
        "CompletedAt": {
          "format": "dateTime",
          "type": "string"
        },
        "Message": {
          "type": "string"
        },
        "StartedAt": {
          "format": "dateTime",
          "type": "string"
        },
        "State": {
          "enum": [
            "updating",
            "paused",
            "completed"
          ],
          "type": "string"
        }
      },
      "type": "object"
    },
    "UpdatedAt": {
      "format": "dateTime",
      "type": "string"
    },
    "Version": {
      "$ref": "#/components/schemas/ObjectVersion"
    }
  },
  "type": "object"
}
```



