All Products
Search
Document Center

Resource Orchestration Service:DATASOURCE::VPC::VSwitch

更新时间:Feb 05, 2025

DATASOURCE::VPC::VSwitch is used to query the information about a vSwitch.

Syntax

{
  "Type": "DATASOURCE::VPC::VSwitch",
  "Properties": {
    "VSwitchId": String,
    "RefreshOptions": String
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

VSwitchId

String

Yes

Yes

The ID of the vSwitch.

None.

RefreshOptions

String

No

Yes

The refresh policy for data source resources when the stack is updated.

Valid values:

  • Never (default): does not refresh data source resources when the stack is updated.

  • Always: refreshes data source resources when the stack is updated.

Return values

Fn::GetAtt

  • IsDefault: indicates whether the vSwitch is the default one.

  • RouteTableId: the ID of the route table associated with the vSwitch.

  • Description: the description of the vSwitch.

  • ZoneId: the zone ID of the vSwitch.

  • ResourceGroupId: the ID of the resource group.

  • AvailableIpAddressCount: the number of available IP addresses.

  • VSwitchId: the ID of the vSwitch.

  • CreateTime: the time when the vSwitch was created.

  • CidrBlock: the private CIDR block of the vSwitch.

  • VpcId: the ID of the virtual private cloud (VPC) to which the vSwitch belongs.

  • VSwitchName: the name of the vSwitch.

  • Ipv6CidrBlock: the IPv6 CIDR block of the vSwitch.

  • Tags: the information about the tags added to the vSwitch.

Examples

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  VSwitchId:
    AssociationProperty: ALIYUN::VPC::VSwitch::VSwitchId
    Type: String
    Description:
      en: The ID of the VSwitch.
    Required: true
Resources:
  ExtensionDataSource:
    Type: DATASOURCE::VPC::VSwitch
    Properties:
      VSwitchId:
        Ref: VSwitchId
Outputs:
  IsDefault:
    Description: Indicates whether the VSwitch is a default VSwitch.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - IsDefault
  RouteTableId:
    Description: The route table id.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - RouteTableId
  Description:
    Description: The description of VSwitch.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - Description
  ZoneId:
    Description: The zone ID  of the resource.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - ZoneId
  ResourceGroupId:
    Description: The resource group id of VSwitch.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - ResourceGroupId
  AvailableIpAddressCount:
    Description: The number of available IP addresses.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - AvailableIpAddressCount
  VSwitchId:
    Description: The ID of the VSwitch.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - VSwitchId
  CreateTime:
    Description: The creation time of the VSwitch.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - CreateTime
  CidrBlock:
    Description: The IPv4 CIDR block of the VSwitch.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - CidrBlock
  VpcId:
    Description: The VPC ID.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - VpcId
  VSwitchName:
    Description: The name of the VSwitch.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - VSwitchName
  Ipv6CidrBlock:
    Description: The IPv6 CIDR block of the VSwitch.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - Ipv6CidrBlock
  Tags:
    Description: The tags of VSwitch.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - Tags
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "VSwitchId": {
      "AssociationProperty": "ALIYUN::VPC::VSwitch::VSwitchId",
      "Type": "String",
      "Description": {
        "en": "The ID of the VSwitch."
      },
      "Required": true
    }
  },
  "Resources": {
    "ExtensionDataSource": {
      "Type": "DATASOURCE::VPC::VSwitch",
      "Properties": {
        "VSwitchId": {
          "Ref": "VSwitchId"
        }
      }
    }
  },
  "Outputs": {
    "IsDefault": {
      "Description": "Indicates whether the VSwitch is a default VSwitch.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "IsDefault"
        ]
      }
    },
    "RouteTableId": {
      "Description": "The route table id.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "RouteTableId"
        ]
      }
    },
    "Description": {
      "Description": "The description of VSwitch.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "Description"
        ]
      }
    },
    "ZoneId": {
      "Description": "The zone ID  of the resource.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "ZoneId"
        ]
      }
    },
    "ResourceGroupId": {
      "Description": "The resource group id of VSwitch.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "ResourceGroupId"
        ]
      }
    },
    "AvailableIpAddressCount": {
      "Description": "The number of available IP addresses.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "AvailableIpAddressCount"
        ]
      }
    },
    "VSwitchId": {
      "Description": "The ID of the VSwitch.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "VSwitchId"
        ]
      }
    },
    "CreateTime": {
      "Description": "The creation time of the VSwitch.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "CreateTime"
        ]
      }
    },
    "CidrBlock": {
      "Description": "The IPv4 CIDR block of the VSwitch.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "CidrBlock"
        ]
      }
    },
    "VpcId": {
      "Description": "The VPC ID.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "VpcId"
        ]
      }
    },
    "VSwitchName": {
      "Description": "The name of the VSwitch.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "VSwitchName"
        ]
      }
    },
    "Ipv6CidrBlock": {
      "Description": "The IPv6 CIDR block of the VSwitch.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "Ipv6CidrBlock"
        ]
      }
    },
    "Tags": {
      "Description": "The tags of VSwitch.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "Tags"
        ]
      }
    }
  }
}