Documentation
¶
Overview ¶
Package v2 contains common functions for creating compute-based resources for use in acceptance tests. See the `*_test.go` files for example usages.
Package v2 package contains acceptance tests for the Openstack Compute V2 service.
Index ¶
- func AssociateFloatingIP(t *testing.T, client *gophercloud.ServiceClient, ...) error
- func AssociateFloatingIPWithFixedIP(t *testing.T, client *gophercloud.ServiceClient, ...) error
- func AttachInterface(t *testing.T, client *gophercloud.ServiceClient, serverID string) (*attachinterfaces.Interface, error)
- func CreateAggregate(t *testing.T, client *gophercloud.ServiceClient) (*aggregates.Aggregate, error)
- func CreateBootableVolumeServer(t *testing.T, client *gophercloud.ServiceClient, ...) (*servers.Server, error)
- func CreateDefaultRule(t *testing.T, client *gophercloud.ServiceClient) (dsr.DefaultRule, error)
- func CreateFlavor(t *testing.T, client *gophercloud.ServiceClient) (*flavors.Flavor, error)
- func CreateFloatingIP(t *testing.T, client *gophercloud.ServiceClient) (*floatingips.FloatingIP, error)
- func CreateKeyPair(t *testing.T, client *gophercloud.ServiceClient) (*keypairs.KeyPair, error)
- func CreateMicroversionServer(t *testing.T, client *gophercloud.ServiceClient) (*servers.Server, error)
- func CreateMultiEphemeralServer(t *testing.T, client *gophercloud.ServiceClient, ...) (*servers.Server, error)
- func CreatePrivateFlavor(t *testing.T, client *gophercloud.ServiceClient) (*flavors.Flavor, error)
- func CreateRemoteConsole(t *testing.T, client *gophercloud.ServiceClient, serverID string) (*remoteconsoles.RemoteConsole, error)
- func CreateSecurityGroup(t *testing.T, client *gophercloud.ServiceClient) (*secgroups.SecurityGroup, error)
- func CreateSecurityGroupRule(t *testing.T, client *gophercloud.ServiceClient, securityGroupID string) (*secgroups.Rule, error)
- func CreateServer(t *testing.T, client *gophercloud.ServiceClient) (*servers.Server, error)
- func CreateServerGroup(t *testing.T, client *gophercloud.ServiceClient, policy string) (*servergroups.ServerGroup, error)
- func CreateServerGroupMicroversion(t *testing.T, client *gophercloud.ServiceClient) (*servergroups.ServerGroup, error)
- func CreateServerInServerGroup(t *testing.T, client *gophercloud.ServiceClient, ...) (*servers.Server, error)
- func CreateServerNoNetwork(t *testing.T, client *gophercloud.ServiceClient) (*servers.Server, error)
- func CreateServerWithPublicKey(t *testing.T, client *gophercloud.ServiceClient, keyPairName string) (*servers.Server, error)
- func CreateServerWithTags(t *testing.T, client *gophercloud.ServiceClient, networkID string) (*servers.Server, error)
- func CreateServerWithoutImageRef(t *testing.T, client *gophercloud.ServiceClient) (*servers.Server, error)
- func CreateVolumeAttachment(t *testing.T, client *gophercloud.ServiceClient, ...) (*volumeattach.VolumeAttachment, error)
- func DeleteAggregate(t *testing.T, client *gophercloud.ServiceClient, ...)
- func DeleteDefaultRule(t *testing.T, client *gophercloud.ServiceClient, defaultRule dsr.DefaultRule)
- func DeleteFlavor(t *testing.T, client *gophercloud.ServiceClient, flavor *flavors.Flavor)
- func DeleteFloatingIP(t *testing.T, client *gophercloud.ServiceClient, ...)
- func DeleteKeyPair(t *testing.T, client *gophercloud.ServiceClient, keyPair *keypairs.KeyPair)
- func DeleteSecurityGroup(t *testing.T, client *gophercloud.ServiceClient, securityGroupID string)
- func DeleteSecurityGroupRule(t *testing.T, client *gophercloud.ServiceClient, ruleID string)
- func DeleteServer(t *testing.T, client *gophercloud.ServiceClient, server *servers.Server)
- func DeleteServerGroup(t *testing.T, client *gophercloud.ServiceClient, ...)
- func DeleteVolumeAttachment(t *testing.T, client *gophercloud.ServiceClient, ...)
- func DetachInterface(t *testing.T, client *gophercloud.ServiceClient, serverID, portID string)
- func DisassociateFloatingIP(t *testing.T, client *gophercloud.ServiceClient, ...)
- func FillUpdateOptsFromQuotaSet(src quotasets.QuotaSet, dest *quotasets.UpdateOpts)
- func GetNetworkIDFromNetworks(t *testing.T, client *gophercloud.ServiceClient, networkName string) (string, error)
- func GetNetworkIDFromOSNetworks(t *testing.T, client *gophercloud.ServiceClient, networkName string) (string, error)
- func GetNetworkIDFromTenantNetworks(t *testing.T, client *gophercloud.ServiceClient, networkName string) (string, error)
- func ImportPublicKey(t *testing.T, client *gophercloud.ServiceClient, publicKey string) (*keypairs.KeyPair, error)
- func RescueServer(t *testing.T, client *gophercloud.ServiceClient, server *servers.Server) error
- func ResizeServer(t *testing.T, client *gophercloud.ServiceClient, server *servers.Server) error
- func UnrescueServer(t *testing.T, client *gophercloud.ServiceClient, server *servers.Server) error
- func WaitForComputeStatus(client *gophercloud.ServiceClient, server *servers.Server, status string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssociateFloatingIP ¶
func AssociateFloatingIP(t *testing.T, client *gophercloud.ServiceClient, floatingIP *floatingips.FloatingIP, server *servers.Server) error
AssociateFloatingIP will associate a floating IP with an instance. An error will be returned if the floating IP was unable to be associated.
func AssociateFloatingIPWithFixedIP ¶
func AssociateFloatingIPWithFixedIP(t *testing.T, client *gophercloud.ServiceClient, floatingIP *floatingips.FloatingIP, server *servers.Server, fixedIP string) error
AssociateFloatingIPWithFixedIP will associate a floating IP with an instance's specific fixed IP. An error will be returend if the floating IP was unable to be associated.
func AttachInterface ¶
func AttachInterface(t *testing.T, client *gophercloud.ServiceClient, serverID string) (*attachinterfaces.Interface, error)
AttachInterface will create and attach an interface on a given server. An error will returned if the interface could not be created.
func CreateAggregate ¶
func CreateAggregate(t *testing.T, client *gophercloud.ServiceClient) (*aggregates.Aggregate, error)
CreateAggregate will create an aggregate with random name and available zone. An error will be returned if the aggregate could not be created.
func CreateBootableVolumeServer ¶
func CreateBootableVolumeServer(t *testing.T, client *gophercloud.ServiceClient, blockDevices []bootfromvolume.BlockDevice) (*servers.Server, error)
CreateBootableVolumeServer works like CreateServer but is configured with one or more block devices defined by passing in []bootfromvolume.BlockDevice. An error will be returned if a server was unable to be created.
func CreateDefaultRule ¶
func CreateDefaultRule(t *testing.T, client *gophercloud.ServiceClient) (dsr.DefaultRule, error)
CreateDefaultRule will create a default security group rule with a random port range between 80 and 90. An error will be returned if a default rule was unable to be created.
func CreateFlavor ¶
func CreateFlavor(t *testing.T, client *gophercloud.ServiceClient) (*flavors.Flavor, error)
CreateFlavor will create a flavor with a random name. An error will be returned if the flavor could not be created.
func CreateFloatingIP ¶
func CreateFloatingIP(t *testing.T, client *gophercloud.ServiceClient) (*floatingips.FloatingIP, error)
CreateFloatingIP will allocate a floating IP. An error will be returend if one was unable to be allocated.
func CreateKeyPair ¶
func CreateKeyPair(t *testing.T, client *gophercloud.ServiceClient) (*keypairs.KeyPair, error)
CreateKeyPair will create a KeyPair with a random name. An error will occur if the keypair failed to be created. An error will be returned if the keypair was unable to be created.
func CreateMicroversionServer ¶
func CreateMicroversionServer(t *testing.T, client *gophercloud.ServiceClient) (*servers.Server, error)
CreateMicroversionServer creates a basic instance compatible with newer microversions with a randomly generated name. The flavor of the instance will be the value of the OS_FLAVOR_ID environment variable. The image will be the value of the OS_IMAGE_ID environment variable. The instance will be launched on the network specified in OS_NETWORK_NAME. An error will be returned if the instance was unable to be created.
func CreateMultiEphemeralServer ¶
func CreateMultiEphemeralServer(t *testing.T, client *gophercloud.ServiceClient, blockDevices []bootfromvolume.BlockDevice) (*servers.Server, error)
CreateMultiEphemeralServer works like CreateServer but is configured with one or more block devices defined by passing in []bootfromvolume.BlockDevice. These block devices act like block devices when booting from a volume but are actually local ephemeral disks. An error will be returned if a server was unable to be created.
func CreatePrivateFlavor ¶
func CreatePrivateFlavor(t *testing.T, client *gophercloud.ServiceClient) (*flavors.Flavor, error)
CreatePrivateFlavor will create a private flavor with a random name. An error will be returned if the flavor could not be created.
func CreateRemoteConsole ¶
func CreateRemoteConsole(t *testing.T, client *gophercloud.ServiceClient, serverID string) (*remoteconsoles.RemoteConsole, error)
CreateRemoteConsole will create a remote noVNC console for the specified server.
func CreateSecurityGroup ¶
func CreateSecurityGroup(t *testing.T, client *gophercloud.ServiceClient) (*secgroups.SecurityGroup, error)
CreateSecurityGroup will create a security group with a random name. An error will be returned if one was failed to be created.
func CreateSecurityGroupRule ¶
func CreateSecurityGroupRule(t *testing.T, client *gophercloud.ServiceClient, securityGroupID string) (*secgroups.Rule, error)
CreateSecurityGroupRule will create a security group rule with a random name and a random TCP port range between port 80 and 99. An error will be returned if the rule failed to be created.
func CreateServer ¶
func CreateServer(t *testing.T, client *gophercloud.ServiceClient) (*servers.Server, error)
CreateServer creates a basic instance with a randomly generated name. The flavor of the instance will be the value of the OS_FLAVOR_ID environment variable. The image will be the value of the OS_IMAGE_ID environment variable. The instance will be launched on the network specified in OS_NETWORK_NAME. An error will be returned if the instance was unable to be created.
func CreateServerGroup ¶
func CreateServerGroup(t *testing.T, client *gophercloud.ServiceClient, policy string) (*servergroups.ServerGroup, error)
CreateServerGroup will create a server with a random name. An error will be returned if the server group failed to be created.