ovc

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2020 License: Apache-2.0 Imports: 14 Imported by: 4

Documentation

Overview

Package ovc implements a client library for SimpliVity REST API endpoints.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AffectedResource

type AffectedResource struct {
	ObjectType string `json:"object_type,omitempty"`
	ObjectId   string `json:"object_id,omitempty"`
}

List of affected resources in task response

type Backup

type Backup struct {
	Name                                   string    `json:"name,omitempty"`
	Id                                     string    `json:"id,omitempty"`
	VirtualMachineName                     string    `json:"virtual_machine_name,omitempty"`
	CreatedAt                              time.Time `json:"created_at,omitempty"`
	ConsistencyType                        string    `json:"consistency_type,omitempty"`
	Type                                   string    `json:"type,omitempty"`
	DatastoreName                          string    `json:"datastore_name,omitempty"`
	VirtualMachineDeletionTime             int       `json:"virtual_machine_deletion_time,omitempty"`
	VirtualMachineID                       string    `json:"virtual_machine_id,omitempty"`
	ApplicationConsistent                  bool      `json:"application_consistent,omitempty"`
	ComputeClusterParentHypervisorObjectID string    `json:"compute_cluster_parent_hypervisor_object_id,omitempty"`
	State                                  string    `json:"state,omitempty"`
	OmnistackClusterID                     string    `json:"omnistack_cluster_id,omitempty"`
	VirtualMachineType                     string    `json:"virtual_machine_type,omitempty"`
	SentCompletionTime                     string    `json:"sent_completion_time,omitempty"`
	UniqueSizeBytes                        int       `json:"unique_size_bytes,omitempty"`
	ClusterGroupIds                        []string  `json:"cluster_group_ids,omitempty"`
	UniqueSizeTimestamp                    string    `json:"unique_size_timestamp,omitempty"`
	ExpirationTime                         string    `json:"expiration_time,omitempty"`
	OmnistackClusterName                   string    `json:"omnistack_cluster_name,omitempty"`
	Sent                                   int       `json:"sent,omitempty"`
	Size                                   int64     `json:"size,omitempty"`
	VirtualMachineState                    string    `json:"virtual_machine_state,omitempty"`
	DatastoreID                            string    `json:"datastore_id,omitempty"`
	ComputeClusterParentName               string    `json:"compute_cluster_parent_name,omitempty"`
	HypervisorType                         string    `json:"hypervisor_type,omitempty"`
	SentDuration                           int       `json:"sent_duration,omitempty"`
}

Backup represents a backup of the VM resource in SimpliVity.

type BackupList

type BackupList struct {
	Offset  int       `json:"offset,omitempty"`
	Count   int       `json:"count,omitempty"`
	Limit   int       `json:"limit,omitempty"`
	Members []*Backup `json:"backups,omitempty"`
}

type BackupResource

type BackupResource resourceClient

BackupResource handles communications with the the Backup resource methods

SimpliVity API docs: https://developer.hpe.com/api/simplivity/endpoint?&path=%2Fbackups

func (*BackupResource) GetAll

func (b *BackupResource) GetAll(params GetAllParams) (*BackupList, error)

GetAll returns all the backups filtered by the query parameters. Filters:

id: the unique identifier (UID) of the backups to return
  Accepts: Single value, comma-separated list
name: The name of the backups to return
  Accepts: Single value, comma-separated list, pattern using one or more
  asterisk characters as a wildcard.
sent_min: The minimum sent data size (in bytes) of the remote backups to return.
sent_max: The maximum sent data size (in bytes) of the remote backups to return.
state: The current state of the backups to return
  Accepts: Single value, comma-separated list
type: The type of backups to return.
  Accepts: Single value, comma-separated list.
omnistack_cluster_id: The unique identifier (UID) of the omnistack_cluster
  that is associated with the instances to return
  Accepts: Single value, comma-separated list
omnistack_cluster_name: The name of the omnistack_cluster that is associated
  with the instances to return
  Accepts: Single value, comma-separated list
compute_cluster_parent_hypervisor_object_id: The unique identifier (UID) of the
  hypervisor that contains the omnistack_cluster that is associated with the instances to return
  Accepts: Single value, comma-separated list
compute_cluster_parent_name: The name of the hypervisor that contains the
  omnistack_cluster that is associated with the instances to return
  Accepts: Single value, comma-separated list
datastore_id: The unique identifier (UID) of the datastore that is associated
  with the instances to return
  Accepts: Single value, comma-separated list
datastore_name: The name of the datastore that is associated with the instances to return
  Accepts: Single value, comma-separated list
