ALIYUN::PAI::Service

更新时间:
复制 MD 格式

Creates a service in Elastic Algorithm Service (EAS).

Syntax

{
  "Type": "ALIYUN::PAI::Service",
  "Properties": {
    "Develop": String,
    "ServiceConfig": Map,
    "Labels": Map
  }
}

Properties

Property name

Type

Required

Update allowed

Description

Constraints

Develop

String

No

No

Whether to enable developer mode.

Valid values:

  • true: Enter developer mode.

  • false: Do not enter developer mode.

ServiceConfig

Map

Yes

Yes

The configuration of the service.

Example:

{ "metadata": { "cpu":1, "instance":1, "memory":1024 }, "name":"echo", "processor_entry":"libecho.so", "processor_path":"http://oss-cn-hangzhou-zmf.aliyuncs.com/059247/echo_processor_release.tar.gz", "processor_type":"cpp" }

Labels

Map

No

Yes

The service labels.

Example:

{"key":"value"}

Return values

Fn::GetAtt

  • ServiceGroup: The group to which the service belongs.

  • Message: The service summary.

  • Memory: The memory requested for each instance.

  • CurrentVersion: The current version of the running model.

  • RunningInstance: The number of running service instances.

  • Cpu: The number of CPU cores requested for each instance.

  • Image: The service image.

  • Gpu: The number of GPUs requested for each instance.

  • CallerUid: The UID of the account that created the service.

  • Reason: The reason for the service status.

  • TotalInstance: The total number of service instances.

  • ServiceConfig: The service configuration.

  • AccessToken: The access token for the service.

  • InternetEndpoint: The public endpoint of the service.

  • ResourceAlias: The alias of the service's resource group.

  • CreateTime: The time when the service was created.

  • Resource: The service's resource group.

  • Labels: A list of service labels.

  • ExtraData: Additional information about the service.

  • Namespace: The service namespace.

  • Weight: The canary release weight for the service.

  • Role: The service role.

  • PendingInstance: The number of pending service instances.

  • LatestVersion: The latest version number of the service.

  • ServiceName: The name of the service.

  • SafetyLock: The service's security lock.

  • UpdateTime: The time when the service was last updated.

  • ServiceUid: The ID of the service. This value is the same as ServiceId.

  • RoleAttrs: Additional attributes of the service role.

  • ParentUid: The UID of the creator's Alibaba Cloud account.

  • IntranetEndpoint: The internal endpoint of the service.

Examples

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  ServiceConfig:
    Type: Json
    Description: The configuration information of the service.
    Default:
      metadata:
        cpu: 1
        instance: 1
        memory: 1024
      name: echo
      processor_entry: libecho.so
      processor_path: http://oss-cn-hangzhou-zmf.aliyuncs.com/059247/echo_processor_release.tar.gz
      processor_type: cpp
  Labels:
    Type: Json
    Description: The labels for the service.
    Default:
      key: value
Resources:
  ExtensionResource:
    Type: ALIYUN::PAI::Service
    Properties:
      ServiceConfig:
        Ref: ServiceConfig
      Labels:
        Ref: Labels
