C# Класс Skytap.Cloud.SkytapApi

Wrapper class for calling the various Skytap REST APIs.
Показать файл Открыть проект

Открытые методы

Метод Описание
AttachVpnConnection ( Credentials credentials, string configUrl, string networkId, string vpnId ) : void

Attach an existing VPN to a configuration's network.

CheckConfigurationForDesiredState ( Credentials credentials, string testTargetConfigUrl, List desiredStates ) : void

Determine if a configuration is in an expected state, and throw an exception if it is not.

CheckConfigurationForDesiredState ( Credentials credentials, string testTargetConfigUrl, string desiredState ) : void

Determine if a configuration is in an expected state, and throw an exception if it is not.

ConnectVpn ( Credentials credentials, string configUrl, string networkId, string vpnId ) : void

After attaching, connect the VPN to the specified configuration and network.

CreateConfiguration ( Credentials credentials, string templateId, string configName = null ) : SkytapConfiguration

Create a new Skytap configuration based on the specified template and provide an optional name.

CreateIcnrConnection ( Credentials credentials, string sourceNetId, string targetNetId ) : string

Creates an ICNR connection between a source and target network.

DeleteIcnrConnection ( Credentials credentials, string icnrId ) : void

Deletes a specified ICNR connection.

DetachVpn ( Credentials credentials, string configUrl, string networkId, string vpnId ) : void

Detach a VPN connection. A VPN connection should be disconnected prior to detaching.

DisconnectVpn ( Credentials credentials, string configUrl, string networkId, string vpnId ) : void

Disconnect a VPN connection. This should be done prior to detaching a VPN.

GetConfiguration ( Credentials credentials, string configurationUrl, bool doRetries = true ) : string

Retrieves the XML that describes the specified Skytap configuration.

GetConfigurationState ( Credentials credentials, string configurationUrl ) : string

Gets the current state of the configuration, such as Running, Suspended, or Stopped.

This is a helper method that extracts the runstate out of the XML response, but you could just as easily use GetConfiguration to get the full response XML containing all properties.

GetNetworkIdInConfiguration ( Credentials credentials, string configId ) : string

Get the network ID associated with a Skytap configuration, which is useful for other companion calls that operate on a network.

GetVpns ( Credentials credentials ) : string

Get a global list of VPNs accessible by the user

SaveAsSkytapTemplate ( Credentials credentials, string testTargetConfigUrl ) : void

Save the specified configuration as a new Skytap template.

SetConfigurationState ( Credentials credentials, string configUrl, string state ) : void

Change the state of a configuration to a specified value, such as Suspended, Stopped, or Running.

ShutDownConfiguration ( Credentials credentials, string configUrlToDelete ) : void

Deletes a Skytap configuration, which is useful when a configuration was created for temporary use.

UpdateConfigurationName ( Credentials credentials, string configurationUrl, string newName ) : void

Change the name of a Skytap configuration.

Приватные методы

Метод Описание
CreateSkytapWebRequest ( Credentials credentials, string url ) : HttpWebRequest
SendSkytapHttpRequest ( HttpWebRequest httpRequest ) : string

Описание методов

AttachVpnConnection() публичный статический Метод

Attach an existing VPN to a configuration's network.
public static AttachVpnConnection ( Credentials credentials, string configUrl, string networkId, string vpnId ) : void
credentials Skytap.Cloud.Utilities.Credentials Username and password for the user making the request.
configUrl string URL to the Skytap configuration that is associated with the VPN.
networkId string ID of the network to attach the VPN to.
vpnId string VPN ID to attach.
Результат void

CheckConfigurationForDesiredState() публичный статический Метод

Determine if a configuration is in an expected state, and throw an exception if it is not.
public static CheckConfigurationForDesiredState ( Credentials credentials, string testTargetConfigUrl, List desiredStates ) : void
credentials Skytap.Cloud.Utilities.Credentials Username and password for the user making the request.
testTargetConfigUrl string Configuration to query for the desired state.
desiredStates List A list of states that are desired, such as a combination of /// Stopped, Suspended, or Running.
Результат void

CheckConfigurationForDesiredState() публичный статический Метод

Determine if a configuration is in an expected state, and throw an exception if it is not.
public static CheckConfigurationForDesiredState ( Credentials credentials, string testTargetConfigUrl, string desiredState ) : void
credentials Skytap.Cloud.Utilities.Credentials Username and password for the user making the request.
testTargetConfigUrl string Configuration to query for the desired state.
desiredState string The desired state of the configuration, such as Stopped, Suspended, or Running.
Результат void

ConnectVpn() публичный статический Метод

After attaching, connect the VPN to the specified configuration and network.
public static ConnectVpn ( Credentials credentials, string configUrl, string networkId, string vpnId ) : void
credentials Credentials Username and password for the user making the request.
configUrl string URL to the Skytap configuration that is associated with the VPN.
networkId string ID of the network to attach the VPN to.
vpnId string VPN ID to attach.
Результат void

