查看数据库实例

最近更新时间:2019-05-28 15:12:54

DescribeDBInstances 查看数据库实例

获取账户下的实例列表,或者获取某一实例的详情(指定DBInstanceIdentifier的情况下)。在获取实例列表时可通过DBInstanceType、DBInstanceStatus、Keyword条件进行过滤。若所有列表无法一次全返回,可通过设置Marker来分页返回。

请求参数

英文名称 中文名称 类型 是否必须 备注
Action 调用接口名称 String 取固定值:DescribeDBInstances
Version API版本号 String 取固定值:2016-07-01
DBInstanceIdentifier 调用接口名称 String 实例ID(传入实例ID,获取的是该实例的详情,否则则获取list)
DBInstanceType 调用接口名称 String HRDS(高可用),RR(只读实例),TRDS(临时实例)
DBInstanceStatus 按实例状态过滤 String ACTIVE(运行中)/INVALID(请续费)
Keyword 按名称/VIP模糊过滤 String
Order 排序方式 String 区分大小写,取值范围:DEFAULT(默认排序方式),GROUP(按复制组排序,会把只读实例排在所属主实例的后面)
ProjectId 项目制Id String 默认值为所有项目
Marker 记录开始偏移量 Integer
MaxRecords 每页结果中包含的最大条数 Integer 取值范围:1-100

返回值

英文名称 中文名称 类型 备注
RequestId 请求ID String --
DBInstance RDS实例列表 List --
Marker 下次获取记录开始偏移量 Integer --
MaxRecords 每页结果中包含的最大条数 Integer --
TotalCount 记录总数 Integer --

请求示例

http://krds.api.ksyun.com/?Action=DescribeDBInstances&Marker=1&MaxRecords=10&Version=2016-07-01

