Create a Service

post

/apiplatform/management/v1/services

Creates a Service.

Users requesting this resource must be assigned the Service Manager role.

Request

Supported Media Types
Body ()
Root Schema : CreateServiceRequest
Match All
Show Source
Nested Schema : ServiceIdentity
Type: object
Show Source
Nested Schema : ServiceDef
Type: object
Show Source
Nested Schema : ServiceState
Type: object
Show Source
Nested Schema : implementation
Type: object
The service's configuration.
Show Source
Nested Schema : specification
Type: object
The service's configuration.
Show Source
Nested Schema : wsdl
Type: object
The WSDL specification configuration
Show Source
Back to Top

Response

Supported Media Types

201 Response

The service was created.
Body ()
Root Schema : ServiceId
Type: object
Show Source

400 Response

Bad request, indicates a problem with the input parameters.
Body ()
Root Schema : Error
Type: object
Show Source
Nested Schema : errorDetails
Type: array
additional errors
Show Source

403 Response

Forbidden.
Body ()
Root Schema : Error
Type: object
Show Source
Nested Schema : errorDetails
Type: array
additional errors
Show Source

500 Response

Unexpected error.
Body ()
Root Schema : Error
Type: object
Show Source
Nested Schema : errorDetails
Type: array
additional errors
Show Source
Back to Top

Examples

The following example shows how to create a service by submitting a POST request on the REST resource using cURL. For more information about cURL, see Use cURL

curl -i -X POST 
-H "Authorization: Bearer access_token"
-H "Content-Type:application/json"
-d @services-post.json
https://example.com/apiplatform/management/v1/services

Example of Request Body

The following shows an example of the request body in JSON format (included with the request above in a file named services-post.json) including details about the new service.

{
    "name": "traffic",
    "description": "canned service",
    "implementation": {
        "executions": {
            "request":  [ "1"  ],
            "response": [ "2" ]
        },
        "policies": [
            {
                "id": "1",
                "type": "o:BackendRequest",
                "version": "1.0",
                "config": {
                    "endpoints": [
                        {
                            "url":  "http://host:80/endpoint"
                        }
                    ]
                }
            },
            {
                "id": "2",
                "type: "o:BackendResponse",
                "version": "1.0",
                "config": {}
            }
        ]
    }
}

Example of Response Headers

The following shows an example of the response headers.

HTTP/1.1 201 Created
Server: Oracle-Traffic-Director/12.2.1.0.0
Date: Wed, 26 Jul 2017 17:10:11 GMT
Content-Length:  12
Content-type: application/json
X-oracle-dms-ecid: kKFfG1P0000000000
X-oracle-dms-rid: 0:1
Via: 1.1 otd_opc-config
Proxy-agent: Oracle-Traffic-Director/12.2.1.2.0

Example of Response Body

The following example shows the contents of the response body in JSON format, including the ID of the created service.

{ 
    "id": "100"
}
Back to Top