expires_before: The latest expiration time before the backups to return expire,
  expressed in ISO-8601 form, based on Coordinated Universal Time (UTC)
expires_after: The earliest expiration time after the backups to return expire,
  expressed in ISO-8601 form, based on Coordinated Universal Time (UTC)
virtual_machine_id: The unique identifier (UID) of the virtual_machine that is
  associated with the instances to return
  Accepts: Single value, comma-separated list
virtual_machine_name: The name of the virtual_machine that is associated with
  the instances to return
  Accepts: Single value, comma-separated list
virtual_machine_type: The type of the virtual_machine that is associated with the
  instances to return
  Accepts: Single value, comma-separated list
size_min: The minimum size (in bytes) of the backups to return
size_max: The maximum size (in bytes) of the backups to return
application_consistent: The application-consistent setting of the backups to return
consistency_type: The consistency type of the backups to return
  Accepts: Single value, comma-separated list
created_before: The latest creation time before the backups to return were created,
  expressed in ISO-8601 form, based on Coordinated Universal Time (UTC)
created_after: The earliest creation time after the backups to return were created,
  expressed in ISO-8601 form, based on Coordinated Universal Time (UTC)
sent_duration_min: The minimum number of seconds that elapsed while replicating
  the backups to return
sent_duration_max: The maximum number of seconds that elapsed while replicating the
  backups to return
sent_completion_before: The latest time before the replication of backups to return was
  completed, expressed in ISO-8601 form, based on Coordinated Universal Time (UTC)
sent_completion_after: The earliest time after the replication of backups to return was
  completed, expressed in ISO-8601 form, based on Coordinated Universal Time (UTC)

func (*BackupResource) GetBy

func (b *BackupResource) GetBy(field string, value string) ([]*Backup, error)

GetBy searches for backups with single filter.

func (*BackupResource) GetById

func (b *BackupResource) GetById(id string) (*Backup, error)

GetById searches for a backup by id.

func (*BackupResource) GetByName

func (b *BackupResource) GetByName(name string) (*Backup, error)

GetByName searches for a backup by name.

type Client

type Client struct {

	// OVC IP
	OVCIP string

	//OVC username
	Username string

	// OVC password
	Password string

	// OVC access token
	AccessToken string

	// SSL certificate path
	SSLCertificatePath string

	//OVC resource clients
	Backups           *BackupResource
	Datastores        *DatastoreResource
	Hosts             *HostResource
	OmniStackClusters *OmniStackClusterResource
	Policies          *PolicyResource
	VirtualMachines   *VirtualMachineResource
	Tasks             *TaskResource
	// contains filtered or unexported fields
}

Client handles communications with the OVC API.

SimpliVity API doc: https://developer.hpe.com/api/simplivity/

func NewClient

func NewClient(username string, password string, ovc_ip string, ssl_certificate string) (*Client, error)

NewClient creates a new OVC client. Sets http client to make http connection with the OVC. Sets access token by communicating with the auth token endpoint. Initializes resource clients with a common OVC client.

func (*Client) CreateResourceURL

func (c *Client) CreateResourceURL(path string, query string) (*url.URL, error)

CreateResourceURL creats the resource URL by appending the base URL with the resource path

func (*Client) Do

func (c *Client) Do(req *http.Request) ([]byte, error, *OVCRespError)

Do makes calls to the OVC Returns data if the call is successfull or error

func (*Client) DoRequest

func (c *Client) DoRequest(method, path, queryStr string, body interface{}, headers map[string]string) ([]byte, error)

DoRequest creates a new http request and make calls to the OVC. Creates a new http request using NewRequest method. Makes http call to the OVC using Do method. Tries to get another token and makes a fresh request if the token expired.

func (*Client) NewRequest

func (c *Client) NewRequest(method, path, query string, body interface{}) (*http.Request, error)

NewRequest creates a new http request by setting the URL, method and body.

func (*Client) SetAccessToken

func (c *Client) SetAccessToken() error

SetAccessToken sets the access token which will be used by other endpoints Makes a call to the login endpoint and gets the token.

func (*Client) SetHeaders

func (c *Client) SetHeaders(req *http.Request, headers map[string]string)

SetHeaders sets headers of the API requests.

type CreateBackupRequest

type CreateBackupRequest struct {
	// The name of the new backup created from this action
	Name string `json:"backup_name,omitempty"`

	// The consistency type of the backup
	// Default: "NONE"
	ConsistencyType string `json:"consistency_type,omitempty"`

	// An indicator to show if the backup represents a snapshot
	// of a virtual machine with data that was first flushed to disk
	// Default: false
	AppConsistent bool `json:"app_consistent,omitempty"`

	// The number of minutes to keep backups
	// Default: 0(indicates that the backup never expires)
	Retention int `json:"retention,omitempty"`

	// omnistack_cluster that stores the new backup
	// Default: local omnistack_cluster
	Destination string `json:"destination_id,omitempty"`
}

