Create Service

Details

API Details
Name

Create Service

DescriptionCreates a new service for the specified tenant. See Service Properties for additional information.
MethodPOST
URIv1/tenants/tenantId/services
CloudCenter Release
  • Introduced in CloudCenter 4.0.
  • Enhanced in CloudCenter 4.2 to include the defaultImageId, serviceType, and serviceActions attributes.
  • Enhanced in CloudCenter 4.3 to include the externalBundleLocation attribute and to deprecate the bundleRequired attribute
Notes
  • For additional context on <PORT> usage in the following example(s), see Base URI Format.
  • Upload the logo image before creating a service (see Upload Logo). If you do not upload a logo and provide the existing logo path (logoPath) prior to creating a service, then the logo image from the currently provided path is deleted and this logo image is moved to another location after the service is created.
ESB Headeraction: create.tenants.tenantId.service

Example

curl -k -X POST -H "Accept: application/json" -H "Content-Type: application/json" -u cliqradmin:40E45DBE57E35ECB "https://<HOST>:<PORT>/v1/tenants/1/services"
 

Prerequisite Task

  1. Upload the logo for the new service.
  2. Use the response from the Upload Logo API to provide the value for the logoPath attribute when adding a new service.

Request Body

{
    "displayName": "Testing201508141939",
    "name": "testing201508141939",
    "description": "testing201508141939",
    "bundleLocation": "%REPO_ID_1%bundles/testing201508141939.zip",
    "parentServiceId": "37",
    "costPerHour": "0.3",
    "logoPath": "/assets/img/temp/17b8f774-b1ab-4adb-8eef-459dc96beab0-ubuntu1404.png",
    "defaultImageId": "4",
    "serviceActions": [
        {
            "actionName": "INSTALL",
            "actionType": "CMD",
            "actionValue": "service install"
        },
        {
            "actionName": "CONFIGURE",
            "actionType": "CMD",
            "actionValue": "service configure"
        },
        {
            "actionName": "DEPLOY",
            "actionType": "CMD",
            "actionValue": "service run"
        },
        {
            "actionName": "START",
            "actionType": "URL",
            "actionValue": "http://<HOST>:<PORT>/startService.sh"
        },
        {
            "actionName": "STOP",
            "actionType": "SCRIPT",
            "actionValue": "service stop"
        },
        {
            "actionName": "RESTART",
            "actionType": "URL",
            "actionValue": "%REPO_ID_1%scripts/serviceRepository.sh"
        },
        {
            "actionName": "RELOAD",
            "actionType": "CMD",
            "actionValue": "service reload"
        },
        {
            "actionName": "UPGRADE",
            "actionType": "CMD",
            "actionValue": "service upgrade"
        },
        {
            "actionName": "CLEANUP",
            "actionType": "SCRIPT",
            "actionValue": "service cleanup"
        }
    ],
    "serviceParamSpecs": [
        {
            "paramName": "WAR_FILE_LOCATION",
            "displayName": "War File Location",
            "helpText": "War File Location",
            "type": "string",
            "valueConstraint": {
                "maxLength": 255,
                "allowSpaces": true
            },
            "defaultValue": "",
            "userVisible": true,
            "userEditable": true,
            "optional": false,
            "systemParam": true
        }
    ],
    "servicePorts": [
        {
            "protocol": "TCP",
            "fromPort": "80",
            "toPort": "80"
        }
    ],
    "images": [
        {
            "id": "4"
        }
    ],
    "repositories": [
        {
            "id": "1"
        }
    ]
}

Response

{
    "id": "65",
    "resource": "https://<HOST>:<PORT>/v1/tenants/1/services/65",
    "perms": [
        "write",
        "delete",
        "read",
        "administration"
    ],
    "name": "testing201508141939",
    "displayName": "Testing201508141939",
    "description": "testing201508141939",
    "logoPath": "/assets/img/appTiers/testing201508141939/logo.png",
    "defaultImageId": "4",
    "serviceType" : "VM_AGENT",
    "parentServiceId": "37",
    "parentService": false,
    "systemService": false,
    "externalService": false,
    "visible": true,
    "externalBundleLocation": null,
    "bundleLocation": "%REPO_ID_1%bundles/testing201508141939.zip",
    "costPerHour": 0.3,
    "ownerUserId": "2",
    "serviceActions": [
        {
            "actionName": "CLEANUP",
            "actionType": "SCRIPT",
            "actionValue": "service cleanup"
        },
        {
            "actionName": "UPGRADE",
            "actionType": "CMD",
            "actionValue": "service upgrade"
        },
        {
            "actionName": "INSTALL",
            "actionType": "CMD",
            "actionValue": "service install"
        },
        {
            "actionName": "RESTART",
            "actionType": "URL",
            "actionValue": "%REPO_ID_1%scripts/serviceRepository.sh"
        },
        {
            "actionName": "START",
            "actionType": "URL",
            "actionValue": "http://<HOST>:<PORT>/startService.sh"
        },
        {
            "actionName": "DEPLOY",
            "actionType": "CMD",
            "actionValue": "service run"
        },
        {
            "actionName": "CONFIGURE",
            "actionType": "CMD",
            "actionValue": "service configure"
        },
        {
            "actionName": "STOP",
            "actionType": "SCRIPT",
            "actionValue": "service stop"
        },
        {
            "actionName": "RELOAD",
            "actionType": "CMD",
            "actionValue": "service reload"
        }
    ],
    "servicePorts": [
        {
            "id": "37",
            "resource": null,
            "perms": [],
            "protocol": "TCP",
            "fromPort": "80",
            "toPort": "80"
        }
    ],
    "serviceParamSpecs": [
        {
            "paramName": "WAR_FILE_LOCATION",
            "displayName": "War File Location",
            "helpText": "War File Location",
            "type": "string",
            "valueList": null,
            "defaultValue": "",
            "userVisible": true,
            "userEditable": true,
            "systemParam": true,
            "exampleValue": null,
            "optional": false,
            "valueConstraint": {
                "minValue": 0,
                "maxValue": 0,
                "regex": null,
                "allowSpaces": true,
                "maxLength": 255,
                "sizeValue": 0,
                "step": 0
            },
            "collectionList": []
        }
    ],
    "egressRestrictions": [],
    "childServices": [],
    "images": [
        {
            "id": "4",
            "resource": null,
            "perms": [],
            "name": "CentOS 6.x",
            "internalImageName": "CloudWorker-CentOS6.x",
            "description": "CentOS 6.x",
            "visibility": "PUBLIC",
            "imageType": "CLOUD_WORKER",
            "osName": "LINUX",
            "tags": [],
            "numOfNics": 1,
            "tenantId": 1,
            "enabled": true,
            "systemImage": true,
            "detail": null,
            "count": 3
        }
    ],
    "repositories": [
        {
            "id": "1",
            "resource": null,
            "perms": [
                "write",
                "delete",
                "read",
                "administration"
            ],
            "displayName": null,
            "hostname": null,
            "protocol": null,
            "description": null,
            "port": 0
        }
    ]
}

Request Attributes

tenantId
  • DescriptionUnique, system-generated identifier for the tenant organization. A tenant admin must belong to this tenant to invoke any APIs for this tenant. See Add Sub-Tenants > Tenant ID and Tenant Name Dependency.

  • Type: String
displayName
  • DescriptionA descriptive name for this CloudCenter resource.
  • Type: String

name
  • DescriptionThe name assigned for this CloudCenter ResourceValid characters are letters, numbers, underscores, and spaces.

  • Type: String

description
  • DescriptionA brief description for this CloudCenter Resource.

  • Type: String

bundleLocation
parentServiceId
  • Description: Unique, system-generated identifier for a service category (a service inherits some attributes from its service category when the service is used to model application profiles)
  • Type: String
costPerHour
  • Description:  The dollar price per hour to use this service. Only the user who created this service (service owner) can set this value (once) for all users using this service.
  • Type: Float

logoPath
  • Type: String

defaultImageId
  • DescriptionUnique, system-generated identifier for the default image mapped to a service
  • Type: String

serviceActions (click for additional details)

serviceParamSpecs (click for additional details)

servicePorts (click for additional details)

images (click for additional details)

repositories (click for additional details)

