Create a service class.

Details

Create a service class.

An account token, server token, or user token may be used to run this endpoint.

Parameters

body

  • ecosystemId (required): The ID of the ecosystem.
  • service (required): The definition of a service class.

Responses

201

{
    "name": "SERVICE-CLASS-NAME",
    "service": {
        "name": "SERVICE-NAME"
    },
    "type": "SERVICE-TYPE",
    "createdAt": "YYYY-MM-DD HH:MM:SS ENCODED",
    "ecosystemId": "ECOSYSTEM-ID"
}

400

  • Ecosystem Invalid: The standard error structure defines this error as invalid parameters, with an invalid ID linked to the parameter that designates the ecosystem ID. In this context, it means that the ID given for an ecosystem was not valid.
  • Ecosystem Missing: The standard error structure defines this error as both an invalid parameter name and a missing parameter. In this context, it means that the parameter which is used to specify an ecosystem ID is not present.
  • Body Parameters Missing: The standard error structure defines this error as invalid parameters, and contains all required body parameters. If this error occurs when the JSON structure of the body parameters is syntactically correct, this means that the “content-type” header is incorrectly specified. The content-type header should be “application/json.”
  • No Query String Allowed: The standard error structure defines this error as invalid parameters, with additional parameters in the query string. In this context, it means that no query string is allowed at all when calling this endpoint.
  • Service Class Format Invalid: The standard error structure defines this error as invalid paramters. In this context, it means that a service class should have been formatted as an object, with the minimum required data contained within it. This error can occur in multiple forms, specifying that the service class should be an object, or stating that required parameters of the service class are missing. Also, this error can show up as an invalid body, when additional properties are specified in a service class that aren't allowed in context.
  • Duplicate Service Class: The standard error structure defines this error as a conflict. In this context, it means that a service class already exists which has a given name.

404

  • Ecosystem Not Found: This error means that an ecosystem with the given ID was not found. This is distinct from an invalid ecosystem ID being specified; this means that the ecosystem ID once existed, but no longer does.

Examples

HTTP

POST https://ioe.droplit.io/api/serviceclasses HTTP/1.1
authorization: TOKEN
content-type: application/json
{
    "ecosystemId": "ECOSYSTEM-ID",
    "name": "SERVICE-CLASS-NAME"
}

Droplit Console

droplit serviceclass create SERVICE-CLASS-NAME --ecosystemId ECOSYSTEM-ID

Droplit SDK

droplit.serviceClasses.create("ECOSYSTEM-ID", "SERVICE-CLASS-NAME");
Language
Credentials
Header
Click Try It! to start a request and see the response here!