CreateBackup request body

type Datastore

type Datastore struct {
	Name                                   string    `json:"name,omitempty"`
	Id                                     string    `json:"id,omitempty"`
	ClusterGroupIds                        []string  `json:"cluster_group_ids,omitempty"`
	PolicyID                               string    `json:"policy_id,omitempty"`
	MountDirectory                         string    `json:"mount_directory,omitempty"`
	CreatedAt                              time.Time `json:"created_at,omitempty"`
	PolicyName                             string    `json:"policy_name,omitempty"`
	OmnistackClusterName                   string    `json:"omnistack_cluster_name,omitempty"`
	Deleted                                bool      `json:"deleted,omitempty"`
	HypervisorObjectID                     string    `json:"hypervisor_object_id,omitempty"`
	Size                                   int64     `json:"size,omitempty"`
	ComputeClusterParentHypervisorObjectID string    `json:"compute_cluster_parent_hypervisor_object_id,omitempty"`
	ComputeClusterParentName               string    `json:"compute_cluster_parent_name,omitempty"`
	HypervisorType                         string    `json:"hypervisor_type,omitempty"`
	OmnistackClusterID                     string    `json:"omnistack_cluster_id,omitempty"`
	HypervisorManagementSystem             string    `json:"hypervisor_management_system,omitempty"`
	HypervisorManagementSystemName         string    `json:"hypervisor_management_system_name,omitempty"`
	Shares                                 []Shares  `json:"shares,omitempty"`
}

Datastore represents a SimpliVity datastore

type DatastoreList

type DatastoreList struct {
	Offset  int          `json:"offset,omitempty"`
	Count   int          `json:"count,omitempty"`
	Limit   int          `json:"limit,omitempty"`
	Members []*Datastore `json:"datastores,omitempty"`
}

type DatastoreResource

type DatastoreResource resourceClient

DatastoreResource handles communications with the the Datastore resource methods

SimpliVity API docs: https://developer.hpe.com/api/simplivity/endpoint?&path=%2Fdatastores

func (*DatastoreResource) GetAll

func (d *DatastoreResource) GetAll(params GetAllParams) (*DatastoreList, error)

GetAll returns all the datastores filtered by the query parameters. Filters:

id: The unique identifier (UID) of the datastores to return
  Accepts: Single value, comma-separated list
name: The name of the datastores to return
  Accepts: Single value, comma-separated list, pattern using one
  or more asterisk characters as a wildcard
min_size: The minimum size (in bytes) of datastores to return
max_size: The maximum size (in bytes) of datastores to return
created_before: The latest creation time before the datastores to return were created,
  expressed in ISO-8601 form, based on Coordinated Universal Time (UTC)
created_after: The earliest creation time after the datastores to return were created,
  expressed in ISO-8601 form, based on Coordinated Universal Time (UTC)
omnistack_cluster_id: The unique identifier (UID) of the omnistack_cluster that is
  associated with the instances to return
  Accepts: Single value, comma-separated list
omnistack_cluster_name: The name of the omnistack_cluster that is associated with
  the instances to return
  Accepts: Single value, comma-separated list
compute_cluster_parent_hypervisor_object_id: The unique identifier (UID) of the hypervisor
  that contains the omnistack_cluster that is associated with the instances to return
  Accepts: Single value, comma-separated list
compute_cluster_parent_name: The name of the hypervisor that contains the omnistack
  cluster that is associated with the instances to return
  Accepts: Single value, comma-separated list
hypervisor_management_system_name: The name of the Hypervisor Management System (HMS)
  associated with the datastore
  Accepts: Single value, comma-separated list, pattern using one or more asterisk
  characters as a wildcard
policy_id: The unique identifier (UID) of the policy that is associated with the
  instances to return
  Accepts: Single value, comma-separated list
policy_name: The name of the policy that is associated with the instances to return
  Accepts: Single value, comma-separated list
hypervisor_object_id: The unique identifier (UID) of the hypervisor-based instance
  that is associated with the instances to return
  Accepts: Single value, comma-separated list
mount_directory: A comma-separated list of fields to include in the returned objects
  Default: Returns all fields

func (*DatastoreResource) GetBy

func (d *DatastoreResource) GetBy(field string, value string) ([]*Datastore, error)

GetBy gets datastores with single filter

func (*DatastoreResource) GetById

func (d *DatastoreResource) GetById(id string) (*Datastore, error)