Response Attributes

services
  • Description: Identifies definitions to capture framework dependencies (called when you onboard or migrate one or more applications)
  • Type: Array of mapped data types

    resource
    • Description: Unique URL to access this resource
    • Type: String
    perms (click for additional context)
    name
    • DescriptionThe name assigned for this CloudCenter ResourceValid characters are letters, numbers, underscores, and spaces.

    • Type: String

    displayName
    • DescriptionA descriptive name for this CloudCenter resource.
    • Type: String
    description
    • DescriptionA brief description for this CloudCenter Resource.

    • Type: String
    logoPath
    • Type: String
    defaultImageId
    • DescriptionUnique, system-generated identifier for the default image mapped to a service
    • Type: String
    serviceType
    • Description: The types of service buckets provided by the CloudCenter to define a new service. See External Service for additional context.
    • Type: Enumeration

      EnumerationDescription
      VM_AGENTDefault. Service based on a VM with a Management Agent
       VM_NO_AGENTService based on a VM without a Management Agent
       EXTERNAL External Service
    parentServiceId
    • Description: Unique, system-generated identifier for a service category (a service inherits some attributes from its service category when the service is used to model application profiles)
    • Type: String
    parentService
    • Description: The service category or a group determined by the admin when defining a service. For example, MySql and Oracle services both have the Database category (or group) as its parent. See Topology Modeler Services or Manage Services for additional context. 
      • true = This is the parent service ( value should always be true for consumers using only REST APIs)
      • false = This is not the parent service
    • Type: Boolean
    systemService
    externalService
    • Description: Identifies if this service is an external Service:
      • true = This is the external service
      • false = This is not the external service
    • Type: Boolean
    visible
    • Description: Identifies if this parameter should be visible to the users within a tenant
      • true = The service is displayed if the request attribute parentService = true
      • false = The service is displayed if the request attribute parentService = false
    • Type: Boolean
     externalBundleLocation
    • Description: Location of the zip file that contains the external Bundle Store artifacts that are downloaded during deployment orchestration. 
      • The External Actions Bundle zip file contains all scripts required to manage the external lifecycle. You must provide the following information for this zip file depending on the resource being configured:

        • If you are configuring this file at the cloud region level – this file must contain a directory called cloudregion which contains all the scripts.

        • If you are configuring this file for a service – name this file as ServiceID.zip. For example, tomcat6.zip, where tomcat6 is the Service ID.

      • This attribute is available for all service types
      • The bundle is validated against associated repositories.
      • The repositories field should not be empty.
      • The Service Lifecycle Actions definition (if it is a SCRIPT) is used to locate the scripts in this ZIP file.
      • See Manage Services and Parameters and Macros for additional context.
    • Type: String
    bundleLocation
    costPerHour
    • Description:  The dollar price per hour to use this service. Only the user who created this service (service owner) can set this value (once) for all users using this service.
    • Type: Float
     ownerUserId 
    • DescriptionUnique, system-generated identifier for the owner of the tenant to which this service owner belongs
    • Type: String
    serviceActions (click for additional details)
    servicePorts
    • Description: Defines the TCP/IP transport layer protocol used in this inbound firewall rule (or security rule)
    • Type: Array of firewallRules

      firewallRule
      • Description: Identifies firewall rules based on your application topology to allow inter-communication between nodes
      • Type: Array of mapped attributes

        protocol
        • Description: Defines the protocol to be used by VMs running this service.
        • Type: Enumeration:

          ProtocolDescription
          TCPTransmission Control Protocol
          UDPUser Datagram Protocol
         fromPort 
        • Description: The initial port number of the port range to use for this inbound firewall rule (or security rule)
        • Type: String
        toPort 
        • Description: The final port number of the port range to use for this inbound firewall rule (or security rule)
        • Type: String
        cloudId
        • Description: Unique, system-generated identifier for a cloud representation (see View Deployment Environments for additional details)

        • Type: String
    serviceParamSpecs
    • Description: Identifies the specifications for service parameters
      Type: Array of mapped attributes

      paramName
      • Description: Identifies the name for this parameter.
      • Type: String
      displayName
      • DescriptionA descriptive name for this CloudCenter resource.
      • Type: String
      helpText
      • Description: The additional information provided for this parameter.
      • Type: String
      type
      • Description: The type of parameter used for this specification. See Using Parameters > Parameter Type for additional details.
      • Type: Enumeration

        API EnumerationCCM UI Listing
        stringstring
        numbernumber
        listlist
        webservicewebservice
        password_input password with confirmation
        passwordpassword
        pathpath
        textareatextarea
      valueList
      • Description: A list of comma separated values (limited to 255 characters). See Using Parameters > Parameter Types for additional context.  
      • Type: String
      webserviceListParams
      • Description: Provide a list of dynamic webservice parameters while deploying a job. From this list, users can select one parameter. The webservice parameter type is available in custom parameters, global parameters, and services. The output should be in the following format:
        [{"name":"p1",
        "displayName":"Param 1"},
         {"name":"p2",
          "displayName":"Param 2"}]

        If you configure this parameter type, you must provide the Protocol (HTTP or HTTPS), Web Service URL, and the credentials (Username and Password) for this webservice.

      • Type: Array of mapped attributes

        url
        • Description: The URL that is associated with the tenant's marketing website. See  Add Sub-TenantsTenant ID and Tenant Name Dependency for additional details.

          This is not the URL to access the CloudCenter platform

        • Type: String
        protocol
        • Description: Defines the protocol to be used by VMs running this service.
        • Type: Enumeration:

          ProtocolDescription
          TCPTransmission Control Protocol
          UDPUser Datagram Protocol
        username
        • Description: Unique, CloudCenter-generated name reference for this user.
        • Type: String
        password
        • Description: Password for the user's account. Effective Cloud Center 4.6.1, the CloudCenter platform enforces a minimum password length of 5 characters for all settings.
        • Type: String
         requestType 
         contentType 
         commandParams 
        • DescriptionIdentifies the query parameters for this call. See Using Parameters > Parameter Type for additional context.
        • Type: String
         requestBody 
        • Description: Identifies the additional information sent in the request body for each request call.
        • Type: String
         resultString 
        • Type: String

       

      defaultValue
      • Description: The default value for this service parameter
      • Type: String
      userVisible
      • Description: Identifies if a service parameter is visible all users in the tenant
        • true = Parameter is visible to all users
        • false = Parameter is not visible to all users (just the admin)
      • Type: Boolean
      userEditable
      • Description: Identifies if a user is allowed to edit this service parameter:
        • true = Can change the preset values for this parameter
        • false = Cannot change the preset values for this parameter
      • Type: Boolean
      systemParam
      • Description: Identifies if this parameter is provided by the CloudCenter platform:
        • true = Provided by the CloudCenter platform
        • false = Added by the user or derived through another source
      • Type: Boolean
      exampleValue
      • Description: Identifies an example for this service parameter value
      • Type: String
      optional
      • Description: Identifies if this parameter is required for this service:
        • true = This parameter is required for this service
        • false = This parameter is optional for this service
      • Type: Boolean
      valueConstraint
      • Description: Identifies the  value restrictions for parameters created using the CloudCenter platform  
      • Type: Array of mapped attributes

        minValue
        • Description: The minimum required parameter value
        • Type: Integer
        maxValue
        • Description: The maximum allowed parameter value
        • Type: Integer
        regex
        • Description: Identifies if this parameter should be a regular expression
        • Type: String
        allowSpaces
        • Description: Identifies if spaces are allowed in the parameter name:
          • true = Spaces are allowed in the parameter name
          • false = Spaces are not allowed in the parameter name
        • Type: Boolean
        maxLength
        • Description: The maximum allowed length for this parameter name
        • Type: Integer
        sizeValue
        • Description: Identifies the size of this parameter
        • Type: Integer
        step
        • Description: Identifies the step for this parameter in the service execution process
        • Type: Integer
    egressRestrictions
    • Description: Identifies the connection restrictions for this service
    • Type: Sequence of egressServiceNames

       egressServiceName 
      • Description: The name of the service to which this service connects.
      • Type: String
    childServices (click for additional details)
    images (click for additional details)
    repositories (click for additional details)