Help Center/ ModelArts/ API Reference/ Resource Management/ Obtaining a Network Resource
Updated on 2025-08-20 GMT+08:00

Obtaining a Network Resource

Function

This API is used to obtain details about a specified network resource.

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/{network_name}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition: Project ID. For details, see Obtaining a Project ID and Name.

Constraints: N/A

Range: N/A

Default Value: N/A

network_name

Yes

String

Definition: Network ID. The value is obtained from the metadata.name field in the network details.

Constraints: N/A

*Range: The value can contain 36 to 63 characters. It must start with a lowercase letter and cannot end with a hyphen (-). Digits and hyphens (-) are allowed.

Default Value: N/A

Request Parameters

None

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

apiVersion

String

Definition: API version of a resource.

Constraints: N/A

Range:

  • v1: The current resource version is v1.

Default Value: N/A

kind

String

Definition: Resource type.

Constraints: N/A

Range:

  • Network

Default Value: N/A

metadata

NeworkMetadata object

Definition: Metadata of a network resource.

Constraints: N/A

Range: N/A

Default Value: N/A

spec

NetworkSpec object

Definition: Specifications of a network resource.

Constraints: N/A

Range: N/A

Default Value: N/A

status

NetworkStatus object

Definition: Status of a network resource.

Constraints: N/A

Range: N/A

Default Value: N/A

Table 3 NeworkMetadata

Parameter

Type

Description

name

String

Definition: Network resource ID.

Constraints: N/A

Range: N/A

Default Value: N/A

creationTimestamp

String

Definition: Network creation time. Example: 2025-11-01T03:49:41Z.

Constraints: N/A

Range: N/A

Default Value: N/A

labels

NetworkMetadataLabels object

Definition: Network labels.

Constraints: N/A

Range: N/A

Default Value: N/A

annotations

NetworkMetadataAnnotations object

Definition: Network annotations.

Constraints: N/A

Range: N/A

Default Value: N/A

Table 4 NetworkMetadataLabels

Parameter

Type

Description

os.modelarts/name

String

Definition: Display name of a resource pool.

Constraints: N/A

*Range: The value can contain 4 to 32 characters. It must start with a lowercase letter and cannot end with a hyphen (-). Digits and hyphens (-) are allowed.

Default Value: N/A

os.modelarts/workspace.id

String

Definition: Workspace ID. For details about how to obtain the ID, see Querying the Workspace List.

Constraints: N/A

Range: N/A

Default Value: 0

Table 5 NetworkMetadataAnnotations

Parameter

Type

Description

os.modelarts/description

String

Definition: Network description.

Constraints: N/A

Range: The value cannot contain these characters: !<>=&"'.

Default Value: N/A

Table 6 NetworkSpec

Parameter

Type

Description

cidr

String

Definition: CIDR value of a network.

Constraints: N/A

Range:

  • 172.16.0.0/12 to 172.16.0.0/24

  • 192.168.0.0/16 to 192.168.0.0/24

Default Value: N/A

connection

NetworkConnection object

Definition: Connection information between the current network and other resources.

Constraints: N/A

Range: N/A

Default Value: N/A

Table 7 NetworkConnection

Parameter

Type

Description

peerConnectionList

Array of peerConnectionList objects

Definition: Peering connections.

Constraints: N/A

Range: N/A

Default Value: N/A

Table 8 peerConnectionList

Parameter

Type

Description

peerVpcId

String

Definition: Peer network ID.

Constraints: N/A

Range: N/A

Default Value: N/A

peerSubnetId

String

Definition: Peer subnet ID.

Constraints: N/A

Range: N/A

Default Value: N/A

defaultGateWay

Boolean

Definition: Specifies whether to create a default route.

Constraints: N/A

Range:

  • true: A default route is created.

  • false: A default route is not created.

Default Value: false

Table 9 NetworkStatus

Parameter

Type

Description

phase

String

Definition: Current status of a network resource.

Constraints: N/A

Range:

  • Creating: The network is being created.

  • Active: The network is functional.

  • Abnormal: The network is abnormal.

Default Value: N/A

connectionStatus

NetworkConnectionStatus object

Definition: Connection status between the network and other cloud services.

Constraints: N/A

Range: N/A

Default Value: N/A

Table 10 NetworkConnectionStatus

Parameter

Type

Description

peerConnectionStatus

Array of peerConnectionStatus objects

Definition: Peering connection statuses

Constraints: N/A

Range: N/A

Default Value: N/A

sfsTurboStatus

Array of sfsTurboStatus objects

Definition: Statuses of network connection to SFS Turbo.

Constraints: N/A

Range: N/A

Default Value: N/A

Table 11 peerConnectionStatus

Parameter

Type

Description

peerVpcId

String

Definition: Peer network ID.

Constraints: N/A

Range: N/A

Default Value: N/A

peerSubnetId

String

Definition: Peer subnet ID.

Constraints: N/A

Range: N/A

Default Value: N/A

defaultGateWay

Boolean

Definition: Specifies whether to create a default route.

Constraints: N/A

Range:

  • true: A default route is created.

  • false: A default route is not created.

Default Value: false

phase

String

Definition: Peer connection status.

Constraints: N/A

Range:

  • Connecting: The network is being connected.

  • Active: The network is connected properly.

  • Abnormal: The network connection is abnormal.

Default Value: N/A

Table 12 sfsTurboStatus

Parameter

Type

Description

sfsId

String

Definition: ID of the connected SFS Turbo file system.

Constraints: N/A

Range: N/A

Default Value: N/A

name

String

Definition: Name of the connected SFS Turbo file system.

Constraints: N/A

Range: N/A

Default Value: N/A

status

String

Definition: Connection status of the SFS Turbo file system.

Constraints: N/A

Range:

  • Active: The SFS connection is normal.

  • Abnormal: The SFS connection is abnormal.

Default Value: N/A

ipAddr

String

Definition: Access address of the connected SFS Turbo file system.

Constraints: N/A

Range: N/A

Default Value: N/A

Status code: 404

Table 13 Response body parameters

Parameter

Type

Description

error_code

String

  • Definition: ModelArts error code.

Range: N/A

error_msg

String

Definition: Error message.

Range: N/A

Example Requests

Obtain details about a network.

GET https://{endpoint}/v1/{project_id}/networks/{network_name}

{ }

Example Responses

Status code: 200

OK

{
  "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 code: 404

Not found.

{
  "error_code" : "ModelArts.50025001",
  "error_msg" : "Network not exist."
}

Status Codes

Status Code

Description

200

OK

404

Not found.

Error Codes

See Error Codes.