flasharray

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package flasharray is designed to provide a simple interface for issuing commands to a Pure Storage Flash Array using a REST API. It communicates with the array using the golang http library, and returns the data into types defined within the library. This is not designed to be a standalone program. It is just meant to provide functions and communication within another program

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiToken

type ApiToken struct {
	Api_token string `json:"api_token,omitempty"`
	Created   string `json:"created,omitempty"`
	Expires   string `json:"expires,omitempty"`
	Type      string `json:"type,omitempty"`
	Name      string `json:"name,omitempty"`
}

type Array

type Array struct {
	Id         string `json:"id,omitempty"`
	Array_name string `json:"array_name,omitempty"`
	Version    string `json:"version,omitempty"`
	Revision   string `json:"revision,omitempty"`
}

type Array gives information about the array

type ArrayConnection

type ArrayConnection struct {
	Throttled           bool     `json:"throttled"`
	Array_name          string   `json:"array_name"`
	Version             string   `json:"version"`
	Connected           bool     `json:"connected"`
	Management_address  string   `json:"management_address"`
	Replication_address string   `json:"replication_address"`
	Type                []string `json:"type"`
	Id                  string   `json:"id"`
}

type ArrayService

type ArrayService struct {
	// contains filtered or unexported fields
}

ArrayService type creates a service to perform functions for administering and querying the flash array itself

func (*ArrayService) DisablePhoneHome

func (v *ArrayService) DisablePhoneHome() (*Phonehome, error)

Disable hourly phonehome

func (*ArrayService) DisableRemoteAssist

func (v *ArrayService) DisableRemoteAssist() (*RemoteAssist, error)

Disable Remote Assist

func (*ArrayService) EnablePhoneHome

func (v *ArrayService) EnablePhoneHome() (*Phonehome, error)

Enable hourly phonehome

func (*ArrayService) EnableRemoteAssist

func (v *ArrayService) EnableRemoteAssist() (*RemoteAssist, error)

Enable Remote Assist

func (*ArrayService) Get

func (v *ArrayService) Get(data interface{}) (*Array, error)

Get returns and object describing the flash array

func (*ArrayService) GetManualPhoneHome

func (v *ArrayService) GetManualPhoneHome() (*Phonehome, error)

Get manual phone home status

func (*ArrayService) GetPhoneHome

func (v *ArrayService) GetPhoneHome() (*Array, error)

Get Phonehome status

func (*ArrayService) GetRemoteAssist

func (v *ArrayService) GetRemoteAssist() (*RemoteAssist, error)

Get Remote Status

func (*ArrayService) Phonehome

func (v *ArrayService) Phonehome(action string) (*Phonehome, error)

Manually initiate or cancel phonehome

Parameters action The timeframe of logs to phonehome or cancel the current phonehome action must be one of: "send_today", "send_yesterday", "send_all", "cancel"

func (*ArrayService) Rename

func (v *ArrayService) Rename(name string) (*Array, error)

Rename will change the name of the flash array

func (*ArrayService) Set

func (v *ArrayService) Set(data interface{}) (*Array, error)

Set will change the parameter on the array that is passed in the data map

type CSR

type CSR struct {
	CSR string `json:"certificate_signing_request"`
}

type Certificate

type Certificate struct {
	Status     string `json:"status"`
	Issued_to  string `json:"issued_to"`
	Valid_from string `json:"valid_from"`
	Name       string `json:"name"`
	Locality   string `json:"locality"`
	Country    string `json:"country"`
	Issued_by  string `json:"issued_by"`
	Valid_to   string `json:"valid_to"`
	State      string `json:"state"`
	Key_size   int    `json:"key_size"`
	Org_unit   string `json:"organizational_unit"`
	Org        string `json:"organization"`
	Email      string `json:"email"`
}

type Client

type Client struct {
	Target         string
	Username       string
	Password       string
	Api_token      string
	Rest_version   string
	User_agent     string
	Request_kwargs map[string]string

	Array            *ArrayService
	Volumes          *VolumeService
	Hosts            *HostService
	Hostgroups       *HostgroupService
	Offloads         *OffloadService
	Protectiongroups *ProtectiongroupService
	Vgroups          *VgroupService
	Networks         *NetworkService
	Hardware         *HardwareService
	Users            *UserService
	Dirsrv           *DirsrvService
	// contains filtered or unexported fields
}

