Cloud Cruiser became HPE Consumption Analytics on Nov. 1st. You'll still see the old name in places while we update this site.

 

 

Consumption Analytics Documentation

Home > Cloud Cruiser 4 > REST API reference > Services > Create service

Create service

Creates a new service based on the provided information.

This method is available in HPE Consumption Analytics Portal version 4.1 and later.

Resource URL

POST http://<ccServerURL>/rest/v2/serviceCatalog/definitions

Request

Parameters

None

Content-Type

application/xml

Body

The service to create, as XML text with root element serviceDefinition or JAXB type com.cloudcruiser.server.webservices.v2.dto.service.serviceDefinition. The service's id attribute must be empty.

Schema

Version 4.0
Version 4.1 and later

For HPE Consumption Analytics Portal 4.1 and later, this XML schema describes service groups and their contained services.

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://www.cloudcruiser.com/webservices/v2/Common" xmlns:tns="http://www.cloudcruiser.com/webservices/v2/Service" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://www.cloudcruiser.com/webservices/v2/Service">
  <xs:import/>
  <xs:import namespace="http://www.cloudcruiser.com/webservices/v2/Common"/>
  <xs:element name="serviceDefinition" type="tns:ServiceDefinition"/>
  <xs:element name="serviceDefinitionList" type="tns:ServiceDefinitionList"/>
  <xs:element name="serviceGroup" type="tns:ServiceGroup"/>
  <xs:element name="serviceGroupList" type="tns:ServiceGroupList"/>
  <xs:element name="serviceSummaryList" type="tns:ServiceSummaryList"/>
  <xs:complexType name="ServiceGroup">
    <xs:sequence>
      <xs:element name="name" type="xs:string"/>
      <xs:element maxOccurs="unbounded" minOccurs="0" name="serviceSummary">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="name" type="xs:string"/>
            <xs:element minOccurs="0" name="description" type="xs:string"/>
            <xs:element default="false" name="valid" type="xs:boolean"/>
          </xs:sequence>
          <xs:attribute name="id" type="xs:int" use="required"/>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="id" type="xs:int" use="required"/>
    <xs:attribute name="totalServices" type="xs:int"/>
    <xs:attribute name="retrievedServices" type="xs:int"/>
    <xs:attribute name="startFrom" type="xs:int"/>
  </xs:complexType>
  <xs:complexType name="ServiceDefinition">
    <xs:sequence>
      <xs:element name="serviceName" type="xs:string"/>
      <xs:element default="Default" name="groupName" type="xs:string"/>
      <xs:element minOccurs="0" name="description" type="xs:string"/>
      <xs:element default="false" name="active" type="xs:boolean"/>
      <xs:element default="false" name="valid" type="xs:boolean"/>
      <xs:element name="unitDesc" type="xs:string"/>
      <xs:element default="4" name="unitDecimals" type="xs:short"/>
      <xs:element default="MONTHLY" name="chargeInterval" type="xs:string"/>
      <xs:element default="FULL" name="prorationType" type="xs:string"/>
      <xs:element default="BUNDLED" name="bundleType" type="xs:string"/>
      <xs:element default="ALLOCATED" name="measureType" type="xs:string"/>
      <xs:element maxOccurs="unbounded" minOccurs="0" name="measure" type="tns:ServiceMeasure"/>
      <xs:element maxOccurs="unbounded" minOccurs="0" name="tag">
        <xs:complexType>
          <xs:sequence/>
          <xs:attribute name="name" type="xs:string" use="required"/>
          <xs:attribute name="value" type="xs:string" use="required"/>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="id" type="xs:int"/>
  </xs:complexType>
  <xs:complexType abstract="true" name="ServiceMeasure">
    <xs:sequence>
      <xs:element name="measureName" type="xs:string"/>
      <xs:element name="schemaName" type="xs:string"/>
      <xs:element minOccurs="0" name="unitsConversion" type="ns1:ConversionType"/>
      <xs:element maxOccurs="unbounded" minOccurs="0" name="dimensionFilter">
        <xs:complexType>
          <xs:sequence/>
          <xs:attribute name="dimensionName" type="xs:string" use="required"/>
          <xs:attribute name="value" type="xs:string" use="required"/>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="MeteredServiceMeasure">
    <xs:complexContent>
      <xs:extension base="tns:ServiceMeasure">
        <xs:sequence/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="NonMeteredServiceMeasure">
    <xs:complexContent>
      <xs:extension base="tns:ServiceMeasure">
        <xs:sequence>
          <xs:element default="ALLOCATED" name="countByType" type="xs:string"/>
          <xs:element default="EQUALS" name="quantityOperator" type="xs:string"/>
          <xs:element default="1" name="quantity" type="xs:double"/>
          <xs:element minOccurs="0" name="quantityHigh" type="xs:double"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ServiceDefinitionList">
    <xs:sequence>
      <xs:element maxOccurs="unbounded" minOccurs="0" ref="tns:serviceDefinition"/>
    </xs:sequence>
    <xs:attribute name="totalServices" type="xs:int"/>
    <xs:attribute name="retrievedServices" type="xs:int"/>
    <xs:attribute name="startFrom" type="xs:int"/>
  </xs:complexType>
  <xs:complexType name="ServiceSummaryList">
    <xs:sequence>
      <xs:element maxOccurs="unbounded" minOccurs="0" name="serviceSummary" type="tns:ServiceSummary"/>
    </xs:sequence>
    <xs:attribute name="totalServices" type="xs:int"/>
    <xs:attribute name="retrievedServices" type="xs:int"/>
    <xs:attribute name="startFrom" type="xs:int"/>
  </xs:complexType>
  <xs:complexType name="ServiceSummary">
    <xs:sequence>
      <xs:element name="serviceName" type="xs:string"/>
      <xs:element name="groupName" type="xs:string"/>
      <xs:element minOccurs="0" name="description" type="xs:string"/>
      <xs:element name="active" type="xs:boolean"/>
      <xs:element name="valid" type="xs:boolean"/>
    </xs:sequence>
    <xs:attribute name="id" type="xs:int" use="required"/>
  </xs:complexType>
  <xs:complexType name="ServiceGroupList">
    <xs:sequence>
      <xs:element maxOccurs="unbounded" minOccurs="0" ref="tns:serviceGroup"/>
    </xs:sequence>
    <xs:attribute name="totalGroups" type="xs:int"/>
    <xs:attribute name="retrievedGroups" type="xs:int"/>
    <xs:attribute name="startFrom" type="xs:int"/>
  </xs:complexType>
</xs:schema>

Response

Content-Type

application/xml

Body

The new service, as XML text with the root element serviceDefinition or JAXB type com.cloudcruiser.server.webservices.v2.dto.service.serviceDefinition.

Schema

Same as for the request, above.

Example

URL invocation

POST http://localhost:8080/rest/v2/serviceCatalog/definitions​​

Java invocation
Request body
<serviceDefinition xmlns="http://www.cloudcruiser.com/webservices/v2/Service">
  <serviceName>Med VM</serviceName>
  <groupName>Virtual Machines</groupName>
  <description>Med Virtual Machine with two core CPU, 1TB disk and 2~4GB RAM</description>
  <active>true</active>
  <valid>true</valid>
  <unitDesc>instances</unitDesc>
  <unitDecimals>4</unitDecimals>
  <chargeInterval>MONTHLY</chargeInterval>
  <prorationType>FULL</prorationType>
  <bundleType>BUNDLED</bundleType>
  <measureType>ALLOCATED</measureType>
  <measure xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="NonMeteredServiceMeasure">
    <measureName>vCPU</measureName>
    <schemaName>Virtual Machine</schemaName>
    <countByType>ALLOCATED</countByType>
    <quantityOperator>EQUALS</quantityOperator>
    <quantity>2.0</quantity>
  </measure>
  <measure xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="NonMeteredServiceMeasure">
    <measureName>IP Address</measureName>
    <schemaName>Network</schemaName>
    <countByType>ALLOCATED</countByType>
    <quantityOperator>EQUALS</quantityOperator>
    <quantity>1.0</quantity>
  </measure>
  <measure xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="NonMeteredServiceMeasure">
    <measureName>vDisk</measureName>
    <schemaName>Virtual Machine</schemaName>
    <unitsConversion operator="DIV" operand="1000.0"/>
    <countByType>ALLOCATED</countByType>
    <quantityOperator>EQUALS</quantityOperator>
    <quantity>1.0</quantity>
  </measure>
  <measure xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="NonMeteredServiceMeasure">
    <measureName>vMemory</measureName>
    <schemaName>Virtual Machine</schemaName>
    <unitsConversion operator="DIV" operand="1024.0"/>
    <dimensionFilter dimensionName="VM Name" value="vm-1"/>
    <countByType>ALLOCATED</countByType>
    <quantityOperator>LT_LE</quantityOperator>
    <quantity>2.0</quantity>
    <quantityHigh>4.0</quantityHigh>
  </measure>
</serviceDefinition>
Response body
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<serviceDefinition xmlns="http://www.cloudcruiser.com/webservices/v2/Service" id="10602">
  <serviceName>Med VM</serviceName>
  <groupName>Virtual Machines</groupName>
  <description>Med Virtual Machine with two core CPU, 1TB disk and 2~4GB RAM</description>
  <active>true</active>
  <valid>true</valid>
  <unitDesc>instances</unitDesc>
  <unitDecimals>4</unitDecimals>
  <chargeInterval>MONTHLY</chargeInterval>
  <prorationType>FULL</prorationType>
  <bundleType>BUNDLED</bundleType>
  <measureType>ALLOCATED</measureType>
  <measure xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="NonMeteredServiceMeasure">
    <measureName>vDisk</measureName>
    <schemaName>Virtual Machine</schemaName>
    <unitsConversion operator="DIV" operand="1000.0"/>
    <countByType>ALLOCATED</countByType>
    <quantityOperator>EQUALS</quantityOperator>
    <quantity>1.0</quantity>
  </measure>
  <measure xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="NonMeteredServiceMeasure">
    <measureName>IP Address</measureName>
    <schemaName>Network</schemaName>
    <countByType>ALLOCATED</countByType>
    <quantityOperator>EQUALS</quantityOperator>
    <quantity>1.0</quantity>
  </measure>
  <measure xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="NonMeteredServiceMeasure">
    <measureName>vCPU</measureName>
    <schemaName>Virtual Machine</schemaName>
    <countByType>ALLOCATED</countByType>
    <quantityOperator>EQUALS</quantityOperator>
    <quantity>2.0</quantity>
  </measure>
  <measure xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="NonMeteredServiceMeasure">
    <measureName>vMemory</measureName>
    <schemaName>Virtual Machine</schemaName>
    <unitsConversion operator="DIV" operand="1024.0"/>
    <dimensionFilter dimensionName="VM Name" value="vm-1"/>
    <countByType>ALLOCATED</countByType>
    <quantityOperator>LT_LE</quantityOperator>
    <quantity>2.0</quantity>
    <quantityHigh>4.0</quantityHigh>
  </measure>
</serviceDefinition>
Last modified

Tags

Classifications

This page has no classifications.
© Copyright 2018 Hewlett Packard Enterprise Development LP