GetById searches for a datastore by its id.

func (*DatastoreResource) GetByName

func (d *DatastoreResource) GetByName(name string) (*Datastore, error)

GetByName searches for a datastore by its name

type GetAllParams

type GetAllParams struct {
	Limit              int
	Offset             int
	Sort               string
	Order              string
	Fields             string
	Case               string
	ShowOptionalFields bool
	Filters            map[string]string
}

Query Parameters of the Get all endpoints.

func (GetAllParams) QueryString

func (p GetAllParams) QueryString() string

QueryString creates query string from the GetAllParams parameters including filters

type Host

type Host struct {
	Name                                   string   `json:"name,omitempty"`
	Id                                     string   `json:"id,omitempty"`
	ClusterFeatureLevel                    int      `json:"cluster_feature_level,omitempty"`
	PolicyEnabled                          bool     `json:"policy_enabled,omitempty"`
	ComputeClusterHypervisorObjectID       string   `json:"compute_cluster_hypervisor_object_id,omitempty"`
	StorageMask                            string   `json:"storage_mask,omitempty"`
	PotentialFeatureLevel                  int      `json:"potential_feature_level,omitempty"`
	Type                                   string   `json:"type,omitempty"`
	CurrentFeatureLevel                    int      `json:"current_feature_level,omitempty"`
	HypervisorObjectID                     string   `json:"hypervisor_object_id,omitempty"`
	ComputeClusterName                     string   `json:"compute_cluster_name,omitempty"`
	ManagementIP                           string   `json:"management_ip,omitempty"`
	FederationIP                           string   `json:"federation_ip,omitempty"`
	VirtualControllerName                  string   `json:"virtual_controller_name,omitempty"`
	FederationMask                         string   `json:"federation_mask,omitempty"`
	Model                                  string   `json:"model,omitempty"`
	ComputeClusterParentHypervisorObjectID string   `json:"compute_cluster_parent_hypervisor_object_id,omitempty"`
	StorageMtu                             string   `json:"storage_mtu,omitempty"`
	OmnistackClusterID                     string   `json:"omnistack_cluster_id,omitempty"`
	State                                  string   `json:"state,omitempty"`
	UpgradeState                           string   `json:"upgrade_state,omitempty"`
	FederationMtu                          string   `json:"federation_mtu,omitempty"`
	CanRollback                            bool     `json:"can_rollback,omitempty"`
	StorageIP                              string   `json:"storage_ip,omitempty"`
	ClusterGroupIds                        []string `json:"cluster_group_ids,omitempty"`
	ManagementMtu                          string   `json:"management_mtu,omitempty"`
	Version                                string   `json:"version,omitempty"`
	ComputeClusterParentName               string   `json:"compute_cluster_parent_name,omitempty"`
	HypervisorManagementSystem             string   `json:"hypervisor_management_system,omitempty"`
	ManagementMask                         string   `json:"management_mask,omitempty"`
	HypervisorManagementSystemName         string   `json:"hypervisor_management_system_name,omitempty"`
}

Host represents a SimpliVity host.

type HostList

type HostList struct {
	Offset  int     `json:"offset,omitempty"`
	Count   int     `json:"count,omitempty"`
	Limit   int     `json:"limit,omitempty"`
	Members []*Host `json:"hosts,omitempty"`
}

Host GetAll response

type HostResource

type HostResource resourceClient

HostResource handles communications with the the Host resource methods

SimpliVity API docs: https://developer.hpe.com/api/simplivity/endpoint?&path=%2Fhosts

func (*HostResource) GetAll

func (h *HostResource) GetAll(params GetAllParams) (*HostList, error)

GetAll returns all the hosts filtered by the query parameters. Filters:

id: The unique identifier (UID) of the host
  Accepts: Single value, comma-separated list
name: The name of the host
  Accepts: Single value, comma-separated list, pattern using one or more
  asterisk characters as a wildcard
type: The type of host
  Accepts: Single value, comma-separated list, pattern using one or more
  asterisk characters as a wildcard
model: The model of the host
  Accepts: Single value, comma-separated list, pattern using one or more
  asterisk characters as a wildcard
version: The version of the host
  Accepts: Single value, comma-separated list, pattern using one or more
  asterisk characters as a wildcard
hypervisor_management_system: The IP address of the Hypervisor Management System (HMS)
  associated with the host
  Accepts: Single value, comma-separated list, pattern using one or more asterisk
  characters as a wildcard
hypervisor_management_system_name: The name of the Hypervisor Management System (HMS)
  associated with the host
  Accepts: Single value, comma-separated list, pattern using one or more asterisk
  characters as a wildcard