Type Client represents a Pure Storage FlashArray and exposes administrative APIs.

func NewClient

func NewClient(target string, username string, password string, api_token string,
	rest_version string, verify_https bool, ssl_cert bool,
	user_agent string, request_kwargs map[string]string) (*Client, error)

NewClient returns a Client struct used to call the administrative functions.

Parameters: target IP address or domain name of the target array's management interface.

username Username to connect to the array

password Password used to connect to the array

api_token API token used to connect to the array

The API Token is always used to connect to the REST API. If username and password are provided, then they are used to retrieve the API token for that user before the HTTP session is started. Either api_token or username and password are required. If neither or both are provided, then an error is returned.

rest_version The REST API version to use for the the session. If not provied, the version will be negotiated between the library and the array.

verify_https A bool used to set whether SSL host verification should be performed.

ssl_cert Path to SSL certificate or CA Bundle file. Ignored if verify_https=False.

user_agent String to be used as the HTTP User-Agent for requests.

request_kwargs A map of keyword arguments that we will pass into the the call.

func (*Client) Do

func (pc *Client) Do(req *http.Request, v interface{}, reestablish_session bool) (*http.Response, error)

Do is the client function that performs the HTTP request. req The HTTP request object to be executed. v The data object that will be populated and returned. i.e. Volume struct reestablish_session A bool that states if the session should be reestablished prior to execution.

This functionality is NOT implemented yet.  By default the Go HTTP library
does not set a timeout, I need to set this implicitly.
However, the array will timeout the session after 30 minutes.

func (*Client) NewRequest

func (c *Client) NewRequest(method string, path string, params map[string]string, data interface{}) (*http.Request, error)

NewRequest builds and returns a new HTTP request object.

Parameters: method This is the HTTP method to be used, i.e. GET, PUT, POST, or DELETE

path String of the API URI path to be called.

params A map of key value pairs that will be added to the query string of the URL

data The data body to be passed in the HTTP request. This will be converted to JSON, then added to the request as bytes.

type Component

type Component struct {
	Name string `json:"name"`
}

type ConnectedVolume

type ConnectedVolume struct {
	Vol    string `json:"vol,omitempty"`
	Name   string `json:"name,omitempty"`
	Lun    int    `json:"lun,omitempty"`
	Hgroup string `json:"hgroup,omitempty"`
}

type Console_lock

type Console_lock struct {
	Console_lock string `json:"console_lock"`
}

type console_lock describes the console_lock status of the array.

type DNS

type DNS struct {
	Nameservers []string `json:"nameservers"`
	Domain      string   `json:"domain"`
}

type Dirsrv

type Dirsrv struct {
	Bind_user     string   `json:"bind_user"`
	Bind_password string   `json:"bind_password"`
	Base_dn       string   `json:"base_dn"`
	Check_peer    bool     `json:"check_peer"`
	Enabled       bool     `json:"enabled"`
	Uri           []string `json:"uri"`
}

type DirsrvRole

type DirsrvRole struct {
	Name       string `json:"name,omitempty"`
	Group      string `json:"group,omitempty"`
	Group_base string `json:"group_base,omitempty"`
}

type DirsrvService

type DirsrvService struct {
	// contains filtered or unexported fields
}

func (*DirsrvService) DisableDirectoryService

func (n *DirsrvService) DisableDirectoryService(check_peer bool) (*Dirsrv, error)

Disable Directory Service if check_peer is true, enables server authenticity enforcement

func (*DirsrvService) EnableDirectoryService

func (n *DirsrvService) EnableDirectoryService(check_peer bool) (*Dirsrv, error)

Enable Directory Service if check_peer is true, enables server authenticity enforcement

func (*DirsrvService) GetDirectoryService

func (n *DirsrvService) GetDirectoryService() (*Dirsrv, error)

Get Directory Service Attributes

func (*DirsrvService) ListDirectoryServiceRoles

func (n *DirsrvService) ListDirectoryServiceRoles() ([]DirsrvRole, error)

Get directory service groups for roles

func (*DirsrvService) SetDirectoryService

func (n *DirsrvService) SetDirectoryService(data interface{}) (*Dirsrv, error)

Set Directory Service Attributes

func (*DirsrvService) SetDirectoryServiceRoles

