文档

ALIYUN::PAI::Service

更新时间:

ALIYUN::PAI::Service类型用于创建EAS服务。

语法

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

属性

属性名称

类型

必须

允许更新

描述

约束

Develop

String

是否进入开发模式。

取值:

  • true:进入开发模式。

  • false:不进入开发模式。

ServiceConfig

Map

服务的配置信息。

例如:

{ "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

服务标签列表。

例如:

{"key":"value"}

返回值

Fn::GetAtt

  • ServiceGroup:服务所在的分组

  • Message:服务的摘要信息。

  • Memory:每个实例申请的内存。

  • CurrentVersion:当前运行的模型版本。

  • RunningInstance:正在运行的服务的实例个数。

  • Cpu:每个实例申请的CPU。

  • Image:服务的数据镜像。

  • Gpu:每个实例申请的GPU。

  • CallerUid:服务创建账号的UID。

  • Reason:服务的状态原因

  • TotalInstance:服务的所有实例总个数

  • ServiceConfig:服务的配置信息

  • AccessToken:服务的请求Token

  • InternetEndpoint:服务的公网Endpoint

  • ResourceAlias:服务所在的资源组别名

  • CreateTime:服务的创建时间。

  • Resource:服务所在的资源组

  • Labels:服务标签列表

  • ExtraData:服务的额外信息

  • Namespace:服务所在的命名空间。

  • Weight:服务灰度发布的权重值。

  • Role:服务角色

  • PendingInstance:被挂起的服务的实例个数。

  • LatestVersion:服务最新版本号。

  • ServiceName:服务的名字。

  • SafetyLock:服务安全锁

  • UpdateTime:服务的更新时间

  • ServiceUid:服务ID,同ServiceId

  • RoleAttrs:服务角色额外属性

  • ParentUid:服务创建账号的阿里云账号UID。

  • IntranetEndpoint:服务内网endpoint。

示例

YAML格式

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  ServiceConfig:
    Type: Json
    Description: Service configuration information.
    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: Service Tag.
    Default:
      key: value
Resources:
  ExtensionResource:
    Type: ALIYUN::PAI::Service
    Properties:
      ServiceConfig:
        Ref: ServiceConfig
      Labels:
        Ref: Labels
Outputs:
  ServiceGroup:
    Description: Group to which the service belongs.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ServiceGroup
  Message:
    Description: Latest information on services.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Message
  Memory:
    Description: Memory of service (MB).
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Memory
  CurrentVersion:
    Description: Current running version of the service.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - CurrentVersion
  RunningInstance:
    Description: Number of instances in service running.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - RunningInstance
  Cpu:
    Description: Number of service CPU cores.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Cpu
  Image:
    Description: Service Deployment Mirroring.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Image
  Gpu:
    Description: Number of service GPU cards.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Gpu
  CallerUid:
    Description: The ID of the service creator, which can be the ID of the RAM account.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - CallerUid
  Reason:
    Description: Service deployment failure reason.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Reason
  TotalInstance:
    Description: Total number of instances required by the service.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - TotalInstance
  ServiceConfig:
    Description: Service configuration information.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ServiceConfig
  AccessToken:
    Description: Service Request authentication token.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - AccessToken
  InternetEndpoint:
    Description: Public network Endpoint of the service.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - InternetEndpoint
  ResourceAlias:
    Description: Name of the resource group where the service resides.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ResourceAlias
  CreateTime:
    Description: Creation time of the service.
    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: Service Tag.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Labels
  ExtraData:
    Description: Service Extra Information.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ExtraData
  Namespace:
    Description: The namespace to which the service belongs.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Namespace
  Weight:
    Description: Packet Service Traffic Weight.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Weight
  Role:
    Description: Grouping Service Role.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Role
  PendingInstance:
    Description: Number of instances where the service is not currently ready.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - PendingInstance
  LatestVersion:
    Description: The latest version of the service.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - LatestVersion
  ServiceName:
    Description: Service Name.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ServiceName
  SafetyLock:
    Description: Service Security Lock Status.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - SafetyLock
  UpdateTime:
    Description: Service Last Updated.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - UpdateTime
  ServiceUid:
    Description: Unique Service ID.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ServiceUid
  RoleAttrs:
    Description: Grouping Service Role Properties.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - RoleAttrs
  ParentUid:
    Description: Primary account ID of the creator.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ParentUid
  IntranetEndpoint:
    Description: The intranet Endpoint of the service.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - IntranetEndpoint

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "ServiceConfig": {
      "Type": "Json",
      "Description": "Service configuration information.",
      "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": "Service Tag.",
      "Default": {"key":"value"}
    }
  },
  "Resources": {
    "ExtensionResource": {
      "Type": "ALIYUN::PAI::Service",
      "Properties": {
        "ServiceConfig": {
          "Ref": "ServiceConfig"
        },
        "Labels": {
          "Ref": "Labels"
        }
      }
    }
  },
  "Outputs": {
    "ServiceGroup": {
      "Description": "Group to which the service belongs.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ServiceGroup"
        ]
      }
    },
    "Message": {
      "Description": "Latest information on services.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Message"
        ]
      }
    },
    "Memory": {
      "Description": "Memory of service (MB).",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Memory"
        ]
      }
    },
    "CurrentVersion": {
      "Description": "Current running version of the service.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "CurrentVersion"
        ]
      }
    },
    "RunningInstance": {
      "Description": "Number of instances in service running.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "RunningInstance"
        ]
      }
    },
    "Cpu": {
      "Description": "Number of service CPU cores.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Cpu"
        ]
      }
    },
    "Image": {
      "Description": "Service Deployment Mirroring.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Image"
        ]
      }
    },
    "Gpu": {
      "Description": "Number of service GPU cards.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Gpu"
        ]
      }
    },
    "CallerUid": {
      "Description": "The ID of the service creator, which can be the ID of the RAM account.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "CallerUid"
        ]
      }
    },
    "Reason": {
      "Description": "Service deployment failure reason.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Reason"
        ]
      }
    },
    "TotalInstance": {
      "Description": "Total number of instances required by the service.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "TotalInstance"
        ]
      }
    },
    "ServiceConfig": {
      "Description": "Service configuration information.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ServiceConfig"
        ]
      }
    },
    "AccessToken": {
      "Description": "Service Request authentication token.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "AccessToken"
        ]
      }
    },
    "InternetEndpoint": {
      "Description": "Public network Endpoint of the service.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "InternetEndpoint"
        ]
      }
    },
    "ResourceAlias": {
      "Description": "Name of the resource group where the service resides.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ResourceAlias"
        ]
      }
    },
    "CreateTime": {
      "Description": "Creation time of the service.",
      "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": "Service Tag.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Labels"
        ]
      }
    },
    "ExtraData": {
      "Description": "Service Extra Information.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ExtraData"
        ]
      }
    },
    "Namespace": {
      "Description": "The namespace to which the service belongs.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Namespace"
        ]
      }
    },
    "Weight": {
      "Description": "Packet Service Traffic Weight.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Weight"
        ]
      }
    },
    "Role": {
      "Description": "Grouping Service Role.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Role"
        ]
      }
    },
    "PendingInstance": {
      "Description": "Number of instances where the service is not currently ready.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "PendingInstance"
        ]
      }
    },
    "LatestVersion": {
      "Description": "The latest version of the service.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "LatestVersion"
        ]
      }
    },
    "ServiceName": {
      "Description": "Service Name.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ServiceName"
        ]
      }
    },
    "SafetyLock": {
      "Description": "Service Security Lock Status.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "SafetyLock"
        ]
      }
    },
    "UpdateTime": {
      "Description": "Service Last Updated.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "UpdateTime"
        ]
      }
    },
    "ServiceUid": {
      "Description": "Unique Service ID.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ServiceUid"
        ]
      }
    },
    "RoleAttrs": {
      "Description": "Grouping Service Role Properties.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "RoleAttrs"
        ]
      }
    },
    "ParentUid": {
      "Description": "Primary account ID of the creator.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ParentUid"
        ]
      }
    },
    "IntranetEndpoint": {
      "Description": "The intranet Endpoint of the service.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "IntranetEndpoint"
        ]
      }
    }
  }
}