hypervisor_object_id: The unique identifier (UID) of the hypervisor associated
  with the host
  Accepts: Single value, comma-separated list, pattern using one or more asterisk
  characters as a wildcard
compute_cluster_name: The name of the compute cluster associated with the host
  Accepts: Single value, comma-separated list, pattern using one or more asterisk
  characters as a wildcard
compute_cluster_hypervisor_object_id: The unique identifier (UID)
  of the Hypervisor Management System (HMS) for the associated compute cluster
  Accepts: Single value, comma-separated list, pattern using one or more asterisk
  characters as a wildcard
management_ip: The IP address of the HPE OmniStack management module that
  runs on the host
  Accepts: Single value, comma-separated list, pattern using one or more asterisk
  characters as a wildcard
storage_ip: The IP address of the HPE OmniStack storage module that runs on the host
  Accepts: Single value, comma-separated list, pattern using one or more
  asterisk characters as a wildcard
federation_ip: The IP address of the federation
  Accepts: Single value, comma-separated list, pattern using one or more asterisk
  characters as a wildcard
virtual_controller_name: The name of the Virtual Controller that runs on the host
  Accepts: Single value, comma-separated list, pattern using one or more asterisk
  characters as a wildcard
compute_cluster_parent_name: The name of the hypervisor that contains the omnistack
  cluster that is associated with the instance
  Accepts: Single value, comma-separated list, pattern using one or more asterisk
  characters as a wildcard
compute_cluster_parent_hypervisor_object_id: The unique identifier (UID) of the
  hypervisor that contains the omnistack_cluster that is associated with the instance
  Accepts: Single value, comma-separated list, pattern using one or more asterisk
  characters as a wildcard
policy_enabled: An indicator to show the status of the backup policy for the host
  Valid values:
  True: The backup policy for the host is enabled.
  False: The backup policy for the host is disabled.
current_feature_level_min: The minimum current feature level of the HPE OmniStack
  software running on the host
current_feature_level_max: The maximum current feature level of the HPE OmniStack
  software running on the host
potential_feature_level_min: The minimum potential feature level of the HPE OmniStack
  software running on the host
potential_feature_level_max: The maximum potential feature level of the HPE OmniStack
  software running on the host
upgrade_state: The state of the most recent HPE OmniStack software upgrade for this
  host (SUCCESS, FAIL, IN_PROGRESS, NOOP, UNKNOWN)
  Accepts: Single value, comma-separated list, pattern using one or more asterisk
  characters as a wildcard
can_rollback: An indicator to show if the current HPE OmniStack software running on
  the host can roll back to the previous version
  Valid values:
  True: The current HPE OmniStack software for the host can roll back to the previous version.
  False: The current HPE OmniStack software for the host cannot roll back to the previous version.

func (*HostResource) GetBy

func (h *HostResource) GetBy(field string, value string) ([]*Host, error)

GetBy searches for hosts with single filter.

func (*HostResource) GetById

func (h *HostResource) GetById(id string) (*Host, error)

GetById searches for a host by its id

func (*HostResource) GetByName

func (h *HostResource) GetByName(name string) (*Host, error)

GetByName searches for a host by its name

type InfosightConfiguration

type InfosightConfiguration struct {
	InfosightRegistered bool   `json:"infosight_registered,omitempty"`
	InfosightEnabled    bool   `json:"infosight_enabled,omitempty"`
	InfosightProxyURL   string `json:"infosight_proxy_url,omitempty"`
}

type OVCRespError

type OVCRespError struct {
	Exception string `json:"exception,omitempty"`
	Path      string `json:"path,omitempty"`
	Error     string `json:"error,omitempty"`
	Message   string `json:"message,omitempty"`
	Status    string `json:"status,omitempty"`
}

Error response from an API endpoint.

type OmniStackCluster

type OmniStackCluster struct {
	Name                           string                 `json:"name,omitempty"`
	Id                             string                 `json:"id,omitempty"`
	HypervisorObjectParentName     string                 `json:"hypervisor_object_parent_name,omitempty"`
	ClusterFeatureLevel            int                    `json:"cluster_feature_level,omitempty"`
	ClusterGroupIds                []string               `json:"cluster_group_ids,omitempty"`
	ArbiterConnected               bool                   `json:"arbiter_connected,omitempty"`
	HypervisorObjectParentID       string                 `json:"hypervisor_object_parent_id,omitempty"`
	Type                           string                 `json:"type,omitempty"`
	Version                        string                 `json:"version,omitempty"`
	HypervisorObjectID             string                 `json:"hypervisor_object_id,omitempty"`
	Members                        []string               `json:"members,omitempty"`
	ArbiterAddress                 string                 `json:"arbiter_address,omitempty"`
	HypervisorType                 string                 `json:"hypervisor_type,omitempty"`
	HypervisorManagementSystem     string                 `json:"hypervisor_management_system,omitempty"`
	HypervisorManagementSystemName string                 `json:"hypervisor_management_system_name. omitempty"`
	InfosightConfiguration         InfosightConfiguration `json:"infosight_configuration,omitempty"`
	IwoEnabled                     bool                   `json:"iwo_enabled,omitempty"`
}