func (n *DirsrvService) SetDirectoryServiceRoles(data interface{}) (*DirsrvRole, error)

Set directory service groups for roles

func (*DirsrvService) TestDirectoryService

func (n *DirsrvService) TestDirectoryService() (*DirsrvTest, error)

Test the directory service

type DirsrvTest

type DirsrvTest struct {
	Output string `json:"output"`
}

type Drive

type Drive struct {
	Name string `json:"name"`
}

type GlobalAdmin

type GlobalAdmin struct {
}

type HardwareService

type HardwareService struct {
	// contains filtered or unexported fields
}

func (*HardwareService) GetDrive

func (n *HardwareService) GetDrive(name string) (*Drive, error)

Get Drive attributes

func (*HardwareService) GetHardware

func (n *HardwareService) GetHardware(name string) (*Component, error)

Get Hardware attributes

func (*HardwareService) ListDrives

func (n *HardwareService) ListDrives() ([]Drive, error)

List Drives

func (*HardwareService) ListHardware

func (n *HardwareService) ListHardware() ([]Component, error)

List Hardware

func (*HardwareService) SetHardware

func (n *HardwareService) SetHardware(name string, data interface{}) (*Component, error)

Set hardware attributes

type Host

type Host struct {
	Name   string   `json:"name,omitempty"`
	Wwn    []string `json:"wwn,omitempty"`
	Iqn    []string `json:"iqn,omitempty"`
	Hgroup string   `json:"hgroup,omitempty"`
}

type HostPgroup

type HostPgroup struct {
	Name   string `json:"name,omitempty"`
	Pgroup string `json:"protection_group,omitempty"`
}

type HostService

type HostService struct {
	// contains filtered or unexported fields
}

func (*HostService) AddHost

func (h *HostService) AddHost(host string, pgroup string) (*HostPgroup, error)

Add a host to a protection group

func (*HostService) ConnectHost

func (h *HostService) ConnectHost(host string, volume string) (*ConnectedVolume, error)

Connect a volume to a host

func (*HostService) CreateHost

func (h *HostService) CreateHost(name string, data interface{}) (*Host, error)

Create a new host

func (*HostService) DeleteHost

func (h *HostService) DeleteHost(name string) (*Host, error)

Delete a host

func (*HostService) DisconnectHost

func (h *HostService) DisconnectHost(host string, volume string) (*ConnectedVolume, error)

Disconnect a volume from a host

func (*HostService) GetHost

func (h *HostService) GetHost(name string) (*Host, error)

Return the attributes of the given host

func (*HostService) ListHostConnections

func (h *HostService) ListHostConnections(host string) ([]ConnectedVolume, error)

The the host connections

func (*HostService) ListHosts

func (h *HostService) ListHosts() ([]Host, error)

List hosts

func (*HostService) RemoveHost

func (h *HostService) RemoveHost(host string, pgroup string) (*HostPgroup, error)

Remove a host from a protection group

func (*HostService) RenameHost

func (h *HostService) RenameHost(host string, name string) (*Host, error)

Rename a host

func (*HostService) SetHost

func (h *HostService) SetHost(name string, data interface{}) (*Host, error)

Set the attribute of a host

type Hostgroup

type Hostgroup struct {
	Name  string   `json:"name,omitempty"`
	Hosts []string `json:"hosts"`
}

type HostgroupConnection

type HostgroupConnection struct {
	Name string `json:"name,omitempty"`
	Vol  string `json:"vol,omitempty"`
	Lun  int    `json:"lun,omitempty"`
}

type HostgroupPgroup

type HostgroupPgroup struct {
	Name   string `json:"name,omitempty"`
	Pgroup string `json:"protection_group"`
}

type HostgroupService

type HostgroupService struct {
	// contains filtered or unexported fields
}

func (*HostgroupService) AddHostgroup

func (h *HostgroupService) AddHostgroup(hgroup string, pgroup string) (*HostgroupPgroup, error)

Add a hostgroup to a Protection Group

func (*HostgroupService) ConnectHostgroup

func (h *HostgroupService) ConnectHostgroup(hgroup string, volume string) (*ConnectedVolume, error)

Connect a Volume to a hostgroup

func (*HostgroupService) CreateHostgroup