Outputs:
  ServiceGroup:
    Description: The group to which the service belongs.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ServiceGroup
  Message:
    Description: The latest information about the service.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Message
  Memory:
    Description: The memory for the service, in MB.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Memory
  CurrentVersion:
    Description: The current running version of the service.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - CurrentVersion
  RunningInstance:
    Description: The number of running instances.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - RunningInstance
  Cpu:
    Description: The number of CPU cores for the service.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Cpu
  Image:
    Description: The deployment image for the service.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Image
  Gpu:
    Description: The number of GPUs for the service.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Gpu
  CallerUid:
    Description: The ID of the service creator, which can be the ID of a RAM account.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - CallerUid
  Reason:
    Description: The reason for a service deployment failure.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Reason
  TotalInstance:
    Description: The total number of instances required by the service.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - TotalInstance
  ServiceConfig:
    Description: The configuration information of the service.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ServiceConfig
  AccessToken:
    Description: The authentication token for service requests.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - AccessToken
  InternetEndpoint:
    Description: The public endpoint of the service.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - InternetEndpoint
  ResourceAlias:
    Description: The name of the resource group where the service is located.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ResourceAlias
  CreateTime:
    Description: The time when the service was created.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - CreateTime
  Resource:
    Description: The ID of the resource group to which the service belongs.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Resource
  Labels:
    Description: The labels for the service.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Labels
  ExtraData:
    Description: Extra information about the service.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ExtraData
  Namespace:
    Description: The namespace to which the service belongs.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Namespace
  Weight:
    Description: The traffic weight for the canary release.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Weight
  Role:
    Description: The role of the service group.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Role
  PendingInstance:
    Description: The number of instances that are not ready.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - PendingInstance
  LatestVersion:
    Description: The latest version of the service.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - LatestVersion
  ServiceName:
    Description: The name of the service.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ServiceName
  SafetyLock:
    Description: The status of the service security lock.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - SafetyLock
  UpdateTime:
    Description: The time when the service was last updated.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - UpdateTime
  ServiceUid:
    Description: The unique ID of the service.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ServiceUid
  RoleAttrs:
    Description: The properties of the service group role.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - RoleAttrs
  ParentUid:
    Description: The primary account ID of the creator.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ParentUid
  IntranetEndpoint:
    Description: The internal endpoint of the service.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - IntranetEndpoint

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "ServiceConfig": {
      "Type": "Json",
      "Description": "The configuration information of the service.",
      "Default": {
        "metadata": {
          "cpu": 1,
          "instance": 1,
          "memory": 1024
        },
        "name": "echo",
        "processor_entry": "libecho.so",
        "processor_path": "http://oss-cn-hangzhou-zmf.aliyuncs.com/059247/echo_processor_release.tar.gz",
        "processor_type": "cpp"
      }
    },
    "Labels": {
      "Type": "Json",
      "Description": "The labels for the service.",
      "Default": {"key":"value"}
    }
  },
  "Resources": {
    "ExtensionResource": {
      "Type": "ALIYUN::PAI::Service",
      "Properties": {
        "ServiceConfig": {
          "Ref": "ServiceConfig"
        },
        "Labels": {
          "Ref": "Labels"
        }
      }
    }
  },
  "Outputs": {
    "ServiceGroup": {
      "Description": "The group to which the service belongs.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ServiceGroup"
        ]
      }
    },
    "Message": {
      "Description": "The latest information about the service.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Message"
        ]
      }
    },
    "Memory": {
      "Description": "The memory for the service, in MB.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Memory"
        ]
      }
    },
    "CurrentVersion": {
      "Description": "The current running version of the service.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "CurrentVersion"
        ]
      }
    },
    "RunningInstance": {
      "Description": "The number of running instances.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "RunningInstance"
        ]
      }
    },
    "Cpu": {
      "Description": "The number of CPU cores for the service.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Cpu"
        ]
      }
    },
    "Image": {
      "Description": "The deployment image for the service.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Image"
        ]
      }
    },
    "Gpu": {
      "Description": "The number of GPUs for the service.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Gpu"
        ]
      }
    },
    "CallerUid": {
      "Description": "The ID of the service creator, which can be the ID of a RAM account.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "CallerUid"
        ]
      }
    },
    "Reason": {
      "Description": "The reason for a service deployment failure.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Reason"
        ]
      }
    },
    "TotalInstance": {
      "Description": "The total number of instances required by the service.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "TotalInstance"
        ]
      }
    },
    "ServiceConfig": {
      "Description": "The configuration information of the service.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ServiceConfig"
        ]
      }
    },
    "AccessToken": {
      "Description": "The authentication token for service requests.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "AccessToken"
        ]
      }
    },
    "InternetEndpoint": {
      "Description": "The public endpoint of the service.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "InternetEndpoint"
        ]
      }
    },
    "ResourceAlias": {
      "Description": "The name of the resource group where the service is located.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ResourceAlias"
        ]
      }
    },
    "CreateTime": {
      "Description": "The time when the service was created.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "CreateTime"
        ]
      }
    },
    "Resource": {
      "Description": "The ID of the resource group to which the service belongs.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Resource"
        ]
      }
    },
    "Labels": {
      "Description": "The labels for the service.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Labels"
        ]
      }
    },
    "ExtraData": {
      "Description": "Extra information about the service.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ExtraData"
        ]
      }
    },
    "Namespace": {
      "Description": "The namespace to which the service belongs.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Namespace"
        ]
      }
    },
    "Weight": {
      "Description": "The traffic weight for the canary release.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Weight"
        ]
      }
    },
    "Role": {
      "Description": "The role of the service group.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Role"
        ]
      }
    },
    "PendingInstance": {
      "Description": "The number of instances that are not ready.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "PendingInstance"
        ]
      }
    },
    "LatestVersion": {
      "Description": "The latest version of the service.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "LatestVersion"
        ]
      }
    },
    "ServiceName": {
      "Description": "The name of the service.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ServiceName"
        ]
      }
    },
    "SafetyLock": {
      "Description": "The status of the service security lock.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "SafetyLock"
        ]
      }
    },
    "UpdateTime": {
      "Description": "The time when the service was last updated.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "UpdateTime"
        ]
      }
    },
    "ServiceUid": {
      "Description": "The unique ID of the service.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ServiceUid"
        ]
      }
    },
    "RoleAttrs": {
      "Description": "The properties of the service group role.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "RoleAttrs"
        ]
      }
    },
    "ParentUid": {
      "Description": "The primary account ID of the creator.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ParentUid"
        ]
      }
    },
    "IntranetEndpoint": {
      "Description": "The internal endpoint of the service.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "IntranetEndpoint"
        ]
      }
    }
  }
}