Todos os produtos
Search
Central de documentação

Resource Orchestration Service:ALIYUN::PAI::Service

Última atualização: Jun 27, 2026

Cria um serviço no Elastic Algorithm Service (EAS).

Sintaxe

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

Propriedades

Nome da propriedade

Tipo

Obrigatória

Atualização permitida

Descrição

Restrições

Develop

String

Não

Não

Define se o modo de desenvolvedor está ativado.

Valores válidos:

  • true: ative o modo de desenvolvedor.

  • false: não ative o modo de desenvolvedor.

ServiceConfig

Map

Sim

Sim

Configuração do serviço.

Exemplo:

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

Não

Sim

Rótulos do serviço.

Exemplo:

{"key":"value"}

Valores de retorno

Fn::GetAtt

  • ServiceGroup: grupo ao qual o serviço pertence.

  • Message: resumo do serviço.

  • Memory: memória solicitada para cada instância.

  • CurrentVersion: versão atual do modelo em execução.

  • RunningInstance: quantidade de instâncias do serviço em execução.

  • Cpu: número de núcleos de CPU solicitados para cada instância.

  • Image: imagem do serviço.

  • Gpu: quantidade de GPUs solicitadas para cada instância.

  • CallerUid: UID da conta que criou o serviço.

  • Reason: motivo do status atual do serviço.

  • TotalInstance: total de instâncias do serviço.

  • ServiceConfig: configuração do serviço.

  • AccessToken: token de acesso ao serviço.

  • InternetEndpoint: endpoint público do serviço.

  • ResourceAlias: alias do grupo de recursos do serviço.

  • CreateTime: horário de criação do serviço.

  • Resource: grupo de recursos do serviço.

  • Labels: lista de rótulos do serviço.

  • ExtraData: informações adicionais sobre o serviço.

  • Namespace: namespace do serviço.

  • Weight: peso da liberação canário do serviço.

  • Role: função do serviço.

  • PendingInstance: quantidade de instâncias pendentes do serviço.

  • LatestVersion: número da versão mais recente do serviço.

  • ServiceName: nome do serviço.

  • SafetyLock: bloqueio de segurança do serviço.

  • UpdateTime: horário da última atualização do serviço.

  • ServiceUid: ID do serviço. Este valor é igual a ServiceId.

  • RoleAttrs: atributos adicionais da função do serviço.

  • ParentUid: UID da conta Alibaba Cloud do criador.

  • IntranetEndpoint: endpoint interno do serviço.

Exemplos

YAML formato

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 formato

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