func (h *HostgroupService) CreateHostgroup(name string, data interface{}) (*Hostgroup, error)

Create a new hostgroup

func (*HostgroupService) DeleteHostgroup

func (h *HostgroupService) DeleteHostgroup(name string) (*Hostgroup, error)

Delete a hostgroup

func (*HostgroupService) DisconnectHostgroup

func (h *HostgroupService) DisconnectHostgroup(hgroup string, volume string) (*ConnectedVolume, error)

Disconnect a volume from a hostgroup

func (*HostgroupService) GetHostgroup

func (h *HostgroupService) GetHostgroup(name string) (*Hostgroup, error)

Return a map of the hostgroup attributes

func (*HostgroupService) ListHostgroupConnections

func (h *HostgroupService) ListHostgroupConnections(hgroup string) ([]HostgroupConnection, error)

List the hostgroup connections

func (*HostgroupService) ListHostgroups

func (h *HostgroupService) ListHostgroups() ([]Hostgroup, error)

List hostgroups

func (*HostgroupService) RemoveHostgroup

func (h *HostgroupService) RemoveHostgroup(hgroup string, pgroup string) (*HostgroupPgroup, error)

Remove a hostgroup from a protection group.

func (*HostgroupService) RenameHostgroup

func (h *HostgroupService) RenameHostgroup(hgroup string, name string) (*Hostgroup, error)

Rename a hostgroup

func (*HostgroupService) SetHostgroup

func (h *HostgroupService) SetHostgroup(name string, data interface{}) (*Hostgroup, error)

Set the hostgroup attributes

type LockoutInfo

type LockoutInfo struct {
}

type NFSOffload

type NFSOffload struct {
	Name          string `json:"name"`
	Address       string `json:"address"`
	Mount_point   string `json:"mount_point"`
	Mount_options string `json:"mount_options"`
}

type NetworkInterface

type NetworkInterface struct {
	Name     string   `json:"name,omitempty"`
	Address  string   `json:"address,omitempty"`
	Gateway  string   `json:"gateway,omitempty"`
	Netmask  string   `json:"netmask,omitempty"`
	Enabled  bool     `json:"enabled,omitempty"`
	Subnet   string   `json:"subnet,omitempty"`
	Mtu      int      `json:"mtu,omitempty"`
	Services []string `json:"services,omitempty"`
	Slaves   []string `json:"slaves,omitempty"`
	Hwaddr   string   `json:"hwaddr,omitempty"`
	Speed    int      `json:"speed,omitempty"`
}

type NetworkService

type NetworkService struct {
	// contains filtered or unexported fields
}

func (*NetworkService) CreateSubnet

func (n *NetworkService) CreateSubnet(subnet string, prefix string) (*Subnet, error)

Create a subnet param: subnet - Name of subnet to be created param: prefix - Routing prefix of subnet to be created note: prefix should be specified as an IPv4 CIDR address. ("xxx.xxx.xxx.xxx/nn", representing prefix and prefix length)

func (*NetworkService) CreateVlanInterface

func (n *NetworkService) CreateVlanInterface(iface string, subnet string) (*NetworkInterface, error)

Create a VLAN Interface param: iface - Name of interface to be created param: subnet - Subnet to be associated with the new interface

func (*NetworkService) DeleteSubnet

func (n *NetworkService) DeleteSubnet(subnet string) (*Subnet, error)

Delete a subnet param: subnet - Name of subnet to be deleted

func (*NetworkService) DeleteVlanInterface

func (n *NetworkService) DeleteVlanInterface(iface string) (*NetworkInterface, error)

Delete a VLAN Interface param: iface - Name of iface to be deleted

func (*NetworkService) DisableNetworkInterface

func (n *NetworkService) DisableNetworkInterface(iface string) (*NetworkInterface, error)

Disable a network interface. param: iface: Name of network interface to be disabled. Returns an object describing the interface.

func (*NetworkService) DisableSubnet

func (n *NetworkService) DisableSubnet(subnet string) (*Subnet, error)

Disable a subnet param: subnet: Name of subnet to be disabled. Returns an object describing the subnet

func (*NetworkService) EnableNetworkInterface

func (n *NetworkService) EnableNetworkInterface(iface string) (*NetworkInterface, error)

Enable a network interface. param: iface: Name of network interface to be enabled. Returns an object describing the interface.