OmniStackCluster represents a SimpliVity OmniStack cluster.

type OmniStackClusterList

type OmniStackClusterList struct {
	Offset  int                 `json:"offset,omitempty"`
	Count   int                 `json:"count,omitempty"`
	Limit   int                 `json:"limit,omitempty"`
	Members []*OmniStackCluster `json:"omnistack_clusters,omitempty"`
}

GetAll response fields

type OmniStackClusterResource

type OmniStackClusterResource resourceClient

OmniStackClusterResource handles communications with the the Cluster resource methods

SimpliVity API docs: https://developer.hpe.com/api/simplivity/endpoint?&path=%2Fomnistack_clusters

func (*OmniStackClusterResource) GetAll

GetAll returns all the OmniStack Clusters filtered by the query parameters. Filters:

id: The unique identifier (UID) of the omnistack_clusters to return
  Accepts: Single value, comma-separated list
name: The name of the omnistack_clusters to return
  Accepts: Single value, comma-separated list, pattern using one or more
  asterisk characters as a wildcard
hypervisor_object_id: The unique identifier (UID) of the hypervisor associated
  with the objects to return
  Accepts: Single value, comma-separated list, pattern using one or more asterisk
  characters as a wildcard
hypervisor_object_parent_id: The unique identifier (UID) of the hypervisor that
  contains the objects to return
  Accepts: Single value, comma-separated list, pattern using one or more asterisk
  characters as a wildcard
hypervisor_object_parent_name: The name of the hypervisor that contains the objects
  to return
  Accepts: Single value, comma-separated list, pattern using one or more asterisk
  characters as a wildcard
hypervisor_management_system_name: The name of the hypervisor associated with the
  omnistack_cluster
  Accepts: Single value, comma-separated list, pattern using one or more asterisk
  characters as a wildcard
type: The type of omnistack_clusters to return
  Accepts: Single value, comma-separated list, pattern using one or more asterisk
  characters as a wildcard
arbiter_address: The address of the Arbiter connected to the objects to return
  Accepts: Single value, comma-separated list, pattern using one or more asterisk
  characters as a wildcard
arbiter_connected: An indicator to show if the omnistack_cluster is connected to Arbiter
  Valid values:
  True: Only returns omnistack_clusters connected to Arbiters that you identified
    in arbiter_address
  False: Only returns omnistack_clusters not connected to Arbiters that you identified
    in arbiter_address

func (*OmniStackClusterResource) GetBy

func (o *OmniStackClusterResource) GetBy(field string, value string) ([]*OmniStackCluster, error)

GetBy searches for OmniStack Clusters with single filter.

func (*OmniStackClusterResource) GetById

GetById searches for an OmniStack Cluster by its id.

func (*OmniStackClusterResource) GetByName

func (o *OmniStackClusterResource) GetByName(name string) (*OmniStackCluster, error)

GetByName searches for an OmniStack Cluster by its name

type Policy

type Policy struct {
	Name            string        `json:"name,omitempty"`
	Id              string        `json:"id,omitempty"`
	ClusterGroupIds []string      `json:"cluster_group_ids,omitempty"`
	Rules           []interface{} `json:"rules,omitempty"`
}

Policy represents a SimpliVity Policy resource.

type PolicyList

type PolicyList struct {
	Offset  int       `json:"offset,omitempty"`
	Count   int       `json:"count,omitempty"`
	Limit   int       `json:"limit,omitempty"`
	Members []*Policy `json:"policies,omitempty"`
}

type PolicyResource

type PolicyResource resourceClient

PolicyResource handles communications with the the Policy resource methods

SimpliVity API docs: https://developer.hpe.com/api/simplivity/endpoint?&path=%2Fpolicies

func (*PolicyResource) GetAll

func (p *PolicyResource) GetAll(params GetAllParams) (*PolicyList, error)

GetAll returns all the policies filtered by the query parameters. Filters:

id: The unique identifier (UID) of the policy
  Accepts: Single value, comma-separated list
name:The name of the policy
  Accepts: Single value, comma-separated list

func (*PolicyResource) GetBy

