当模板开发人员删除包含自定义资源的堆栈时,ROS将发送RequestType设置为Delete的自定义资源请求。要成功删除带自定义资源的资源栈,custom resource provider必须成功响应删除请求。

请求

删除请求包含以下字段:

  • RequestType

    将为Delete。

  • ResponseURL

    预签名的公网URL。该URL接收custom resource provider到ROS的响应。

  • IntranetResponseURL

    预签名的内网URL,ECS中可使用此URL。该URL接收custom resource provider到ROS的响应。

  • StackId

    包含自定义资源的资源栈的ID。

  • StackName

    包含自定义资源的资源栈的名称。

  • ResourceOwnerId

    包含自定义资源的资源栈归属的阿里云账号ID(阿里云主账号)。

  • CallerId

    执行此次资源栈操作的账号ID(阿里云主账号或RAM用户)。

  • RegionId

    包含自定义资源的资源栈归属的地域。

  • RequestId

    请求的唯一ID。

  • ResourceType

    ROS模板中模板开发人员选择的自定义资源的资源类型。自定义资源类型名称最长为68个字符,可包含英文字符、数字、下划线(_)、at(@)和短划线(-)。

  • LogicalResourceId

    ROS模板中template developer选择的自定义资源名称(逻辑ID)。

  • PhysicalResourceId

    custom resource provider定义的物理ID,该ID对于该提供程序是唯一的。

  • ResourceProperties

    该字段包含模板开发人员发送的Properties中Parameters对象的内容。其内容由custom resource provider定义。

示例:

{
   "RequestType" : "Delete",
   "RequestId" : "unique id for this delete request",
   "ResponseURL" : "pre-signed-url-for-delete-response",
   "IntranetResponseURL" : "pre-signed-intranet-url-for-create-response",
   "ResourceType" : "Custom::MyCustomResourceType",
   "LogicalResourceId" : "name of resource in template",
   "PhysicalResourceId" : "custom resource provider-defined physical id",
   "StackId" : "stack id",
   "StackName" : "stack name",
   "ResourceOwnerId": "resource owner id",
   "CallerId": "caller id",
   "RegionId": "region id",
   "ResourceProperties" : {
      "key1" : "string",
      "key2" : [ "list" ],
      "key3" : { "key4" : "map" }
   }
}    

响应

成功

删除请求成功时,供应商提供的服务必须向ROS发送包含以下字段的响应:

  • Status

    必须为SUCCESS。

  • RequestId

    请求的唯一ID。 此响应值应从请求中复制。

  • LogicalResourceId

    ROS模板中模板开发人员选择的自定义资源名称(逻辑ID)。此响应值应从请求中复制。

  • StackId

    包含自定义资源的资源栈的ID。此响应值应从请求中复制。

  • PhysicalResourceId

    该值应是对于自定义资源供应商具有唯一性的标识符,最大为255字节。该值必须是非空字符串,并且在所有响应中对于相同资源必须相同。

示例

{
   "Status" : "SUCCESS",
   "RequestId" : "unique id for this delete request (copied from request)",
   "LogicalResourceId" : "name of resource in template (copied from request)",
   "StackId" : "stack id (copied from request)",
   "PhysicalResourceId" : "custom resource provider-defined physical id"
}

失败

删除请求失败时,供应商提供的服务必须向ROS发送包含以下字段的响应:

  • Status

    必须为FAILED。

  • Reason

    描述响应失败的原因。

  • RequestId

    请求的唯一ID。 此响应值应从请求中复制。

  • LogicalResourceId

    ROS模板中模板开发人员选择的自定义资源名称(逻辑ID)。此响应值应从请求中复制。

  • StackId

    包含自定义资源的资源栈的ID。此响应值应从请求中复制。

示例

{
   "Status" : "FAILED",
   "Reason" : "Required failure reason string",
   "RequestId" : "unique id for this delete request (copied from request)",
   "LogicalResourceId" : "name of resource in template (copied from request)",
   "StackId" : "stack id (copied from request)"
}