func (*NetworkService) EnableSubnet

func (n *NetworkService) EnableSubnet(subnet string) (*Subnet, error)

Enable a subnet param: subnet: Name of subnet to be enabled. Returns an object describing the subnet

func (*NetworkService) GetDNS

func (n *NetworkService) GetDNS() (*DNS, error)

Get DNS settings

func (*NetworkService) GetNetworkInterface

func (n *NetworkService) GetNetworkInterface(iface string) (*NetworkInterface, error)

Get network interface attributes

func (*NetworkService) GetSubnet

func (n *NetworkService) GetSubnet(subnet string) (*Subnet, error)

Get subnet attributes

func (*NetworkService) ListNetworkInterfaces

func (n *NetworkService) ListNetworkInterfaces() ([]NetworkInterface, error)

List network interfaces

func (*NetworkService) ListPorts

func (n *NetworkService) ListPorts(data interface{}) ([]Port, error)

List ports

func (*NetworkService) ListSubnets

func (n *NetworkService) ListSubnets() ([]Subnet, error)

List Subnets

func (*NetworkService) RenameSubnet

func (n *NetworkService) RenameSubnet(subnet string, name string) (*Subnet, error)

Rename a subnet param: subnet: Name of subnet to be renamed. param: name: Name to change the subnet to Returns an object describing the subnet

func (*NetworkService) SetDNS

func (n *NetworkService) SetDNS(data interface{}) (*DNS, error)

Set DNS settings

func (*NetworkService) SetNetworkInterface

func (n *NetworkService) SetNetworkInterface(iface string, data interface{}) (*NetworkInterface, error)

Set network interface attributes

func (*NetworkService) SetSubnet

func (n *NetworkService) SetSubnet(subnet string, data interface{}) (*Subnet, error)

Set subnet attributes

type OffloadService

type OffloadService struct {
	// contains filtered or unexported fields
}

func (*OffloadService) ConnectNFSOffload

func (o *OffloadService) ConnectNFSOffload(name string, address string, mount_point string) (*NFSOffload, error)

Connect to NFS Offload

func (*OffloadService) DisconnectNFSOffload

func (o *OffloadService) DisconnectNFSOffload(name string) (*NFSOffload, error)

Disconnect an NFS Offload

func (*OffloadService) GetNFSOffload

func (o *OffloadService) GetNFSOffload(name string) (*NFSOffload, error)

Get NFS offload attributes

type Phonehome

type Phonehome struct {
	Phonehome string `json:"phonehome,omitempty"`
	Status    string `json:"status,omitempty"`
	Action    string `json:"action,omitempty"`
}

type Port

type Port struct {
	Name     string `json:"name"`
	Portal   string `json:"portal"`
	Failover string `json:"failover"`
	Iqn      string `json:"iqn"`
	Wwn      string `json:"wwn"`
}

type Protectiongroup

type Protectiongroup struct {
	Name               string         `json:"name,omitempty"`
	Hgroups            []string       `json:"hgroups,omitempty"`
	Source             string         `json:"source,omitempty"`
	Hosts              []string       `json:"hosts,omitempty"`
	Volumes            []string       `json:"volumes,omitempty"`
	Targets            []string       `json:"targets,omitempty"`
	Allfor             int            `json:"all_for,omitempty"`
	Allowed            bool           `json:"allowed,omitempty"`
	Days               int            `json:"days,omitempty"`
	Perday             int            `json:"per_day,omitempty"`
	ReplicateAt        int            `json:"replicate_at,omitempty"`
	ReplicateBlackout  map[string]int `json:"replicate_blackout,omitempty"`
	ReplicateEnabled   bool           `json:"replicate_enabled,omitempty"`
	ReplicateFrequency int            `json:"replicate_frequency,omitempty"`
	SnapAt             int            `json:"snap_at,omitempty"`
	SnapEnabled        bool           `json:"snap_enabled,omitempty"`
	SnapFrequency      int            `json:"snap_frequency,omitempty"`
	TargetAllfor       int            `json:"target_all_for,omitempty"`
	TargetDays         int            `json:"target_days,omitempty"`
	TargetPerDay       int            `json:"target_per_day,omitempty"`
}

type ProtectiongroupService

type ProtectiongroupService struct {
	// contains filtered or unexported fields
}

