Develop for XenServer

Class: network

A virtual network

Fields for class: network

Field Type Qualifier Description
allowed_operations network_operations set RO/runtime list of the operations allowed in this state. This list is advisory only and the server state may have changed by the time this field is read by a client.
assigned_ips (VIF ref -> string) map RO/runtime The IP addresses assigned to VIFs on networks that have active xapi-managed DHCP
blobs (string -> blob ref) map RO/runtime Binary blobs associated with this network
bridge string RO/constructor name of the bridge corresponding to this network on the local host
current_operations (string -> network_operations) map RO/runtime links each of the running tasks using this object (by reference) to a current_operation enum which describes the nature of the task.
default_locking_mode network_default_locking_mode RO/runtime The network will use this value to determine the behaviour of all VIFs where locking_mode = default
managed bool RO/constructor true if the bridge is managed by xapi
MTU int RW MTU in octets
name_description string RW a notes field containing human-readable description
name_label string RW a human-readable name
other_config (string -> string) map RW additional configuration
PIFs PIF ref set RO/runtime list of connected pifs
purpose network_purpose set RO/runtime Set of purposes for which the server will use this network
tags string set RW user-specified tags for categorization purposes
uuid string RO/runtime Unique identifier/object reference
VIFs VIF ref set RO/runtime list of connected vifs

RPCs associated with class: network

RPC name: add_purpose

Overview:

Give a network a new purpose (if not present already)

Signature:

void add_purpose (session ref session_ref, network ref self, network_purpose value)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
network ref self The network
network_purpose value The purpose to add

Minimum Role: pool-admin

Return Type: void

Possible Error Codes: NETWORK_INCOMPATIBLE_PURPOSES

RPC name: add_tags

Overview:

Add the given value to the tags field of the given network. If the value is already in that Set, then do nothing.

Signature:

void add_tags (session ref session_ref, network ref self, string value)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
network ref self reference to the object
string value New value to add

Minimum Role: vm-operator

Return Type: void

RPC name: add_to_other_config

Overview:

Add the given key-value pair to the other_config field of the given network.

Signature:

void add_to_other_config (session ref session_ref, network ref self, string key, string value)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
network ref self reference to the object
string key Key to add
string value Value to add

Minimum Role: pool-operator

Return Type: void

RPC name: create

Overview:

Create a new network instance, and return its handle.

Signature:

network ref create (session ref session_ref, network record args)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
network record args All constructor arguments

Minimum Role: vm-admin

Return Type: network ref

reference to the newly created object

RPC name: create_new_blob

Overview:

Create a placeholder for a named binary blob of data that is associated with this pool

Signature:

blob ref create_new_blob (session ref session_ref, network ref network, string name, string mime_type, bool public)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
network ref network The network
string name The name associated with the blob
string mime_type The mime type for the data. Empty string translates to application/octet-stream
bool public True if the blob should be publicly available

Minimum Role: pool-operator

Return Type: blob ref

The reference of the blob, needed for populating its data

RPC name: destroy

Overview:

Destroy the specified network instance.

Signature:

void destroy (session ref session_ref, network ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
network ref self reference to the object

Minimum Role: vm-admin

Return Type: void

RPC name: get_all

Overview:

Return a list of all the networks known to the system.

Signature:

network ref set get_all (session ref session_ref)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session

Minimum Role: read-only

Return Type: network ref set

references to all objects

RPC name: get_all_records

Overview:

Return a map of network references to network records for all networks known to the system.

Signature:

(network ref -> network record) map get_all_records (session ref session_ref)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session

Minimum Role: read-only

Return Type: (network ref -> network record) map

records of all objects

RPC name: get_allowed_operations

Overview:

Get the allowed_operations field of the given network.

Signature:

network_operations set get_allowed_operations (session ref session_ref, network ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
network ref self reference to the object

Minimum Role: read-only

Return Type: network_operations set

value of the field

RPC name: get_assigned_ips

Overview:

Get the assigned_ips field of the given network.

Signature:

(VIF ref -> string) map get_assigned_ips (session ref session_ref, network ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
network ref self reference to the object

Minimum Role: read-only

Return Type: (VIF ref -> string) map

value of the field

RPC name: get_blobs

Overview:

Get the blobs field of the given network.

Signature:

(string -> blob ref) map get_blobs (session ref session_ref, network ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
network ref self reference to the object

Minimum Role: read-only

Return Type: (string -> blob ref) map

value of the field

RPC name: get_bridge

Overview:

Get the bridge field of the given network.

Signature:

string get_bridge (session ref session_ref, network ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
network ref self reference to the object

Minimum Role: read-only

Return Type: string

value of the field

RPC name: get_by_name_label

Overview:

Get all the network instances with the given label.

Signature:

network ref set get_by_name_label (session ref session_ref, string label)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
string label label of object to return

Minimum Role: read-only

Return Type: network ref set

references to objects with matching names

RPC name: get_by_uuid

Overview:

Get a reference to the network instance with the specified UUID.

Signature:

network ref get_by_uuid (session ref session_ref, string uuid)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
string uuid UUID of object to return

Minimum Role: read-only

Return Type: network ref

reference to the object

RPC name: get_current_operations

Overview:

Get the current_operations field of the given network.

Signature:

(string -> network_operations) map get_current_operations (session ref session_ref, network ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
network ref self reference to the object

Minimum Role: read-only

Return Type: (string -> network_operations) map

value of the field

RPC name: get_default_locking_mode

Overview:

Get the default_locking_mode field of the given network.

Signature:

network_default_locking_mode get_default_locking_mode (session ref session_ref, network ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
network ref self reference to the object

Minimum Role: read-only

Return Type: network_default_locking_mode

value of the field

RPC name: get_managed

Overview:

Get the managed field of the given network.

Signature:

bool get_managed (session ref session_ref, network ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
network ref self reference to the object

Minimum Role: read-only

Return Type: bool

value of the field

RPC name: get_MTU

Overview:

Get the MTU field of the given network.

Signature:

int get_MTU (session ref session_ref, network ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
network ref self reference to the object

Minimum Role: read-only

Return Type: int

value of the field

RPC name: get_name_description

Overview:

Get the name/description field of the given network.

Signature:

string get_name_description (session ref session_ref, network ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
network ref self reference to the object

Minimum Role: read-only

Return Type: string

value of the field

RPC name: get_name_label

Overview:

Get the name/label field of the given network.

Signature:

string get_name_label (session ref session_ref, network ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
network ref self reference to the object

Minimum Role: read-only

Return Type: string

value of the field

RPC name: get_other_config

Overview:

Get the other_config field of the given network.

Signature:

(string -> string) map get_other_config (session ref session_ref, network ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
network ref self reference to the object

Minimum Role: read-only

Return Type: (string -> string) map

value of the field

RPC name: get_PIFs

Overview:

Get the PIFs field of the given network.

Signature:

PIF ref set get_PIFs (session ref session_ref, network ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
network ref self reference to the object

Minimum Role: read-only

Return Type: PIF ref set

value of the field

RPC name: get_purpose

Overview:

Get the purpose field of the given network.

Signature:

network_purpose set get_purpose (session ref session_ref, network ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
network ref self reference to the object

Minimum Role: read-only

Return Type: network_purpose set

value of the field

RPC name: get_record

Overview:

Get a record containing the current state of the given network.

Signature:

network record get_record (session ref session_ref, network ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
network ref self reference to the object

Minimum Role: read-only

Return Type: network record

all fields from the object

RPC name: get_tags

Overview:

Get the tags field of the given network.

Signature:

string set get_tags (session ref session_ref, network ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
network ref self reference to the object

Minimum Role: read-only

Return Type: string set

value of the field

RPC name: get_uuid

Overview:

Get the uuid field of the given network.

Signature:

string get_uuid (session ref session_ref, network ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
network ref self reference to the object

Minimum Role: read-only

Return Type: string

value of the field

RPC name: get_VIFs

Overview:

Get the VIFs field of the given network.

Signature:

VIF ref set get_VIFs (session ref session_ref, network ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
network ref self reference to the object

Minimum Role: read-only

Return Type: VIF ref set

value of the field

RPC name: remove_from_other_config

Overview:

Remove the given key and its corresponding value from the other_config field of the given network. If the key is not in that Map, then do nothing.

Signature:

void remove_from_other_config (session ref session_ref, network ref self, string key)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
network ref self reference to the object
string key Key to remove

Minimum Role: pool-operator

Return Type: void

RPC name: remove_purpose

Overview:

Remove a purpose from a network (if present)

Signature:

void remove_purpose (session ref session_ref, network ref self, network_purpose value)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
network ref self The network
network_purpose value The purpose to remove

Minimum Role: pool-admin

Return Type: void

RPC name: remove_tags

Overview:

Remove the given value from the tags field of the given network. If the value is not in that Set, then do nothing.

Signature:

void remove_tags (session ref session_ref, network ref self, string value)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
network ref self reference to the object
string value Value to remove

Minimum Role: vm-operator

Return Type: void

RPC name: set_default_locking_mode

Overview:

Set the default locking mode for VIFs attached to this network

Signature:

void set_default_locking_mode (session ref session_ref, network ref network, network_default_locking_mode value)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
network ref network The network
network_default_locking_mode value The default locking mode for VIFs attached to this network.

Minimum Role: pool-operator

Return Type: void

RPC name: set_MTU

Overview:

Set the MTU field of the given network.

Signature:

void set_MTU (session ref session_ref, network ref self, int value)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
network ref self reference to the object
int value New value to set

Minimum Role: vm-admin

Return Type: void

RPC name: set_name_description

Overview:

Set the name/description field of the given network.

Signature:

void set_name_description (session ref session_ref, network ref self, string value)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
network ref self reference to the object
string value New value to set

Minimum Role: pool-operator

Return Type: void

RPC name: set_name_label

Overview:

Set the name/label field of the given network.

Signature:

void set_name_label (session ref session_ref, network ref self, string value)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
network ref self reference to the object
string value New value to set

Minimum Role: pool-operator

Return Type: void

RPC name: set_other_config

Overview:

Set the other_config field of the given network.

Signature:

void set_other_config (session ref session_ref, network ref self, (string -> string) map value)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
network ref self reference to the object
(string -> string) map value New value to set

Minimum Role: pool-operator

Return Type: void

RPC name: set_tags

Overview:

Set the tags field of the given network.

Signature:

void set_tags (session ref session_ref, network ref self, string set value)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
network ref self reference to the object
string set value New value to set

Minimum Role: vm-operator

Return Type: void