func (p *PolicyResource) GetBy(field string, value string) ([]*Policy, error)

GetBy searches for Policies with single filter.

func (*PolicyResource) GetById

func (p *PolicyResource) GetById(id string) (*Policy, error)

GetById searches for a Policy resource by its id.

func (*PolicyResource) GetByName

func (p *PolicyResource) GetByName(name string) (*Policy, error)

GetByName searches for a Policy resource by its name.

type ReplicaSetList

type ReplicaSetList struct {
	Role string `json:"role,omitempty"`
	Id   string `json:"id,omitempty"`
}

type SetBackupParametersRequest

type SetBackupParametersRequest struct {
	// The user name of the virtual machine
	Username string `json:"guest_username,omitempty"`

	// The password of the virtual machine
	Password string `json:"guest_password,omitempty"`

	// Set to true to disable virtual machine validation logic
	OverrideValidation bool `json:"override_validation,omitempty"`

	// app_aware_type: Set the application aware backup type:
	//   VSS - Application-consistent backup using Microsoft VSS
	//   DEFAULT - Crash-consistent backup
	//   NONE - Application-consistent backup using a VMware snapshot
	AppAwareType string `json:"app_aware_type,omitempty"`
}

SetBackupParameters request body

type Shares

type Shares struct {
	Address string `json:"address,omitempty"`
	Host    string `json:"host,omitempty"`
	Rw      bool   `json:"rw,omitempty"`
}

type Task

type Task struct {
	State             string              `json:"state,omitempty"`
	Id                string              `json:"id,omitempty"`
	Progress          int                 `json:"percent_complete,omitempty"`
	AffectedResources []*AffectedResource `json:"affected_objects,omitempty"`
	ErrorCode         int                 `json:"error_code,omitempty"`
}

Task fields

type TaskResource

type TaskResource resourceClient

TaskResource handles communications with the SimpliVity task resource.

SimpliVity API docs: https://developer.hpe.com/api/simplivity/endpoint?&path=%2Ftasks

func (*TaskResource) CheckProgress

func (s *TaskResource) CheckProgress(task *Task) ([]byte, error)

CheckProgress makes call to the server for task status.

func (*TaskResource) WaitForTask

func (s *TaskResource) WaitForTask(resp []byte) (*Task, error)

WaitForTask waits for the task to complete Makes continous calls to the server using CheckProgress method and checks the status of the task

type TaskResp

type TaskResp struct {
	Task *Task `json:"task,omitempty"`
}

Task endpoint response

type VirtualMachine

type VirtualMachine struct {
	Name                                   string           `json:"name,omitempty"`
	Id                                     string           `json:"id,omitempty"`
	State                                  string           `json:"state,omitempty"`
	CreatedAt                              string           `json:"created_at,omitempty"`
	DeletedAt                              string           `json:"deleted_at,omitempty"`
	PolicyName                             string           `json:"policy_name,omitempty"`
	PolicyId                               string           `json:"policy_id,omitempty"`
	DatastoreName                          string           `json:"datastore_name,omitempty"`
	DatastoreId                            string           `json:"datastore_id,omitempty"`
	OmniStackClusterName                   string           `json:"omnistack_cluster_name,omitempty"`
	OmniStackClusterId                     string           `json:"omnistack_cluster_id,omitempty"`
	AppAwareVMStatus                       string           `json:"app_aware_vm_status,omitempty"`
	HypervisorObjectId                     string           `json:"hypervisor_object_id,omitempty"`
	HypervisorType                         string           `json:"hypervisor_type,omitempty"`
	HypervisorManagementSystem             string           `json:"hypervisor_management_system,omitempty"`
	HypervisorManagementSystemName         string           `json:"hypervisor_management_system_name,omitempty"`
	HostId                                 string           `json:"host_id,omitempty"`
	ComputeClusterParentHypervisorObjectId string           `json:"compute_cluster_parent_hypervisor_object_id,omitempty"`
	ComputeClusterName                     string           `json:"cumpute_cluster_name,omitempty"`
	ClusterGroupIds                        []string         `json:"cluster_group_ids,omitempty"`
	ReplicaSet                             []ReplicaSetList `json:"replica_set,omitempty"`
}

VirtualMachine represents a SimpliVity VM

func (*VirtualMachine) Clone

func (v *VirtualMachine) Clone(new_vm_name string, app_consistent bool) (*VirtualMachine, error)

Clone creates a clone of the VM.

func (*VirtualMachine) CreateBackup

func (v *VirtualMachine) CreateBackup(req *CreateBackupRequest, dest *OmniStackCluster) (*Backup, error)

CreateBackup creates a back of the VM.

func (*VirtualMachine) GetBackups