func (*ProtectiongroupService) CreatePgroupSnapshot

func (v *ProtectiongroupService) CreatePgroupSnapshot(pgroup string) (*ProtectiongroupSnapshot, error)

Create a Protection Group Snapshot

func (*ProtectiongroupService) CreatePgroupSnapshots

func (v *ProtectiongroupService) CreatePgroupSnapshots(pgroups []string) ([]ProtectiongroupSnapshot, error)

Create Protection Group snapshots for multiple Protection groups.

func (*ProtectiongroupService) CreateProtectiongroup

func (h *ProtectiongroupService) CreateProtectiongroup(name string, data interface{}) (*Protectiongroup, error)

Create a Protection group

func (*ProtectiongroupService) DestroyProtectiongroup

func (h *ProtectiongroupService) DestroyProtectiongroup(name string) (*Protectiongroup, error)

Destroy Protection group

func (*ProtectiongroupService) DisablePgroupReplication

func (h *ProtectiongroupService) DisablePgroupReplication(pgroup string) (*Protectiongroup, error)

Disable Protection Group Replication

func (*ProtectiongroupService) DisablePgroupSnapshots

func (h *ProtectiongroupService) DisablePgroupSnapshots(pgroup string) (*Protectiongroup, error)

Disable Protection group snapshot schedule

func (*ProtectiongroupService) EnablePgroupReplication

func (h *ProtectiongroupService) EnablePgroupReplication(pgroup string) (*Protectiongroup, error)

Enable Protection Group Replication

func (*ProtectiongroupService) EnablePgroupSnapshots

func (h *ProtectiongroupService) EnablePgroupSnapshots(pgroup string) (*Protectiongroup, error)

Enable Protection Group Snapshot schedule

func (*ProtectiongroupService) EradicateProtectiongroup

func (h *ProtectiongroupService) EradicateProtectiongroup(pgroup string) (*Protectiongroup, error)

Eradicate deleted protection group

func (*ProtectiongroupService) GetProtectiongroup

func (h *ProtectiongroupService) GetProtectiongroup(name string, data interface{}) (*Protectiongroup, error)

Get protection group attributes

func (*ProtectiongroupService) ListProtectiongroups

func (h *ProtectiongroupService) ListProtectiongroups() ([]Protectiongroup, error)

List Protection groups

func (*ProtectiongroupService) RecoverProtectiongroup

func (h *ProtectiongroupService) RecoverProtectiongroup(pgroup string) (*Protectiongroup, error)

Recover deleted protection group

func (*ProtectiongroupService) RenameProtectiongroup

func (h *ProtectiongroupService) RenameProtectiongroup(pgroup string, name string) (*Protectiongroup, error)

Rename Protection group

func (*ProtectiongroupService) SendPgroupSnapshot

func (v *ProtectiongroupService) SendPgroupSnapshot(pgroup string) ([]ProtectiongroupSnapshot, error)

Send the Protection group snapshot to the target

func (*ProtectiongroupService) SetProtectiongroup

func (h *ProtectiongroupService) SetProtectiongroup(name string, data interface{}) (*Protectiongroup, error)

Set protection group attributes

type ProtectiongroupSnapshot

type ProtectiongroupSnapshot struct {
	Source  string `json:"source"`
	Name    string `json:"name"`
	Created string `json:"created"`
}

type PublicKey

type PublicKey struct {
	Publickey string `json:"publickey,omitempty"`
	Type      string `json:"type,omitempty"`
	Name      string `json:"name,omitempty"`
}

type RemoteAssist

type RemoteAssist struct {
	Status string `json:"status,omitempty"`
	Name   string `json:"name,omitempty"`
	Port   string `json:"port,omitempty"`
}

type SnmpEngine

type SnmpEngine struct {
	Engine_id string `json:"engine_id"`
}

type SnmpManager

type SnmpManager struct {
	Name               string `json:"name"`
	Notification       string `json:"notification"`
	Community          string `json:"community"`
	Privacy_protocol   string `json:"privacy_protocol"`
	Auth_protocol      string `json:"auth_protocol"`
	Host               string `json:"host"`
	Version            string `json:"version"`
	User               string `json:"user"`
	Privacy_passphrase string `json:"privacy_passphrase"`
	Auth_passphrase    string `json:"auth_passphrase"`
}

