Obtaining Network Resources
Function
This API is used to obtain network resources.
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.
URI
GET /v1/{project_id}/networks
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. For details, see Obtaining a Project ID and Name. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
labelSelector |
No |
String |
Filter by label. |
limit |
No |
Integer |
Number of records returned for a single pagination query. |
continue |
No |
String |
Previous query location in pagination query. |
Request Parameters
None
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
apiVersion |
String |
API version. Options:
|
kind |
String |
Resource type. Options:
|
metadata |
metadata object |
Metadata of network resources. |
items |
Array of Network objects |
Network resources. |
Parameter |
Type |
Description |
---|---|---|
continue |
String |
Next query location in pagination query. |
remainingItemCount |
Integer |
Remaining resources. |
Parameter |
Type |
Description |
---|---|---|
apiVersion |
String |
API version. Options:
|
kind |
String |
Resource type. Options:
|
metadata |
NeworkMetadata object |
Metadata of network resources. |
spec |
NetworkSpec object |
Description of network resources. |
status |
NetworkStatus object |
Status of network resources. |
Parameter |
Type |
Description |
---|---|---|
name |
String |
Network name automatically generated by the system, which is equivalent to networkId. networkId indicates the unique ID generated by ModelArts based on the network name entered by the user. |
creationTimestamp |
String |
Timestamp, for example, 2021-11-01T03:49:41Z. |
labels |
NetworkMetadataLabels object |
Labels of network resources. |
annotations |
NetworkMetadataAnnotations object |
Annotations of network resources. |
Parameter |
Type |
Description |
---|---|---|
os.modelarts/name |
String |
Specified network name. |
os.modelarts/workspace.id |
String |
Workspace ID The default value is 0, indicating the default workspace. |
Parameter |
Type |
Description |
---|---|---|
os.modelarts/description |
String |
Network resource description, which is used to describe a scenario. The following special characters are not allowed: !<>=&"' |
Parameter |
Type |
Description |
---|---|---|
cidr |
String |
Network CIDR. Value range:
|
connection |
NetworkConnection object |
Information about the connection between the current network and other cloud services. |
Parameter |
Type |
Description |
---|---|---|
peerConnectionList |
Array of peerConnectionList objects |
List of networks that can be connected in peer mode. |
Parameter |
Type |
Description |
---|---|---|
peerVpcId |
String |
Indicates the ID of the peer VPC. |
peerSubnetId |
String |
ID of the peer subnet. |
defaultGateWay |
Boolean |
Whether the default gateway is enabled. |
Parameter |
Type |
Description |
---|---|---|
phase |
String |
Current network status. Options:
|
connectionStatus |
NetworkConnectionStatus object |
Indicates the connection status between the network and other cloud services. |
Parameter |
Type |
Description |
---|---|---|
peerConnectionStatus |
Array of peerConnectionStatus objects |
Indicates the status information list of the network in peer mode. |
sfsTurboStatus |
Array of sfsTurboStatus objects |
Specifies the list of SFS Turbos that can be connected to the network. |
Parameter |
Type |
Description |
---|---|---|
peerVpcId |
String |
Indicates the ID of the peer VPC. |
peerSubnetId |
String |
ID of the peer subnet. |
defaultGateWay |
Boolean |
Whether the default gateway is enabled. |
phase |
String |
Connection status of the network. The options are as follows:
|
Parameter |
Type |
Description |
---|---|---|
sfsId |
String |
Specifies the SFS Turbo ID. |
name |
String |
Specifies the name of the SFS Turbo. |
status |
String |
Specifies the status of the connection to the SFS Turbo. The options are as follows:
|
ipAddr |
String |
Specifies the address for accessing SFS Turbo. |
Example Requests
Obtain resource pools.
GET https://{endpoint}/v2/{project_id}/pools { }
Example Responses
Status code: 200
OK
{ "kind" : "NetworkList", "apiVersion" : "v1", "metadata" : { }, "items" : [ { "kind" : "Network", "apiVersion" : "v1", "metadata" : { "name" : "network-7a03-86c13962597848eeb29c5861153a391f", "creationTimestamp" : "2022-09-16T09:44:59Z", "labels" : { "os.modelarts/name" : "network-7a03", "os.modelarts/workspace.id" : "0" }, "annotations" : { } }, "spec" : { "cidr" : "192.168.128.0/17", "connection" : { } }, "status" : { "phase" : "Active", "connectionStatus" : { } } } ] }
Status Codes
Status Code |
Description |
---|---|
200 |
OK |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot