DATASOURCE::APIG::Service类型用于查询服务详情。
语法
{
  "Type": "DATASOURCE::APIG::Service",
  "Properties": {
    "ServiceId": String,
    "RefreshOptions": String
  }
}属性
| 属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 | 
| ServiceId | String | 是 | 是 | 服务 ID。 | 无 | 
| RefreshOptions | String | 否 | 是 | 当资源栈更新时,数据源资源的刷新策略。 | 有效值: 
 | 
返回值
Fn::GetAtt
- GroupName:服务分组名。 
- Addresses:地址信息, ip 或者与域名列表。 
- ResourceGroupId:资源组 ID。 
- ServiceName:服务名。 
- SourceType:服务来源类型。 
- Qualifier:函数限定名。 
- GatewayId:网关实例 ID。 
- Namespace:命名空间。 
- AiServiceConfig:AI 服务配置。 
- ServiceId:服务唯一 ID。 
示例
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  ServiceId:
    Type: String
    Description:
      en: The ID of the service.
    Required: true
Resources:
  ExtensionDataSource:
    Type: DATASOURCE::APIG::Service
    Properties:
      ServiceId:
        Ref: ServiceId
Outputs:
  GroupName:
    Description: The service group name.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - GroupName
  Addresses:
    Description: A list of domain names or fixed addresses.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - Addresses
  ResourceGroupId:
    Description: The ID of the resource group.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - ResourceGroupId
  ServiceName:
    Description: The name of the Service, need to fill in manually when sourceType is VIP/DNS/AI.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - ServiceName
  SourceType:
    Description: The type of the service source, optional value is K8S/MSE_NACOS/FC3/SAE_K8S_SERVICE/VIP/DNS/AI.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - SourceType
  Qualifier:
    Description: The function version or alias.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - Qualifier
  GatewayId:
    Description: The ID of the Cloud Native API Gateway.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - GatewayId
  Namespace:
    Description: The namespace of the service:.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - Namespace
  AiServiceConfig:
    Description: AI service configuration when sourceType equals AI.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - AiServiceConfig
  ServiceId:
    Description: The ID of the service.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - ServiceId
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "ServiceId": {
      "Type": "String",
      "Description": {
        "en": "The ID of the service."
      },
      "Required": true
    }
  },
  "Resources": {
    "ExtensionDataSource": {
      "Type": "DATASOURCE::APIG::Service",
      "Properties": {
        "ServiceId": {
          "Ref": "ServiceId"
        }
      }
    }
  },
  "Outputs": {
    "GroupName": {
      "Description": "The service group name.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "GroupName"
        ]
      }
    },
    "Addresses": {
      "Description": "A list of domain names or fixed addresses.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "Addresses"
        ]
      }
    },
    "ResourceGroupId": {
      "Description": "The ID of the resource group.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "ResourceGroupId"
        ]
      }
    },
    "ServiceName": {
      "Description": "The name of the Service, need to fill in manually when sourceType is VIP/DNS/AI.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "ServiceName"
        ]
      }
    },
    "SourceType": {
      "Description": "The type of the service source, optional value is K8S/MSE_NACOS/FC3/SAE_K8S_SERVICE/VIP/DNS/AI.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "SourceType"
        ]
      }
    },
    "Qualifier": {
      "Description": "The function version or alias.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "Qualifier"
        ]
      }
    },
    "GatewayId": {
      "Description": "The ID of the Cloud Native API Gateway.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "GatewayId"
        ]
      }
    },
    "Namespace": {
      "Description": "The namespace of the service:.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "Namespace"
        ]
      }
    },
    "AiServiceConfig": {
      "Description": "AI service configuration when sourceType equals AI.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "AiServiceConfig"
        ]
      }
    },
    "ServiceId": {
      "Description": "The ID of the service.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "ServiceId"
        ]
      }
    }
  }
}
                        该文章对您有帮助吗?