リソースをインポートするときは、そのリソース識別子プロパティを指定する必要があります。このトピックでは、GetResourceTypeTemplateおよびGetTemplateSummary操作を呼び出して、インポートするリソースのリソース識別子プロパティを取得する方法について説明します。この例では、ALIYUN::VPC::EIPリソースを使用します。
手順
OpenAPI Explorer にログオンします。
GetResourceTypeTemplate 操作を呼び出して、ALIYUN::VPC::EIPリソースのTemplateBodyの値をクエリします。
GetResourceTypeTemplate操作を検索します。
[resourcetype] を ALIYUN::VPC::EIP に設定し、[呼び出し開始] をクリックします。
説明リソースタイプの詳細については、「サービス別リソースタイプ一覧」をご参照ください。
次の結果が返されます。
{ "RequestId": "4EE61317-00F7-4DB6-9FBD-E12ECC79805A", "TemplateBody": { "Parameters": { "Description": { "Type": "String", // Optional. The description of the EIP. The description must be 2 to 256 characters in length. It must start with a letter. It cannot start with http:// or https://. "Description": "オプション。EIPの説明。説明は2~256文字の長さでなければなりません。文字で始める必要があります。http:// または https:// で始めることはできません。" }, "ResourceGroupId": { "Type": "String", // Resource group id. "Description": "リソースグループID。" }, "InstanceChargeType": { "Type": "String", // The resource charge type. Default value is Postpaid "Description": "リソース課金タイプ。デフォルト値はPostpaidです", "AllowedValues": [ "Prepaid", "Postpaid" ], "Default": "Postpaid" }, "PricingCycle": { "Type": "String", // Price cycle of the resource. This property has no default value. If ChargeType is specified as Postpaid, this value will be ignore. "Description": "リソースの価格サイクル。このプロパティにはデフォルト値がありません。ChargeTypeがPostpaidとして指定されている場合、この値は無視されます。", "AllowedValues": [ "Month", "Year" ], "Default": "Month" }, "Isp": { "Type": "String", // ISP tag for finance cloud region. only for cn-hangzhou and cn-qingdao region), if you are not finance cloud user, this value will be ignore. "Description": "ファイナンスクラウドリージョンのISPタグ。(cn-hangzhouおよびcn-qingdaoリージョンのみ)。ファイナンスクラウドユーザーでない場合、この値は無視されます。" }, "Period": { "Type": "Number", // Prepaid time period. While choose by pay by month, it could be from 1 to 9. While choose pay by year, it could be from 1 to 3. "Description": "前払い期間。月払いの場合は1~9、年払いの場合は1~3です。", "MinValue": 1, "MaxValue": 9, "Default": 1 }, "DeletionProtection": { "Type": "Boolean", // Whether to enable deletion protection. // Default to False. "Description": "削除保護を有効にするかどうか。\nデフォルトはFalseです。", "AllowedValues": [ "True", "true", "False", "false" ], "Default": false }, "AutoPay": { "Type": "Boolean", // Automatic Payment. Default is false. "Description": "自動支払い。デフォルトはfalseです。", "AllowedValues": [ "True", "true", "False", "false" ], "Default": false }, "Name": { "Type": "String", // The name of the EIP. The name must be 2 to 128 characters in length. It must start with a letter. It can contain numbers, periods (.), underscores (_), and hyphens (-). It cannot start with http:// or https:// "Description": "EIPの名前。名前は2~128文字の長さでなければなりません。文字で始める必要があります。数字、ピリオド(.)、アンダースコア(_)、ハイフン(-)を含めることができます。http:// または https:// で始めることはできません" }, "InternetChargeType": { "Type": "String", // The network charge type. Support 'PayByBandwidth' and 'PayByTraffic' only. Default is PayByBandwidth. PayByTraffic will charge by hour, PayByBandwidth will charge by day. "Description": "ネットワーク課金タイプ。'PayByBandwidth'と'PayByTraffic'のみをサポートします。デフォルトはPayByBandwidthです。PayByTrafficは時間単位で課金され、PayByBandwidthは日単位で課金されます。", "AllowedValues": [ "PayByBandwidth", "PayByTraffic" ], "Default": "PayByBandwidth" }, "Netmode": { "Type": "String", // The network type. Valid value: public (public network). "Description": "ネットワークタイプ。有効な値:public(パブリックネットワーク)。" }, "Bandwidth": { "Type": "Number", // Bandwidth for the output network. Default is 5MB. "Description": "出力ネットワークの帯域幅。デフォルトは 5MB です。", "Default": 5 }, "Tags": { "Type": "Json", // Tags to attach to eip. Max support 20 tags to add during create eip. Each tag with two properties Key and Value, and Key is required. "Description": "EIPに添付するタグ。EIPの作成中に最大 20 個のタグを追加できます。各タグには Key と Value の 2 つのプロパティがあり、Key は必須です。", "MaxLength": 20 } }, "ROSTemplateFormatVersion": "2015-09-01", "Outputs": { "AllocationId": { // ID that Aliyun assigns to represent the allocation of the address for use with VPC. Returned only for VPC elastic IP addresses. "Description": "VPC で使用するアドレスの割り当てを表すためにAliyunが割り当てる ID。VPC エラスティック IP アドレスの場合にのみ返されます。", "Value": { "Fn::GetAtt": [ "ElasticIp", "AllocationId" ] } }, "EipAddress": { // IP address of created EIP. "Description": "作成されたEIPのIPアドレス。", "Value": { "Fn::GetAtt": [ "ElasticIp", "EipAddress" ] } }, "OrderId": { // Order ID of prepaid EIP instance. "Description": "前払いEIPインスタンスの注文ID。", "Value": { "Fn::GetAtt": [ "ElasticIp", "OrderId" ] } } }, "Resources": { "ElasticIp": { "Type": "ALIYUN::VPC::EIP", "Properties": { "Description": { "Ref": "Description" }, "ResourceGroupId": { "Ref": "ResourceGroupId" }, "InstanceChargeType": { "Ref": "InstanceChargeType" }, "PricingCycle": { "Ref": "PricingCycle" }, "Isp": { "Ref": "Isp" }, "Period": { "Ref": "Period" }, "DeletionProtection": { "Ref": "DeletionProtection" }, "AutoPay": { "Ref": "AutoPay" }, "Name": { "Ref": "Name" }, "InternetChargeType": { "Ref": "InternetChargeType" }, "Netmode": { "Ref": "Netmode" }, "Bandwidth": { "Ref": "Bandwidth" }, "Tags": { "Ref": "Tags" } } } } } }
GetTemplateSummary 操作を呼び出して、リソース識別子が含まれているテンプレートに関する情報をクエリします。
GetTemplateSummary操作を検索します。
[regionid] を指定し、[templatebody] を手順 2 で取得した ALIYUN::VPC::EIP の TemplateBody の値に設定し、[呼び出し開始] をクリックします。
次の結果が返されます。
{ "ResourceTypes": [ "ALIYUN::VPC::EIP" ], "Description": "No description", "Parameters": [ { "NoEcho": "false", "Type": "Boolean", // Whether to enable deletion protection. // Default to False. "Description": "削除保護を有効にするかどうか。\nデフォルトはFalseです。", "AllowedValues": [ "True", "true", "False", "false" ], "Label": "DeletionProtection", "Default": false, "ParameterKey": "DeletionProtection" }, { "NoEcho": "false", "Type": "String", // Optional. The description of the EIP. The description must be 2 to 256 characters in length. It must start with a letter. It cannot start with http:// or https://. "Description": "オプション。EIPの説明。説明は2~256文字の長さでなければなりません。文字で始める必要があります。http:// または https:// で始めることはできません。", "Label": "Description", "ParameterKey": "Description" }, { "NoEcho": "false", "Type": "Json", // Tags to attach to eip. Max support 20 tags to add during create eip. Each tag with two properties Key and Value, and Key is required. "Description": "EIPに添付するタグ。EIPの作成中に最大 20 個のタグを追加できます。各タグには Key と Value の 2 つのプロパティがあり、Key は必須です。", "Label": "Tags", "MaxLength": 20, "ParameterKey": "Tags" }, { "NoEcho": "false", "Type": "String", // ISP tag for finance cloud region. only for cn-hangzhou and cn-qingdao region), if you are not finance cloud user, this value will be ignore. "Description": "ファイナンスクラウドリージョンのISPタグ。(cn-hangzhouおよびcn-qingdaoリージョンのみ)。ファイナンスクラウドユーザーでない場合、この値は無視されます。", "Label": "Isp", "ParameterKey": "Isp" }, { "NoEcho": "false", "Type": "Number", // Prepaid time period. While choose by pay by month, it could be from 1 to 9. While choose pay by year, it could be from 1 to 3. "Description": "前払い期間。月払いの場合は1~9、年払いの場合は1~3です。", "Label": "Period", "MinValue": 1, "MaxValue": 9, "Default": 1, "ParameterKey": "Period" }, { "NoEcho": "false", "Type": "String", // Resource group id. "Description": "リソースグループID。", "Label": "ResourceGroupId", "ParameterKey": "ResourceGroupId" }, { "NoEcho": "false", "Type": "Boolean", // Automatic Payment. Default is false. "Description": "自動支払い。デフォルトはfalseです。", "AllowedValues": [ "True", "true", "False", "false" ], "Label": "AutoPay", "Default": false, "ParameterKey": "AutoPay" }, { "NoEcho": "false", "Type": "String", // The resource charge type. Default value is Postpaid "Description": "リソース課金タイプ。デフォルト値はPostpaidです", "AllowedValues": [ "Prepaid", "Postpaid" ], "Label": "InstanceChargeType", "Default": "Postpaid", "ParameterKey": "InstanceChargeType" }, { "NoEcho": "false", "Type": "String", // Price cycle of the resource. This property has no default value. If ChargeType is specified as Postpaid, this value will be ignore. "Description": "リソースの価格サイクル。このプロパティにはデフォルト値がありません。ChargeTypeがPostpaidとして指定されている場合、この値は無視されます。", "AllowedValues": [ "Month", "Year" ], "Label": "PricingCycle", "Default": "Month", "ParameterKey": "PricingCycle" }, { "NoEcho": "false", "Type": "String", // The network charge type. Support 'PayByBandwidth' and 'PayByTraffic' only. Default is PayByBandwidth. PayByTraffic will charge by hour, PayByBandwidth will charge by day. "Description": "ネットワーク課金タイプ。'PayByBandwidth'と'PayByTraffic'のみをサポートします。デフォルトはPayByBandwidthです。PayByTrafficは時間単位で課金され、PayByBandwidthは日単位で課金されます。", "AllowedValues": [ "PayByBandwidth", "PayByTraffic" ], "Label": "InternetChargeType", "Default": "PayByBandwidth", "ParameterKey": "InternetChargeType" }, { "NoEcho": "false", "Type": "Number", // Bandwidth for the output network. Default is 5MB. "Description": "出力ネットワークの帯域幅。デフォルトは 5MB です。", "Label": "Bandwidth", "Default": 5, "ParameterKey": "Bandwidth" }, { "NoEcho": "false", "Type": "String", // The network type. Valid value: public (public network). "Description": "ネットワークタイプ。有効な値:public(パブリックネットワーク)。", "Label": "Netmode", "ParameterKey": "Netmode" }, { "NoEcho": "false", "Type": "String", // The name of the EIP. The name must be 2 to 128 characters in length. It must start with a letter. It can contain numbers, periods (.), underscores (_), and hyphens (-). It cannot start with http:// or https:// "Description": "EIPの名前。名前は2~128文字の長さでなければなりません。文字で始める必要があります。数字、ピリオド(.)、アンダースコア(_)、ハイフン(-)を含めることができます。http:// または https:// で始めることはできません", "Label": "Name", "ParameterKey": "Name" } ], "RequestId": "2AA4188A-15D8-4BB4-9C26-847ED8315D20", "Version": "2015-09-01", "Metadata": {}, "ResourceIdentifierSummaries": [ { "LogicalResourceIds": [ "ElasticIp" ], "ResourceType": "ALIYUN::VPC::EIP", "ResourceIdentifiers": [ "AllocationId" ] } ] }ResourceIdentifiersのResourceIdentifierSummariesの値を表示します。この値は、リソース識別子プロパティです。この例では、
AllocationIdがResourceIdentifiersに返されます。これは、ALIYUN::VPC::EIPリソースがエラスティックIPアドレス (EIP) の ID を使用して識別できることを示しています。