示例返回

  • 列表返回

    {
    "Data": {
        "Instances": [
            {
                "DBInstanceClass": {
                    "Id": "RDSOpenAPI_0772c82ea87c666d",
                    "Vcpus": 1,
                    "Disk": 10,
                    "Ram": 1
                },
                "DBInstanceIdentifier": "bb2d111a-af44-41ee-b10d-754f23bc59e1",
                "DBInstanceName": "test",
                "DBInstanceStatus": "BUILDING_RR",
                "DBInstanceType": "HRDS",
                "DBParameterGroupId": "3b9aeb7b-552b-4707-92b2-15f0278bb73e",
                "GroupId": "71e2bd82-423d-41ae-a9e6-2131a447d780",
                "SecurityGroupId": "55705",
                "Vip": "10.69.59.242",
                "Port": 3306,
                "Engine": "mysql",
                "EngineVersion": "5.6",
                "InstanceCreateTime": "2018-03-20T11:03:22+0800",
                "MasterUserName": "test",
                "DatastoreVersionId": "96867ed6-6f6a-4006-bbc5-46c1f22d63a9",
                "Region": "cn-beijing-6",
                "VpcId": "0f71c616-6f5e-4f24-b809-59eb84016367",
                "PubliclyAccessible": false,
                "ReadReplicaDBInstanceIdentifiers": [
                    {
                        "ReadReplicaDBInstanceIdentifier": "488fcb98-8706-4954-aaf8-050d79b3ea9e"
                    }
                ],
                "BillType": "DAY",
                "OrderType": "REGULAR",
                "OrderSource": "OPENAPI",
                "MultiAvailabilityZone": false,
                "MasterAvailabilityZone": "cn-beijing-6b",
                "SlaveAvailabilityZone": "cn-beijing-6a",
                "ProductId": "ed8b94df-68e0-47dc-a86b-017d1426a8cd",
                "OrderUse": "BUY",
                "ProjectId": 0,
                "ProjectName": "默认项目"
            },
            {
                "DBInstanceClass": {
                    "Id": "RDSOpenAPI_bb0b4cbff280227c",
                    "Vcpus": 1,
                    "Disk": 15,
                    "Ram": 1
                },
                "DBInstanceIdentifier": "0113014e-cd36-4398-9468-49ac10b053ea",
                "DBInstanceName": "dsj_test12221",
                "DBInstanceStatus": "ACTIVE",
                "DBInstanceType": "HRDS",
                "DBParameterGroupId": "b9ef8714-50ff-4e03-a29d-c58b57de7f5d",
                "GroupId": "b85cc696-14ab-4509-a8f1-5dca8f8ab3c9",
                "SecurityGroupId": "55581",
                "Vip": "172.31.252.242",
                "Port": 3306,
                "Engine": "mysql",
                "EngineVersion": "5.6",
                "InstanceCreateTime": "2018-03-15T12:30:29+0800",
                "MasterUserName": "admin",
                "DatastoreVersionId": "96867ed6-6f6a-4006-bbc5-46c1f22d63a9",
                "Region": "cn-beijing-6",
                "VpcId": "40e0c2e0-3607-4f17-abb5-1a6efe3951c8",
                "SubnetId": "bc159134-4c94-4a6b-bec0-d97c75d83774",
                "PubliclyAccessible": true,
                "ReadReplicaDBInstanceIdentifiers": [],
                "BillType": "YEAR_MONTH",
                "OrderType": "REGULAR",
                "OrderSource": "CONSOLE",
                "MultiAvailabilityZone": false,
                "MasterAvailabilityZone": "cn-beijing-6a",
                "SlaveAvailabilityZone": "cn-beijing-6a",
                "ProductId": "b24bd18b-280b-4528-aba6-d605079f16a4",
                "ServiceEndTime": "2018-04-15T23:59:59+0800",
                "OrderUse": "BUY",
                "ProjectId": 0,
                "ProjectName": "默认项目"
            },
            {
                "DBInstanceClass": {
                    "Id": "RDSOpenAPI_bb0b4cbff280227c",
                    "Vcpus": 1,
                    "Disk": 15,
                    "Ram": 1
                },
                "DBInstanceIdentifier": "7397489e-929b-479c-8ac5-cd753746d69e",
                "DBInstanceName": "ls-dts-长期测试",
                "DBInstanceStatus": "ACTIVE",
                "DBInstanceType": "HRDS",
                "DBParameterGroupId": "debf0e06-52d4-45c2-bdc3-95ead7b18936",
                "GroupId": "d365632c-362f-404d-a526-be645b41fb86",
                "SecurityGroupId": "55248",
                "Vip": "10.0.1.138",
                "Port": 3306,
                "Engine": "mysql",
                "EngineVersion": "5.6",
                "InstanceCreateTime": "2018-03-01T23:19:14+0800",
                "MasterUserName": "admin",
                "DatastoreVersionId": "96867ed6-6f6a-4006-bbc5-46c1f22d63a9",
                "Region": "cn-beijing-6",
                "VpcId": "c1d332f1-164b-4066-902a-149e75a51ad4",
                "SubnetId": "2f8b762b-b8c9-400d-a989-96ea2ea7a5f9",
                "PubliclyAccessible": true,
                "ReadReplicaDBInstanceIdentifiers": [],
                "BillType": "YEAR_MONTH",
                "OrderType": "REGULAR",
                "OrderSource": "CONSOLE",
                "MultiAvailabilityZone": false,
                "MasterAvailabilityZone": "cn-beijing-6a",
                "SlaveAvailabilityZone": "cn-beijing-6a",
                "ProductId": "87161cf6-bded-4746-b2ec-1316ee742056",
                "ServiceEndTime": "2018-05-01T23:59:59+0800",
                "OrderUse": "RENEW",
                "Eip": "120.131.7.210",
                "EipPort": "42592",
                "ProjectId": 0,
                "ProjectName": "默认项目"
            },
            {
                "DBInstanceClass": {
                    "Id": "RDSOpenAPI_bb0b4cbff280227c",
                    "Vcpus": 1,
                    "Disk": 15,
                    "Ram": 1
                },
                "DBInstanceIdentifier": "ea345c3f-69ca-4035-a0ec-4f1b6313a7b2",
                "DBInstanceName": "krds_20180301181752",
                "DBInstanceStatus": "ACTIVE",
                "DBInstanceType": "HRDS",
                "DBParameterGroupId": "d57a669e-1416-4e5d-b7f9-1a5f067a2058",
                "GroupId": "c67d44c1-a8e7-490a-a61b-94a69706fb81",
                "SecurityGroupId": "55191",
                "Vip": "10.0.1.136",
                "Port": 3306,
                "Engine": "mysql",
                "EngineVersion": "5.6",
                "InstanceCreateTime": "2018-03-01T18:18:46+0800",
                "MasterUserName": "admin",
                "DatastoreVersionId": "96867ed6-6f6a-4006-bbc5-46c1f22d63a9",
                "Region": "cn-beijing-6",
                "VpcId": "c1d332f1-164b-4066-902a-149e75a51ad4",
                "SubnetId": "2f8b762b-b8c9-400d-a989-96ea2ea7a5f9",
                "PubliclyAccessible": true,
                "ReadReplicaDBInstanceIdentifiers": [],
                "BillType": "YEAR_MONTH",
                "OrderType": "REGULAR",
                "OrderSource": "CONSOLE",
                "MultiAvailabilityZone": false,
                "MasterAvailabilityZone": "cn-beijing-6a",
                "SlaveAvailabilityZone": "cn-beijing-6a",
                "ProductId": "2dc211a6-156b-4eaa-b012-a17e9163447f",
                "ServiceEndTime": "2018-04-01T23:59:59+0800",
                "OrderUse": "BUY",
                "ProjectId": 0,
                "ProjectName": "默认项目"
            },
            {
                "DBInstanceClass": {
                    "Id": "RDSOpenAPI_bb0b4cbff280227c",
                    "Vcpus": 1,
                    "Disk": 15,
                    "Ram": 1
                },
                "DBInstanceIdentifier": "7ad090ce-fb39-4067-8854-10391a750cf5",
                "DBInstanceName": "krds_20180301115427",
                "DBInstanceStatus": "ACTIVE",
                "DBInstanceType": "HRDS",
                "DBParameterGroupId": "6ec6cd33-4ead-4f4d-8b90-de231b26a452",
                "GroupId": "7e4f64ca-1237-4adf-8583-be3046d0737e",
                "SecurityGroupId": "55180",
                "Vip": "10.0.1.130",
                "Port": 3306,
                "Engine": "mysql",
                "EngineVersion": "5.6",
                "InstanceCreateTime": "2018-03-01T11:54:47+0800",
                "MasterUserName": "admin",
                "DatastoreVersionId": "96867ed6-6f6a-4006-bbc5-46c1f22d63a9",
                "Region": "cn-beijing-6",
                "VpcId": "c1d332f1-164b-4066-902a-149e75a51ad4",
                "SubnetId": "2f8b762b-b8c9-400d-a989-96ea2ea7a5f9",
                "PubliclyAccessible": true,
                "ReadReplicaDBInstanceIdentifiers": [],
                "BillType": "YEAR_MONTH",
                "OrderType": "REGULAR",
                "OrderSource": "CONSOLE",
                "MultiAvailabilityZone": false,
                "MasterAvailabilityZone": "cn-beijing-6a",
                "SlaveAvailabilityZone": "cn-beijing-6a",
                "ProductId": "1aaa30b2-1093-4e4d-8355-40aa6aa2a46b",
                "ServiceEndTime": "2018-04-01T23:59:59+0800",
                "OrderUse": "BUY",
                "ProjectId": 0,
                "ProjectName": "默认项目"
            },
            {
                "DBInstanceClass": {
                    "Id": "RDSOpenAPI_bb0b4cbff280227c",
                    "Vcpus": 1,
                    "Disk": 15,
                    "Ram": 1
                },
                "DBInstanceIdentifier": "c0844c1f-4351-43f7-b4f9-6049012fc854",
                "DBInstanceName": "krds_20180227095801",
                "DBInstanceStatus": "ACTIVE",
                "DBInstanceType": "HRDS",
                "DBParameterGroupId": "ceb37164-3140-487b-bff7-39ddafe8083e",
                "GroupId": "c012259b-15a0-41d3-9078-463c6d7627cb",
                "SecurityGroupId": "55141",
                "Vip": "10.22.41.28",
                "Port": 3306,
                "Engine": "mysql",
                "EngineVersion": "5.6",
                "InstanceCreateTime": "2018-02-27T09:59:44+0800",
                "MasterUserName": "admin",
                "DatastoreVersionId": "96867ed6-6f6a-4006-bbc5-46c1f22d63a9",
                "Region": "cn-beijing-6",
                "VpcId": "c5e37d54-6791-4283-8961-2816412c4263",
                "SubnetId": "7ef1376f-a040-4d8a-be4a-3de9a436f041",
                "PubliclyAccessible": true,
                "ReadReplicaDBInstanceIdentifiers": [],
                "BillType": "YEAR_MONTH",
                "OrderType": "REGULAR",
                "OrderSource": "CONSOLE",
                "MultiAvailabilityZone": false,
                "MasterAvailabilityZone": "cn-beijing-6a",
                "SlaveAvailabilityZone": "cn-beijing-6a",
                "ProductId": "a89d8f0d-c6da-4f20-b6f6-071cde8e7cc2",
                "ServiceEndTime": "2018-03-27T23:59:59+0800",
                "OrderUse": "BUY",
                "ProjectId": 0,
                "ProjectName": "默认项目"
            },
            {
                "DBInstanceClass": {
                    "Id": "RDSOpenAPI_0772c82ea87c666d",
                    "Vcpus": 1,
                    "Disk": 10,
                    "Ram": 1
                },
                "DBInstanceIdentifier": "ab6fc9f3-9d91-466d-a843-800531d72458",
                "DBInstanceName": "p56",
                "DBInstanceStatus": "ACTIVE",
                "DBInstanceType": "HRDS",
                "DBParameterGroupId": "f7b13f2d-a906-4dd1-b96c-93340b2c8da2",
                "GroupId": "fac85cf0-0120-49c0-a73a-85f4c6850f20",
                "SecurityGroupId": "54453",
                "Vip": "10.0.1.134",
                "Port": 3306,
                "Engine": "percona",
                "EngineVersion": "5.6",
                "InstanceCreateTime": "2018-01-19T10:39:03+0800",
                "MasterUserName": "admin",
                "DatastoreVersionId": "fefcbba4-9ba7-47f9-9e30-69ca7c128255",
                "Region": "cn-beijing-6",
                "VpcId": "c1d332f1-164b-4066-902a-149e75a51ad4",
                "SubnetId": "2f8b762b-b8c9-400d-a989-96ea2ea7a5f9",
                "PubliclyAccessible": true,
                "ReadReplicaDBInstanceIdentifiers": [],
                "BillType": "YEAR_MONTH",
                "OrderType": "REGULAR",
                "OrderSource": "CONSOLE",
                "MultiAvailabilityZone": false,
                "MasterAvailabilityZone": "cn-beijing-6a",
                "SlaveAvailabilityZone": "cn-beijing-6a",
                "ProductId": "b403a0b6-a6e7-4f0b-b857-52eb741a4a49",
                "ServiceEndTime": "2018-04-19T23:59:59+0800",
                "OrderUse": "RENEW",
                "ProjectId": 0,
                "ProjectName": "默认项目"
            },
            {
                "DBInstanceClass": {
                    "Id": "RDSOpenAPI_aeeb0ef635192107",
                    "Vcpus": 2,
                    "Disk": 60,
                    "Ram": 4
                },
                "DBInstanceIdentifier": "9f965c6b-1387-42bb-b9dc-792748108a0c",
                "DBInstanceName": "qhy_dts_test2",
                "DBInstanceStatus": "INVALID",
                "DBInstanceType": "HA",
                "DBParameterGroupId": "332e627a-a96b-4417-aca5-c89525929dcf",
                "GroupId": "fcdb3d5d-39ea-4b79-8adc-90f1b9ee2b32",
                "SecurityGroupId": "54224",
                "Vip": "10.0.1.141",
                "Port": 3306,
                "Engine": "mysql",
                "EngineVersion": "5.6",
                "InstanceCreateTime": "2018-01-16T11:16:12+0800",
                "MasterUserName": "admin",
                "DatastoreVersionId": "96867ed6-6f6a-4006-bbc5-46c1f22d63a9",
                "Region": "cn-beijing-6",
                "VpcId": "c1d332f1-164b-4066-902a-149e75a51ad4",
                "SubnetId": "2f8b762b-b8c9-400d-a989-96ea2ea7a5f9",
                "PubliclyAccessible": true,
                "ReadReplicaDBInstanceIdentifiers": [],
                "BillType": "YEAR_MONTH",
                "OrderType": "REGULAR",
                "OrderSource": "CONSOLE",
                "MultiAvailabilityZone": false,
                "MasterAvailabilityZone": "cn-beijing-6a",
                "SlaveAvailabilityZone": "cn-beijing-6a",
                "ProductId": "00c7df86-879d-4477-a58c-5954319698f7",
                "ServiceEndTime": "2018-03-16T23:59:59+0800",
                "OrderUse": "RENEW",
                "ProjectId": 0,
                "ProjectName": "默认项目"
            },
            {
                "DBInstanceClass": {
                    "Id": "RDSOpenAPI_dfa4e4afc97087bc",
                    "Vcpus": 1,
                    "Disk": 30,
                    "Ram": 2
                },
                "DBInstanceIdentifier": "d854023d-05e5-45c0-ba09-7bbf2ba6982c",
                "DBInstanceName": "dts_test2",
                "DBInstanceStatus": "ACTIVE",
                "DBInstanceType": "HA",
                "DBParameterGroupId": "b9004913-6da0-49e9-b73c-232353f3d5fd",
                "GroupId": "15ac46f9-e711-4490-a309-5dab68cbb281",
                "SecurityGroupId": "54127",
                "Vip": "10.0.1.184",
                "Port": 3306,
                "Engine": "mysql",
                "EngineVersion": "5.6",
                "InstanceCreateTime": "2018-01-12T15:33:50+0800",
                "MasterUserName": "admin",
                "DatastoreVersionId": "96867ed6-6f6a-4006-bbc5-46c1f22d63a9",
                "Region": "cn-beijing-6",
                "VpcId": "821575bf-13a7-4419-8fdc-b55496425b24",
                "SubnetId": "acb6229c-70f3-4b87-af68-2c75ceb3d6b7",
                "PubliclyAccessible": true,
                "ReadReplicaDBInstanceIdentifiers": [],
                "BillType": "DAY",
                "OrderType": "REGULAR",
                "OrderSource": "CONSOLE",
                "MultiAvailabilityZone": false,
                "MasterAvailabilityZone": "cn-beijing-6a",
                "SlaveAvailabilityZone": "cn-beijing-6a",
                "ProductId": "5ae902ec-8025-4bcd-95db-cdab47bdeaab",
                "OrderUse": "BUY",
                "Eip": "120.131.15.40",
                "EipPort": "63426",
                "ProjectId": 0,
                "ProjectName": "默认项目"
            },
            {
                "DBInstanceClass": {
                    "Id": "RDSOpenAPI_dfa4e4afc97087bc",
                    "Vcpus": 1,
                    "Disk": 30,
                    "Ram": 2
                },
                "DBInstanceIdentifier": "49436868-2b4e-4d4b-be39-ee554b15aba3",
                "DBInstanceName": "dts_test",
                "DBInstanceStatus": "ACTIVE",
                "DBInstanceType": "HA",
                "DBParameterGroupId": "3cfa3e52-5b56-45da-9ac1-def732c5f5ca",
                "GroupId": "e2333265-4a59-4e9c-9a39-08b7c90b3639",
                "SecurityGroupId": "54126",
                "Vip": "10.0.1.183",
                "Port": 3306,
                "Engine": "mysql",
                "EngineVersion": "5.6",
                "InstanceCreateTime": "2018-01-12T15:17:02+0800",
                "MasterUserName": "admin",
                "DatastoreVersionId": "96867ed6-6f6a-4006-bbc5-46c1f22d63a9",
                "Region": "cn-beijing-6",
                "VpcId": "821575bf-13a7-4419-8fdc-b55496425b24",
                "SubnetId": "acb6229c-70f3-4b87-af68-2c75ceb3d6b7",
                "PubliclyAccessible": true,
                "ReadReplicaDBInstanceIdentifiers": [],
                "BillType": "DAY",
                "OrderType": "REGULAR",
                "OrderSource": "CONSOLE",
                "MultiAvailabilityZone": false,
                "MasterAvailabilityZone": "cn-beijing-6a",
                "SlaveAvailabilityZone": "cn-beijing-6a",
                "ProductId": "ae9c9a13-8278-40c9-bb87-1c97c82f028d",
                "OrderUse": "BUY",
                "Eip": "120.131.12.26",
                "EipPort": "33735",
                "ProjectId": 0,
                "ProjectName": "默认项目"
            }
        ],
        "TotalCount": 13,
        "MaxRecords": 10,
        "Marker": 11
    },
    "RequestId": "a92d1fc7-178f-4f77-b1b6-09877301b120"
    }
  • 详情返回:
    {
    "Data": {
        "Instances": [
            {
                "DBInstanceClass": {
                    "Id": "RDSOpenAPI_0772c82ea87c666d",
                    "Vcpus": 1,
                    "Disk": 10,
                    "Ram": 1
                },
                "DBInstanceIdentifier": "bb2d111a-af44-41ee-b10d-754f23bc59e1",
                "PreferredBackupWindow": 1440,
                "BackupRetentionPeriod": 30,
                "PreferredBackupTime": "02:00-03:00",
                "DBInstanceName": "test",
                "DBInstanceStatus": "ACTIVE",
                "DBInstanceType": "HA",
                "DBParameterGroupId": "3b9aeb7b-552b-4707-92b2-15f0278bb73e",
                "GroupId": "71e2bd82-423d-41ae-a9e6-2131a447d780",
                "SecurityGroupId": "55705",
                "Vip": "10.69.59.242",
                "Port": 3306,
                "Engine": "mysql",
                "EngineVersion": "5.6",
                "InstanceCreateTime": "2018-03-20T11:03:22+0800",
                "MasterUserName": "test",
                "DatastoreVersionId": "96867ed6-6f6a-4006-bbc5-46c1f22d63a9",
                "Region": "cn-beijing-6",
                "VpcId": "0f71c616-6f5e-4f24-b809-59eb84016367",
                "PubliclyAccessible": false,
                "ReadReplicaDBInstanceIdentifiers": [
                    {
                        "id": "8e706675-3e5f-4f9c-a642-c9da21744d27",
                        "Vip": "10.69.56.2",
                        "ReadReplicaDBInstanceIdentifier": "488fcb98-8706-4954-aaf8-050d79b3ea9e"
                    }
                ],
                "BillType": "DAY",
                "OrderType": "REGULAR",
                "OrderSource": "OPENAPI",
                "MultiAvailabilityZone": false,
                "MasterAvailabilityZone": "cn-beijing-6b",
                "SlaveAvailabilityZone": "cn-beijing-6a",
                "ProductId": "ed8b94df-68e0-47dc-a86b-017d1426a8cd",
                "DiskUsed": 0.26953125,
                "OrderUse": "BUY",
                "ProjectId": 0,
                "ProjectName": "默认项目"
            }
        ]
    },
    "RequestId": "00c72a39-702d-4088-806a-c58a837864d2"
    }

金山云,开启您的云计算之旅

注册有礼