func (v *VirtualMachine) GetBackups() (*BackupList, error)

GetBackups gets all the backups of a VM.

func (*VirtualMachine) Move

func (v *VirtualMachine) Move(vm_name string, datastore *Datastore) (*VirtualMachine, error)

Move moves a VM from one datastore to another.

func (*VirtualMachine) SetBackupParameters

func (v *VirtualMachine) SetBackupParameters(req *SetBackupParametersRequest) error

SetBackupParameters sets the virtual machine backup parameters used for application consistent backups.

func (*VirtualMachine) SetPolicy

func (v *VirtualMachine) SetPolicy(policy *Policy) error

SetPolicy sets policy for single VM resource.

type VirtualMachineList

type VirtualMachineList struct {
	Offset  int               `json:"offset,omitempty"`
	Count   int               `json:"count,omitempty"`
	Limit   int               `json:"limit,omitempty"`
	Members []*VirtualMachine `json:"virtual_machines,omitempty"`
}

Virtual machine GetAll response

type VirtualMachineResource

type VirtualMachineResource resourceClient

VirtualMachineResource handles communications with the the VM resource methods

SimpliVity API docs: https://developer.hpe.com/api/simplivity/endpoint?&path=%2Fvirtual_machines

func (*VirtualMachineResource) GetAll

GetAll returns all the virtual machines filtered by the query parameters. Filters:

id: The unique identifier (UID) of the virtual_machines to return
  Accepts: Single value, comma-separated list
name: The name of the virtual_machines to return
  Accepts: Single value, comma-separated list, pattern using one or more
  asterisk characters as a wildcard
omnistack_cluster_id: The unique identifier (UID) of the omnistack_cluste
  that is associated with the instances to return
  Accepts: Single value, comma-separated list
omnistack_cluster_name: The name of the omnistack_cluster that
  is associated with the instances to return.
  Accepts: Single value, comma-separated list.
compute_cluster_parent_hypervisor_object_id: The unique identifier (UID)
  of the hypervisor that contains the omnistack_cluster that is associated
  with the instances to return
  Accepts: Single value, comma-separated list.
compute_cluster_parent_name: The name of the hypervisor that contains the
  omnistack_cluster that is associated with the instances to return
  Accepts: Single value, comma-separated list
hypervisor_management_system: The IP address of the hypervisor associated
  with the virtual machine.
  Accepts: Single value, comma-separated list, pattern using one
  or more asterisk characters as a wildcard
hypervisor_management_system_name: The name of the hypervisor associated
  with the virtual machine
  Accepts: Single value, comma-separated list, pattern using one or more
  asterisk characters as a wildcard
datastore_id: The unique identifier (UID) of the datastore that is associated
  with the instances to return
  Accepts: Single value, comma-separated list
datastore_name: The name of the datastore that is associated with the
  instances to return
  Accepts: Single value, comma-separated list
policy_id: The unique identifier (UID) of the policy that is associated
  with the instances to return
  Accepts: Single value, comma-separated list
policy_name: The name of the policy that is associated with the instances to return
  Accepts: Single value, comma-separated list
hypervisor_object_id: The unique identifier (UID) of the hypervisor-based instance
  that is associated with the instances to return
  Accepts: Single value, comma-separated list
created_after: The earliest creation time after the virtual machines to return were
  created, expressed in ISO-8601 form, based on Coordinated Universal Time (UTC)
created_before: The latest creation time before the virtual machines to return were
  created, expressed in ISO-8601 form, based on Coordinated Universal Time (UTC)
state: The state of the virtual_machine that is associated with the instances to return
  Accepts: Single value, comma-separated list
app_aware_vm_status: The status of the ability of the virtual machine to take
  an application-consistent backup that uses Microsoft VSS
  Accepts: Single value, comma-separated list
hypervisor_is_template: An indicator that shows if the virtual machine is a template.
host_id: The unique identifier (UID) of the virtual_machine host.

func (*VirtualMachineResource) GetBy

func (v *VirtualMachineResource) GetBy(field_name string, value string) ([]*VirtualMachine, error)

GetBy searches for VM resources with single filter.

func (*VirtualMachineResource) GetById

GetById searches for a VM by its id

func (*VirtualMachineResource) GetByName

func (v *VirtualMachineResource) GetByName(name string) (*VirtualMachine, error)

GetByName searches for a VM by its name

func (*VirtualMachineResource) SetPolicyForMultipleVMs

func (v *VirtualMachineResource) SetPolicyForMultipleVMs(policy *Policy, vms []*VirtualMachine) error

SetPolicyForMultipleVMs sets a policy for list of VM resources.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL