C# Class ConoHaNet.Objects.Servers.Server

Inheritance: SimpleServer
Exibir arquivo Open project: crowdy/OpenStack-ConoHa

Private Properties

Property Type Description

Public Methods

Method Description
AddMetadata ( Metadata metadata ) : bool

Updates the metadata for the server.

For each item in metadata, if the key exists, the value is updated; otherwise, the item is added.

AddMetadata ( string key, string value ) : bool

Adds or updates the value for the specified metadata item.

CreateVirtualInterface ( string networkId ) : VirtualInterface

Creates a virtual interface for the specified network and attaches the network to the server.

Delete ( ) : bool

Marks the server for asynchronous deletion.

The server deletion operation is completed asynchronously. The ServerBase.WaitForDeleted method may be used to block execution until the server is finally deleted.

DeleteMetadata ( Metadata metadata ) : bool

Deletes the specified metadata items from the server.

This method ignores the values in metadata. Metadata items are removed whether or not their current values match those in metadata.

DeleteMetadataItem ( string key ) : bool

Deletes the specified metadata item from the server.

DeleteVirtualInterface ( string virtualInterfaceId ) : bool

Deletes the specified virtual interface from the server.

GetMetadata ( ) : Metadata

Gets the metadata associated with the server.

GetVolumes ( ) : IEnumerable

Lists the volume attachments for the server.

ListAddresses ( ) : ServerAddresses

Lists all networks and server addresses associated with a server.

ListAddressesByNetwork ( string networkLabel ) : IEnumerable

Lists addresses for the server associated with the specified network.

ListVirtualInterfaces ( ) : IEnumerable

Lists the virtual interfaces for the server.

SetMetadata ( Metadata metadata ) : bool

Sets the metadata associated with the server, replacing any existing metadata.

Snapshot ( string imageName, Metadata metadata = null ) : ServerImage

Creates a new snapshot image for the server at its current state.

The server snapshot process is completed asynchronously. To wait for the image to be completed, you may call SimpleServerImage.WaitForActive on the returned image.

UpdateMetadata ( Metadata metadata ) : bool

Updates the metadata for the server.

For each item in metadata, if the key exists, the value is updated; otherwise, the item is added.

UpdateMetadataItem ( string key, string value ) : bool

Sets the value for the specified metadata item. If the key already exists, it is updated; otherwise, a new metadata item is added.

Protected Methods

Method Description
UpdateThis ( ServerBase server ) : void

Method Details

AddMetadata() public method

Updates the metadata for the server.
For each item in metadata, if the key exists, the value is updated; otherwise, the item is added.
If is . If contains any values with empty keys. If the REST API request failed.
public AddMetadata ( Metadata metadata ) : bool
metadata Metadata The server metadata to update.
return bool

AddMetadata() public method

Adds or updates the value for the specified metadata item.
/// If is . /// -or- /// If is . /// If is empty. If the REST API request failed.
public AddMetadata ( string key, string value ) : bool
key string The metadata key.
value string The new value for the metadata item.
return bool

CreateVirtualInterface() public method

Creates a virtual interface for the specified network and attaches the network to the server.
If is . If is empty. If the REST API request failed.
public CreateVirtualInterface ( string networkId ) : VirtualInterface
networkId string The network ID. This is obtained from CloudNetwork.Id.
return VirtualInterface

Delete() public method

Marks the server for asynchronous deletion.
The server deletion operation is completed asynchronously. The ServerBase.WaitForDeleted method may be used to block execution until the server is finally deleted.
If the REST API request failed.
public Delete ( ) : bool
return bool

DeleteMetadata() public method

Deletes the specified metadata items from the server.
This method ignores the values in metadata. Metadata items are removed whether or not their current values match those in metadata.
If is . If contains a null or empty key. If the REST API request failed.
public DeleteMetadata ( Metadata metadata ) : bool
metadata Metadata A collection of metadata items to delete.
return bool

DeleteMetadataItem() public method

Deletes the specified metadata item from the server.
If is . If is empty. If the REST API request failed.
public DeleteMetadataItem ( string key ) : bool
key string The metadata key.
return bool

DeleteVirtualInterface() public method

Deletes the specified virtual interface from the server.
If is . If is empty. If the REST API request failed.
public DeleteVirtualInterface ( string virtualInterfaceId ) : bool
virtualInterfaceId string The virtual interface ID. This is obtained from VirtualInterface.Id.
return bool

GetMetadata() public method

Gets the metadata associated with the server.
If the REST API request failed.
public GetMetadata ( ) : Metadata
return Metadata

GetVolumes() public method

Lists the volume attachments for the server.
If the REST API request failed.
public GetVolumes ( ) : IEnumerable
return IEnumerable

ListAddresses() public method

Lists all networks and server addresses associated with a server.
If the REST API request failed.
public ListAddresses ( ) : ServerAddresses
return ServerAddresses

ListAddressesByNetwork() public method

Lists addresses for the server associated with the specified network.
If is . If is empty. If the REST API request failed.
public ListAddressesByNetwork ( string networkLabel ) : IEnumerable
networkLabel string The network label. This is obtained from CloudNetwork.Label.
return IEnumerable

ListVirtualInterfaces() public method

Lists the virtual interfaces for the server.
If the REST API request failed.
public ListVirtualInterfaces ( ) : IEnumerable
return IEnumerable

SetMetadata() public method

Sets the metadata associated with the server, replacing any existing metadata.
If is . If contains any values with empty keys. If the REST API request failed.
public SetMetadata ( Metadata metadata ) : bool
metadata Metadata The metadata to associate with the server.
return bool

Snapshot() public method

Creates a new snapshot image for the server at its current state.
The server snapshot process is completed asynchronously. To wait for the image to be completed, you may call SimpleServerImage.WaitForActive on the returned image.
If is . If is empty. If the REST API request failed.
public Snapshot ( string imageName, Metadata metadata = null ) : ServerImage
imageName string Name of the new image.
metadata Metadata The metadata to associate to the new image.
return ServerImage

UpdateMetadata() public method

Updates the metadata for the server.
For each item in metadata, if the key exists, the value is updated; otherwise, the item is added.
If is . If contains any values with empty keys. If the REST API request failed.
public UpdateMetadata ( Metadata metadata ) : bool
metadata Metadata The server metadata to update.
return bool

UpdateMetadataItem() public method

Sets the value for the specified metadata item. If the key already exists, it is updated; otherwise, a new metadata item is added.
/// If is . /// -or- /// If is . /// If is empty. If the REST API request failed.
public UpdateMetadataItem ( string key, string value ) : bool
key string The metadata key.
value string The new value for the metadata item.
return bool

UpdateThis() protected method

protected UpdateThis ( ServerBase server ) : void
server ServerBase
return void