CreateConfiguration() публичный статический Метод

Create a new Skytap configuration based on the specified template and provide an optional name.
public static CreateConfiguration ( Credentials credentials, string templateId, string configName = null ) : SkytapConfiguration
credentials Credentials Username and password for the user making the request.
templateId string ID of the template to base the new configuration on.
configName string Optional name of the new configuration.
Результат SkytapConfiguration

CreateIcnrConnection() публичный статический Метод

Creates an ICNR connection between a source and target network.
public static CreateIcnrConnection ( Credentials credentials, string sourceNetId, string targetNetId ) : string
credentials Credentials Username and password for the user making the request.
sourceNetId string Source Skytap network ID that the connection starts from.
targetNetId string Target Skytap network ID that the connection goes to.
Результат string

DeleteIcnrConnection() публичный статический Метод

Deletes a specified ICNR connection.
public static DeleteIcnrConnection ( Credentials credentials, string icnrId ) : void
credentials Credentials Username and password for the user making the request.
icnrId string ID of the ICNR connection to remove.
Результат void

DetachVpn() публичный статический Метод

Detach a VPN connection. A VPN connection should be disconnected prior to detaching.
public static DetachVpn ( Credentials credentials, string configUrl, string networkId, string vpnId ) : void
credentials Credentials Username and password for the user making the request.
configUrl string URL to the Skytap configuration that is associated with the VPN.
networkId string ID of the network containing the VPN to detach.
vpnId string VPN ID to detach.
Результат void

DisconnectVpn() публичный статический Метод

Disconnect a VPN connection. This should be done prior to detaching a VPN.
public static DisconnectVpn ( Credentials credentials, string configUrl, string networkId, string vpnId ) : void
credentials Credentials Username and password for the user making the request.
configUrl string URL to the Skytap configuration that is associated with the VPN.
networkId string ID of the network containing the VPN to disconnect.
vpnId string VPN ID to disconnect.
Результат void

GetConfiguration() публичный статический Метод

Retrieves the XML that describes the specified Skytap configuration.
public static GetConfiguration ( Credentials credentials, string configurationUrl, bool doRetries = true ) : string
credentials Credentials Username and password for the user making the request.
configurationUrl string URL of the configuration to query.
doRetries bool Whether or not to retry the call if it fails.
Результат string

GetConfigurationState() публичный статический Метод

Gets the current state of the configuration, such as Running, Suspended, or Stopped.
This is a helper method that extracts the runstate out of the XML response, but you could just as easily use GetConfiguration to get the full response XML containing all properties.
public static GetConfigurationState ( Credentials credentials, string configurationUrl ) : string
credentials Credentials Username and password for the user making the request.
configurationUrl string URL of the configuration to query.
Результат string

GetNetworkIdInConfiguration() публичный статический Метод

Get the network ID associated with a Skytap configuration, which is useful for other companion calls that operate on a network.
public static GetNetworkIdInConfiguration ( Credentials credentials, string configId ) : string
credentials Credentials Username and password for the user making the request.
configId string The configuration identifier to query.
Результат string

GetVpns() публичный статический Метод

Get a global list of VPNs accessible by the user
public static GetVpns ( Credentials credentials ) : string
credentials Credentials Username and password for the user making the request.
Результат string

SaveAsSkytapTemplate() публичный статический Метод

Save the specified configuration as a new Skytap template.
public static SaveAsSkytapTemplate ( Credentials credentials, string testTargetConfigUrl ) : void
credentials Credentials Username and password for the user making the request.
testTargetConfigUrl string URL of the configuration to turn into a template.
Результат void

SetConfigurationState() публичный статический Метод

Change the state of a configuration to a specified value, such as Suspended, Stopped, or Running.
public static SetConfigurationState ( Credentials credentials, string configUrl, string state ) : void
credentials Credentials Username and password for the user making the request.
configUrl string Configuration whose state is to be modified.
state string State to transition to, such as Suspended, Stopped, or Running.
Результат void

ShutDownConfiguration() публичный статический Метод

Deletes a Skytap configuration, which is useful when a configuration was created for temporary use.
public static ShutDownConfiguration ( Credentials credentials, string configUrlToDelete ) : void
credentials Credentials Username and password for the user making the request.
configUrlToDelete string URL of the configuration to be shutdown/deleted.
Результат void

UpdateConfigurationName() публичный статический Метод

Change the name of a Skytap configuration.
public static UpdateConfigurationName ( Credentials credentials, string configurationUrl, string newName ) : void
credentials Credentials Username and password for the user making the request.
configurationUrl string The configuration identifier to change
newName string New name of the configuration (basic string; not sure of length restrictions)
Результат void