type Subnet

type Subnet struct {
	Name    string `json:"name"`
	Prefix  string `json:"prefix"`
	Enabled bool   `json:"enabled"`
	Vlan    string `json:"vlan"`
	Gateway string `json:"gateway"`
	Mtu     int    `json:"mtu"`
}

type User

type User struct {
	Name string `json:"name"`
	Role string `json:"role"`
	Type string `json:"type"`
}

type UserService

type UserService struct {
	// contains filtered or unexported fields
}

func (*UserService) CreateAdmin

func (n *UserService) CreateAdmin(name string) (*User, error)

Create Admin

func (*UserService) CreateApiToken

func (n *UserService) CreateApiToken(name string) (*ApiToken, error)

Create API Token

func (*UserService) DeleteAdmin

func (n *UserService) DeleteAdmin(name string) (*User, error)

Delete Admin

func (*UserService) DeleteApiToken

func (n *UserService) DeleteApiToken(name string) (*ApiToken, error)

Delete API Token

func (*UserService) GetAdmin

func (n *UserService) GetAdmin(name string) (*User, error)

Get Admin

func (*UserService) GetAdminUser

func (n *UserService) GetAdminUser(name string) (*User, error)

Return a map describing lockout information specified admins

func (*UserService) GetGlobalAdminAttr

func (n *UserService) GetGlobalAdminAttr() (*GlobalAdmin, error)

Return a map describing the existing global admin attributes

func (*UserService) ListAdminUser

func (n *UserService) ListAdminUser() ([]User, error)

Return a map describing lockout information for locked out admins

func (*UserService) ListAdmins

func (n *UserService) ListAdmins() ([]User, error)

List Admins

func (*UserService) ListApiTokens

func (n *UserService) ListApiTokens() ([]User, error)

Return a list of API Tokens

func (*UserService) ListPublicKeys

func (n *UserService) ListPublicKeys() ([]User, error)

Return a list of public keys

func (*UserService) RefreshAdmin

func (n *UserService) RefreshAdmin(name string) (*User, error)

Refresh the admin permission cache for the specified admin

func (*UserService) RefreshAdmins

func (n *UserService) RefreshAdmins() (*User, error)

Clear the admin permission cache.

func (*UserService) SetAdmin

func (n *UserService) SetAdmin(name string, data interface{}) (*User, error)

Set Admin Attribute

func (*UserService) SetGlobalAdminAttr

func (n *UserService) SetGlobalAdminAttr(data interface{}) (*GlobalAdmin, error)

Set global admin attributes

func (*UserService) SetPassword

func (n *UserService) SetPassword(name string, new_password string, old_password string) (*User, error)

Set the password for the specified admin

func (*UserService) SetPublicKey

func (n *UserService) SetPublicKey(name string, key string) (*User, error)

Set public key for the specified admin

func (*UserService) UnlockAdmin

func (n *UserService) UnlockAdmin(name string) (*User, error)

Unlocks an admin

type Vgroup

type Vgroup struct {
	Name    string   `json:"name"`
	Volumes []string `json:"volumes"`
}

type VgroupService

type VgroupService struct {
	// contains filtered or unexported fields
}

func (*VgroupService) CreateVgroup

func (h *VgroupService) CreateVgroup(name string) (*Vgroup, error)

Create Vgroup

func (*VgroupService) DestroyVgroup

func (h *VgroupService) DestroyVgroup(name string) (*Vgroup, error)

Destroy Vgroup

func (*VgroupService) EradicateVgroup

func (h *VgroupService) EradicateVgroup(vgroup string) (*Vgroup, error)

Eradicate Vgroup

func (*VgroupService) GetVgroup

func (h *VgroupService) GetVgroup(name string) (*Vgroup, error)

Get Vgroup attributes

func (*VgroupService) ListVgroups

func (h *VgroupService) ListVgroups() ([]Vgroup, error)

List Vgroups

func (*VgroupService) RecoverVgroup

func (h *VgroupService) RecoverVgroup(vgroup string) (*Vgroup, error)

Recover deleted vgroup

func (*VgroupService) RenameVgroup

func (h *VgroupService) RenameVgroup(vgroup string, name string) (*Vgroup, error)

Rename vgroup

func (*VgroupService) SetVgroup

