cloudmanager

package
v0.0.0-...-00272b4 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: MPL-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

View Source
const GiBToBytes = 1024 * 1024 * 1024

GiBToBytes converting GB to bytes

View Source
const TiBToGiB = 1024

TiBToGiB converting TiB to GiB

Variables

View Source
var AWSLicenseTypes = []string{"cot-standard-paygo", "cot-premium-paygo", "cot-explore-paygo", "cot-premium-byol",
	"ha-cot-standard-paygo", "ha-cot-premium-paygo", "ha-cot-premium-byol", "ha-cot-explore-paygo", "capacity-paygo",
	"ha-capacity-paygo"}

AWSLicenseTypes is the AWS License types

View Source
var AzureLicenseTypes = []string{"azure-cot-standard-paygo", "azure-cot-premium-paygo", "azure-cot-premium-byol",
	"azure-cot-explore-paygo", "azure-ha-cot-standard-paygo", "azure-ha-cot-premium-paygo", "azure-ha-cot-premium-byol",
	"capacity-paygo", "ha-capacity-paygo"}

AzureLicenseTypes is the Azure License types

View Source
var GCPLicenseTypes = []string{"gcp-cot-standard-paygo", "gcp-cot-explore-paygo", "gcp-cot-premium-paygo",
	"gcp-cot-premium-byol", "gcp-ha-cot-standard-paygo", "gcp-ha-cot-premium-paygo", "gcp-ha-cot-explore-paygo",
	"gcp-ha-cot-premium-byol", "capacity-paygo", "ha-capacity-paygo"}

GCPLicenseTypes is the GCP License types

Functions

func Provider

func Provider() terraform.ResourceProvider

Provider is the main method for NetApp CloudManager Terraform provider

Types

type AWSInstanceMetadata

type AWSInstanceMetadata struct {
	HTTPEndpoint            *string
	HTTPPutResponseHopLimit *int64
	HTTPTokens              *string
}

AWSInstanceMetadata describes the metadata options for the ec2 instance

type Client

type Client struct {
	CloudManagerHost        string
	AuthHost                string
	SaAuthHost              string
	SaSecretKey             string
	SaClientID              string
	CVOHostName             string
	HostType                string
	MaxConcurrentRequests   int
	UserData                string
	BaseURL                 string
	RefreshToken            string
	Project                 string
	CloudManagerDomain      string
	Audience                string
	Auth0Client             string
	ClientID                string
	AccountID               string
	Token                   string
	AMIFilter               string
	AWSAccount              string
	AzureEnvironmentForOCCM string
	GCPDeploymentManager    string
	GCPCompute              string
	GCPImageProject         string
	GCPImageFamily          string
	GCPDeploymentTemplate   string
	GCPServiceAccountKey    string
	CVSHostName             string
	Retries                 int

	Simulator          bool
	AWSProfile         string
	AWSProfileFilePath string
	AzureAuthMethods   []string
	// contains filtered or unexported fields
}

A Client to interact with the CVO/AWS/GCP/ANF/OCCM API

func (*Client) AzureAuthorize

func (c *Client) AzureAuthorize() (autorest.Authorizer, error)

AzureAuthorize - Azure authorization using env or cli or both

func (*Client) CallAMIGet

func (c *Client) CallAMIGet(occmDetails createAWSOCCMDetails) (string, error)

CallAMIGet can be used to make a request to get AWS AMI

func (*Client) CallAPIMethod

func (c *Client) CallAPIMethod(method string, baseURL string, params map[string]interface{}, token string, hostType string, clientID string) (int, []byte, string, error)

CallAPIMethod can be used to make a request to any CVO/OCCM API method, receiving results as byte

func (*Client) CallAWSDescribeInstanceAttribute

func (c *Client) CallAWSDescribeInstanceAttribute(occmDetails createAWSOCCMDetails) (bool, error)

CallAWSDescribeInstanceAttribute returns disableAPITermination.

func (*Client) CallAWSGetReservationsForRegion

func (c *Client) CallAWSGetReservationsForRegion(region string) ([]ec2.Instance, error)

CallAWSGetReservationsForRegion gets reservations for a region.

func (*Client) CallAWSInstanceCreate

func (c *Client) CallAWSInstanceCreate(occmDetails createAWSOCCMDetails) (string, error)

CallAWSInstanceCreate can be used to make a request to create AWS Instance

func (*Client) CallAWSInstanceGet

func (c *Client) CallAWSInstanceGet(occmDetails createAWSOCCMDetails) ([]ec2.Instance, error)

CallAWSInstanceGet can be used to make a request to get AWS Instance

func (*Client) CallAWSInstanceTerminate

func (c *Client) CallAWSInstanceTerminate(occmDetails deleteOCCMDetails) error

CallAWSInstanceTerminate can be used to make a request to terminate AWS Instance

func (*Client) CallAWSInstanceUpdate

func (c *Client) CallAWSInstanceUpdate(occmDetails createAWSOCCMDetails) error

CallAWSInstanceUpdate updates the instance metadata

func (*Client) CallAWSRegionGet

func (c *Client) CallAWSRegionGet(occmDetails createAWSOCCMDetails) ([]string, error)

CallAWSRegionGet describe all regions.

func (*Client) CallAWSTagCreate

func (c *Client) CallAWSTagCreate(occmDetails createAWSOCCMDetails) error

CallAWSTagCreate creates tag

func (*Client) CallAWSTagDelete

func (c *Client) CallAWSTagDelete(occmDetails createAWSOCCMDetails) error

CallAWSTagDelete deletes tag

func (*Client) CallDeleteAzureVM

func (c *Client) CallDeleteAzureVM(occmDetails deleteOCCMDetails) error

CallDeleteAzureVM can be used to make a request to delete Azure VM

func (*Client) CallDeployAzureVM

func (c *Client) CallDeployAzureVM(occmDetails createOCCMDetails) (string, error)

CallDeployAzureVM can be used to make a request to deploy Azure VM

func (*Client) CallGetAzureVM

func (c *Client) CallGetAzureVM(occmDetails createOCCMDetails) (string, error)

CallGetAzureVM can be used to make a request to get Azure VM

func (*Client) CallVNetGet

func (c *Client) CallVNetGet(subscriptionID string, resourceGroup string) (string, string, error)

CallVNetGet can be used to make a request to get Azure virtual network

func (*Client) CallVNetGetCidr

func (c *Client) CallVNetGetCidr(subscriptionID string, resourceGroup string, vnet string) (string, error)

CallVNetGetCidr can be used to make a request to get Azure virtual network

func (*Client) CallVPCGet

func (c *Client) CallVPCGet(subnet string, region string) (string, error)

CallVPCGet can be used to make a request to get AWS AMI

func (*Client) GetRefreshToken

func (c *Client) GetRefreshToken() string

GetRefreshToken returns the API version that will be used for CVO/OCCM API requests

func (*Client) GetServiceCredential

func (c *Client) GetServiceCredential() (string, string)

GetServiceCredential returns the service account secret key and secret client id that will be used for CVO/OCCM API requests

func (*Client) GetSimulator

func (c *Client) GetSimulator() bool

GetSimulator returns if it is set running on simulator

func (*Client) SetRefreshToken

func (c *Client) SetRefreshToken(refreshToken string)

SetRefreshToken for the client to use for requests to the CVO/OCCM API

func (*Client) SetServiceCredential

func (c *Client) SetServiceCredential(SaSecretKey string, SaClientID string)

SetServiceCredential for the client to use for requests to the CVO/OCCM API

func (*Client) SetSimulator

func (c *Client) SetSimulator(simulator bool)

SetSimulator for the client to use for tests on simulator

type ExportPolicyInfo

type ExportPolicyInfo struct {
	Name       string             `structs:"name,omitempty"`
	PolicyType string             `structs:"policyType,omitempty"`
	Ips        []string           `structs:"ips,omitempty"`
	NfsVersion []string           `structs:"nfsVersion,omitempty"`
	Rules      []ExportPolicyRule `structs:"rules,omitempty"`
}

ExportPolicyInfo describes the export policy section.

type ExportPolicyInfoResponse

type ExportPolicyInfoResponse struct {
	Name       string             `json:"name"`
	PolicyType string             `json:"policyType"`
	Ips        []string           `json:"ips"`
	NfsVersion []string           `json:"nfsVersion"`
	Rules      []ExportPolicyRule `json:"rules"`
}

ExportPolicyInfoResponse describes the export policy section in API response.

type ExportPolicyRule

type ExportPolicyRule struct {
	// Protocols         []string `structs:"protocols"`
	// Clients           []string `structs:"clients"`
	// RoRule            []string `structs:"ro_rule"`
	// RwRule            []string `structs:"rw_rule"`
	Superuser         bool     `structs:"superuser"`
	Index             int32    `structs:"index,omitempty"`
	RuleAccessControl string   `structs:"ruleAccessControl"`
	Ips               []string `structs:"ips"`
	NfsVersion        []string `structs:"nfsVersion,omitempty"`
}

ExportPolicyRule describes the export policy rule section.

type OCCMMGCPResult

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

OCCMMGCPResult the response name of a occm

type OCCMMResult

type OCCMMResult struct {
	ClientID    string
	AccountID   string
	InstanceID  string
	PrincipalID string
}

OCCMMResult the users input for creating a occm

Directories

Path Synopsis
cloudmanager

Jump to

Keyboard shortcuts

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