Documentation ¶
Overview ¶
Package pure1 is a library used to interface with the Pure1 Manage REST API
Index ¶
- type Array
- type ArrayService
- type Client
- type Filesystem
- type FilesystemService
- type FilesystemSnapshot
- type FilesystemSnapshotService
- type Metric
- type MetricsService
- type NetworkInterface
- type NetworkInterfacesService
- type Pod
- type PodService
- type Tag
- type Volume
- type VolumeService
- type VolumeSnapshot
- type VolumeSnapshotService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Array ¶
type Array struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` Model string `json:"model,omitempty"` OS string `json:"os,omitempty"` Version string `json:"version,omitempty"` AsOf int `json:"_as_of,omitempty"` }
Array type describes the array object returned by the API
type ArrayService ¶
type ArrayService struct {
// contains filtered or unexported fields
}
ArrayService type creates a service to expose array endpoints
func (*ArrayService) CreateTags ¶
func (a *ArrayService) CreateTags(params map[string]string, data interface{}) error
CreateTags creates a list of tags on a array params resource_id or resource_names is required both are comma-separated lists of tags to be added to
func (*ArrayService) DeleteTags ¶
func (a *ArrayService) DeleteTags(params map[string]string) error
DeleteTags returns a list of tags on arrays params resource_id or resource_names is required both are comma-separated lists of tags to be deleted
type Client ¶
type Client struct { AppID string PrivateKey []byte RestVersion string Arrays *ArrayService Filesystems *FilesystemService FilesystemSnapshots *FilesystemSnapshotService Metrics *MetricsService NetworkInterfaces *NetworkInterfacesService Pods *PodService Volumes *VolumeService VolumeSnapshots *VolumeSnapshotService // contains filtered or unexported fields }
Client struct represents the Pure1 API and exposes its endpoints
func (*Client) Do ¶
func (c *Client) Do(req *http.Request, v interface{}, reestablishSession 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 Filesystem ¶
type Filesystem struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` AsOf int `json:"_as_of,omitempty"` Arrays []interface{} `json:"arrays,omitempty"` Created int `json:"create,omitempty"` Destroyed bool `json:"destroyed,omitempty"` FastRemoveDirectoryEnabled bool `json:"fast_remove_directory_enabled,omitempty"` HardLimitEnabled bool `json:"hard_limit_enabled,omitempty"` HTTP interface{} `json:"http,omitempty"` NFS interface{} `json:"nfs,omitempty"` Provisioned int `json:"provisioned,omitempty"` SMB interface{} `json:"smb,omitempty"` SnapshotDirectoryEnabled bool `json:"snapshot_directory_enabled,omitempty"` }
Filesystem type describes the filesystem object returned by the API
type FilesystemService ¶
type FilesystemService struct {
// contains filtered or unexported fields
}
FilesystemService type creates a service to expose array endpoints
func (*FilesystemService) GetFilesystems ¶
func (f *FilesystemService) GetFilesystems(params map[string]string) ([]Filesystem, error)
GetFilesystems returns a list of Filesystem objects
type FilesystemSnapshot ¶
type FilesystemSnapshot struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` AsOf int `json:"_as_of,omitempty"` Arrays []interface{} `json:"arrays,omitempty"` Created int `json:"create,omitempty"` Destroyed bool `json:"destroyed,omitempty"` On interface{} `json:"on,omitempty"` Source interface{} `json:"source,omitempty"` Suffix string `json:"suffix,omitempty"` }
FilesystemSnapshot type describes the filesystem snapshot object returned by the API
type FilesystemSnapshotService ¶
type FilesystemSnapshotService struct {
// contains filtered or unexported fields
}
FilesystemSnapshotService type creates a service to expose array endpoints
func (*FilesystemSnapshotService) GetFilesystemSnapshots ¶
func (f *FilesystemSnapshotService) GetFilesystemSnapshots(params map[string]string) ([]FilesystemSnapshot, error)
GetFilesystemSnapshots returns a list of Filesystem objects
type Metric ¶
type Metric struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` AsOf int `json:"_as_of,omitempty"` Availabilities []interface{} `json:"availabilities,omitempty"` Data []interface{} `json:"data,omitempty"` Description string `json:"description,omitempty"` ResourceTypes interface{} `json:"resource_types,omitempty"` Resources []interface{} `json:"resources,omitempty"` Resolution int `json:"resolution,omitempty"` Unit string `json:"unit,omitempty"` }
Metric type describes the metric object returned by the API
type MetricsService ¶
type MetricsService struct {
// contains filtered or unexported fields
}
MetricsService type creates a service to expose metrics endpoints
func (*MetricsService) GetMetricHistory ¶
func (s *MetricsService) GetMetricHistory(aggregation string, startTime int, endTime int, resolution int, params map[string]string) ([]Metric, error)
GetMetricHistory returns a list of metric objects aggregation: 'avg' or 'max' endTime: in milliseconds since epoch startTime: in milliseconds since epoch resolution: duration between data points, in milliseconds params: ids or names, and resource_ids or resource_names are required
func (*MetricsService) GetMetrics ¶
func (s *MetricsService) GetMetrics(params map[string]string) ([]Metric, error)
GetMetrics returns a list of metric objects
type NetworkInterface ¶
type NetworkInterface struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` AsOf int `json:"_as_of,omitempty"` Arrays []interface{} `json:"arrays,omitempty"` Address string `json:"address,omitempty"` Enabled bool `json:"enabled,omitempty"` Gateway string `json:"gateway,omitempty"` HwAddr string `json:"hwaddr,omitempty"` MTU int `json:"mtu,omitempty"` Netmask string `json:"netmask,omitempty"` Services []string `json:"services,omitempty"` Speed int `json:"speed,omitempty"` SubInterfaces []string `json:"subinterfaces"` }
NetworkInterface type describes the network interface object returned by the API
type NetworkInterfacesService ¶
type NetworkInterfacesService struct {
// contains filtered or unexported fields
}
NetworkInterfacesService type creates a service to expose array endpoints
func (*NetworkInterfacesService) GetNetworkInterfacess ¶
func (n *NetworkInterfacesService) GetNetworkInterfacess(params map[string]string) ([]NetworkInterface, error)
GetNetworkInterfacess returns a list of Filesystem objects
type Pod ¶
type Pod struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` AsOf int `json:"_as_of,omitempty"` Arrays []interface{} `json:"arrays,omitempty"` Mediator string `json:"mediator,omitempty"` Source interface{} `json:"source,omitempty"` }
Pod type describes the network interface object returned by the API
type PodService ¶
type PodService struct {
// contains filtered or unexported fields
}
PodService type creates a service to expose pods endpoints
type Tag ¶
type Tag struct { Key string `json:"key,omitempty"` Namespace string `json:"namespace,omitempty"` Resource map[string]string `json:"resource,omitempty"` TagOrganizationID int `json:"tag_organization_id,omitempty"` Value string `json:"value,omitempty"` }
Tag type describes the array object returned by the API
type Volume ¶
type Volume struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` AsOf int `json:"_as_of,omitempty"` Arrays []interface{} `json:"arrays,omitempty"` Created int `json:"created,omitempty"` Destroyed bool `json:"destroyed,omitempty"` Eradicated bool `json:"eradicated,omitempty"` Pod interface{} `json:"pod,omitempty"` Provisioned int `json:"provisioned,omitempty"` Serial string `json:"serial,omitempty"` Source interface{} `json:"source,omitempty"` }
Volume type describes the volume object returned by the API
type VolumeService ¶
type VolumeService struct {
// contains filtered or unexported fields
}
VolumeService type creates a service to expose volume endpoints
func (*VolumeService) GetVolumes ¶
func (v *VolumeService) GetVolumes(params map[string]string) ([]Volume, error)
GetVolumes returns a list of volume objects
type VolumeSnapshot ¶
type VolumeSnapshot struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` AsOf int `json:"_as_of,omitempty"` Arrays []interface{} `json:"arrays,omitempty"` Created int `json:"created,omitempty"` Destroyed bool `json:"destroyed,omitempty"` On interface{} `json:"on,omitempty"` Pod interface{} `json:"pod,omitempty"` Provisioned int `json:"provisioned,omitempty"` Serial string `json:"serial,omitempty"` SnapshotGroup interface{} `json:"snapshot_group,omitempty"` Source interface{} `json:"source,omitempty"` Suffix string `json:"suffix,omitempty"` }
VolumeSnapshot type describes the VolumeSnapshot object returned by the API
type VolumeSnapshotService ¶
type VolumeSnapshotService struct {
// contains filtered or unexported fields
}
VolumeSnapshotService type creates a service to expose VolumeSnapshot endpoints
func (*VolumeSnapshotService) GetVolumeSnapshots ¶
func (v *VolumeSnapshotService) GetVolumeSnapshots(params map[string]string) ([]VolumeSnapshot, error)
GetVolumeSnapshots returns a list of VolumeSnapshot objects