func (h *VgroupService) SetVgroup(name string, data interface{}) (*Vgroup, error)

Set vgroup attribute

type Volume

type Volume struct {
	Name    string `json:"name,omitempty"`
	Source  string `json:"source,omitempty"`
	Serial  string `json:"serial,omitempty"`
	Size    int    `json:"size,omitempty"`
	Created string `json:"created,omitempty"`
}

type VolumePgroup

type VolumePgroup struct {
	Name   string `json:"name"`
	Pgroup string `json:"protection_group"`
}

type VolumeService

type VolumeService struct {
	// contains filtered or unexported fields
}

func (*VolumeService) AddVolume

func (v *VolumeService) AddVolume(volume string, pgroup string) (*VolumePgroup, error)

Add a volume to a protection group

func (*VolumeService) CopyVolume

func (v *VolumeService) CopyVolume(dest string, source string, overwrite bool) (*Volume, error)

Clone a volume and return a dictionary describing the new volume.

func (*VolumeService) CreateConglomerateVolume

func (v *VolumeService) CreateConglomerateVolume(name string) (*Volume, error)

Create a conglomerate volume. This is not a typical volume thus there is no size. It's main purpose to connect to a host/hgroup to create a PE LUN. Once the conglomerate volume is connected to a host/hgroup, it is used as a protocol-endpoint to connect a vvol to a host/hgroup to allow traffic.

func (*VolumeService) CreateSnapshot

func (v *VolumeService) CreateSnapshot(volume string, suffix string) (*Volume, error)

CreateSnapshot function creates a volume snapshot of the volume passed in the argument.

func (*VolumeService) CreateSnapshots

func (v *VolumeService) CreateSnapshots(volumes []string, suffix string) ([]Volume, error)

CreateSnapshosts function will create a snapshot of all the volumes passed in the volumes slice. an array of volume objects is returned.

func (*VolumeService) CreateVolume

func (v *VolumeService) CreateVolume(name string, size int) (*Volume, error)

CreateVolume function will create a volume of the given size. The size is an integer in bytes

func (*VolumeService) DeleteVolume

func (v *VolumeService) DeleteVolume(name string) (*Volume, error)

Delete an existing volume or snapshot

func (*VolumeService) EradicateVolume

func (v *VolumeService) EradicateVolume(name string) (*Volume, error)

Eradicate a deleted volume or snapshot

func (*VolumeService) ExtendVolume

func (v *VolumeService) ExtendVolume(name string, size int) (*Volume, error)

Extend the size of the volume

func (*VolumeService) GetVolume

func (v *VolumeService) GetVolume(name string) (*Volume, error)

Get volume attributes

func (*VolumeService) ListVolumeBlockDiff

func (v *VolumeService) ListVolumeBlockDiff() error

List Volume Block Differences not implemented yet

func (*VolumeService) ListVolumePrivateConnections

func (v *VolumeService) ListVolumePrivateConnections() error

List Volume Private Connections not implemented yet

func (*VolumeService) ListVolumeSharedConnections

func (v *VolumeService) ListVolumeSharedConnections() error

List volume shared connections.

func (*VolumeService) ListVolumes

func (v *VolumeService) ListVolumes(data interface{}) ([]Volume, error)

List volumes

func (*VolumeService) MoveVolume

func (v *VolumeService) MoveVolume(name string, container string) (*Volume, error)

Move a volume to a different container

func (*VolumeService) RecoverVolume

func (v *VolumeService) RecoverVolume(volume string) (*Volume, error)

Recover a deleted volume

func (*VolumeService) RemoveVolume

func (v *VolumeService) RemoveVolume(volume string, pgroup string) (*VolumePgroup, error)

Remove a volume from a protection group

func (*VolumeService) RenameVolume

func (v *VolumeService) RenameVolume(volume string, name string) (*Volume, error)

Rename a volume

func (*VolumeService) SetVolume

func (v *VolumeService) SetVolume(name string, data interface{}) (*Volume, error)

function SetVolume is a helper function that sets the parameter passed in the data interface of the volume in the name argument. A Volume object is returned with the new values.

func (*VolumeService) TruncateVolume

func (v *VolumeService) TruncateVolume(name string, size int) (*Volume, error)

Decrese the size of a volume WARNING!! Potential data loss

Jump to

Keyboard shortcuts

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