Documentation ¶
Index ¶
- Constants
- func CheckConfig(conf *ServiceConfig) error
- func CheckResponse(r *http.Response) error
- func FormatCredentials(a AuthCredentials) string
- type APIVersion
- type AdditionalProperties
- type Attrs
- type AuthCredentials
- type BlueprintAbortRequest
- type BlueprintAbortResponse
- type BlueprintCloneRequest
- type BlueprintCloneResponse
- type BlueprintCreateRequest
- type BlueprintCreateResponse
- type BlueprintDownloadRequest
- type BlueprintDownloadResponse
- type BlueprintExportRequest
- type BlueprintExportResponse
- type BlueprintGetPendingLaunchRequest
- type BlueprintGetPendingLaunchResponse
- type BlueprintGetRuntimeVariablesRequest
- type BlueprintGetRuntimeVariablesResponse
- type BlueprintImportRequest
- type BlueprintImportResponse
- type BlueprintLaunchMarketplaceRequest
- type BlueprintLaunchMarketplaceResponse
- type BlueprintLaunchRequest
- type BlueprintLaunchResponse
- type BlueprintRunRequest
- type BlueprintRunResponse
- type BlueprintService
- func (bps *BlueprintService) Export(reqdata *BlueprintExportRequest, uuid string) (*BlueprintExportResponse, *http.Response, error)
- func (bps *BlueprintService) Run(reqdata *BlueprintRunRequest, uuid string) (*BlueprintRunResponse, *http.Response, error)
- func (bps *BlueprintService) Upload(reqdata *BlueprintUploadRequest, uuid string) (*BlueprintUploadResponse, *http.Response, error)
- type BlueprintUploadRequest
- type BlueprintUploadResponse
- type Categories
- type CategoriesMapping
- type Client
- type CreationTime
- type Items
- type Kind
- type LastUpdateTime
- type Machine
- type Metadata
- type Name
- type OwnerReference
- type Port
- type ProjectReference
- type Properties
- type ProviderOperationPayload
- type Runid
- type Service
- type ServiceConfig
- type ShouldForceTranslate
- type Spec
- type SpecHash
- type SpecVersion
- type TargetDetails
- type UUID
- type UseCategoriesMapping
Constants ¶
const NUTANIX_CALM_PASS = "NUTANIX_CALM_PASS"
NUTANIX_CALM_PASS used to define calm login password via env
const NUTANIX_CALM_URL = "NUTANIX_CALM_URL"
NUTANIX_CALM_URL used to define custom calm URL endpoint
const NUTANIX_CALM_USER = "NUTANIX_CALM_USER"
NUTANIX_CALM_USER used to define calm login user via env
Variables ¶
This section is empty.
Functions ¶
func CheckConfig ¶
func CheckConfig(conf *ServiceConfig) error
CheckConfig will ensure that the minimal amount of information is present in the config
func CheckResponse ¶
CheckResponse looks for common response errors Need to fill this in at some point
func FormatCredentials ¶
func FormatCredentials(a AuthCredentials) string
FormatCredentials takes in an AuthCredential type and returns a base64 encoded string in the proper format for use by the REST API
Types ¶
type APIVersion ¶
type AdditionalProperties ¶
type AuthCredentials ¶
AuthCredentials are the username and password received from ENV variables never hard code these values into any code!
func GetCredentials ¶
func GetCredentials(conf *ServiceConfig) (AuthCredentials, error)
GetCredentials gets the username and password from the ENV variables for use in the application
type BlueprintAbortRequest ¶
type BlueprintAbortRequest struct{}
type BlueprintAbortResponse ¶
type BlueprintAbortResponse struct{}
type BlueprintCloneRequest ¶
type BlueprintCloneRequest struct{}
type BlueprintCloneResponse ¶
type BlueprintCloneResponse struct{}
type BlueprintCreateRequest ¶
type BlueprintCreateRequest struct{}
type BlueprintCreateResponse ¶
type BlueprintCreateResponse struct{}
type BlueprintDownloadRequest ¶
type BlueprintDownloadRequest struct{}
type BlueprintDownloadResponse ¶
type BlueprintDownloadResponse struct{}
type BlueprintExportRequest ¶
type BlueprintExportRequest struct{}
BlueprintExportRequest is the export request which only needs a UUID
type BlueprintExportResponse ¶
type BlueprintExportResponse struct { }
BlueprintExportResponse is the output from the export request
type BlueprintGetPendingLaunchRequest ¶
type BlueprintGetPendingLaunchRequest struct{}
type BlueprintGetPendingLaunchResponse ¶
type BlueprintGetPendingLaunchResponse struct{}
type BlueprintGetRuntimeVariablesRequest ¶
type BlueprintGetRuntimeVariablesRequest struct{}
type BlueprintGetRuntimeVariablesResponse ¶
type BlueprintGetRuntimeVariablesResponse struct{}
type BlueprintImportRequest ¶
type BlueprintImportRequest struct{}
type BlueprintImportResponse ¶
type BlueprintImportResponse struct{}
type BlueprintLaunchMarketplaceRequest ¶
type BlueprintLaunchMarketplaceRequest struct{}
type BlueprintLaunchMarketplaceResponse ¶
type BlueprintLaunchMarketplaceResponse struct{}
type BlueprintLaunchRequest ¶
type BlueprintLaunchRequest struct{}
type BlueprintLaunchResponse ¶
type BlueprintLaunchResponse struct{}
type BlueprintRunRequest ¶
type BlueprintRunRequest struct { Description string `json:"description"` Required []string `json:"required"` Type string `json:"type"` Properties struct { Spec struct { Description string `json:"description"` Type string `json:"type"` Title string `json:"title"` Properties struct { TargetDetails struct { Type string `json:"type"` Description string `json:"description"` AdditionalProperties bool `json:"additionalProperties"` } `json:"targetDetails"` Machine struct { Type string `json:"type"` Description string `json:"description"` } `json:"machine"` ProviderOperationPayload struct { Type string `json:"type"` Description string `json:"description"` } `json:"provider_operation_payload"` Attrs struct { Type string `json:"type"` Description string `json:"description"` AdditionalProperties bool `json:"additionalProperties"` } `json:"attrs"` Port struct { Type string `json:"type"` Description string `json:"description"` } `json:"port"` Runid struct { Type string `json:"type"` Description string `json:"description"` } `json:"runid"` } `json:"properties"` } `json:"spec"` APIVersion struct { Type string `json:"type"` Description string `json:"description"` } `json:"api_version"` Metadata struct { Description string `json:"description"` Required []string `json:"required"` Type string `json:"type"` Title string `json:"title"` Properties struct { LastUpdateTime struct { ReadOnly bool `json:"readOnly"` Type string `json:"type"` Description string `json:"description"` Format string `json:"format"` } `json:"last_update_time"` UseCategoriesMapping struct { Default bool `json:"default"` Type string `json:"type"` Description string `json:"description"` } `json:"use_categories_mapping"` Kind struct { Default string `json:"default"` ReadOnly bool `json:"readOnly"` Type string `json:"type"` Description string `json:"description"` XNtnxEnum []string `json:"x-ntnx-enum"` } `json:"kind"` UUID struct { Pattern string `json:"pattern"` Type string `json:"type"` Description string `json:"description"` Format string `json:"format"` } `json:"uuid"` ProjectReference struct { Description string `json:"description"` Required []string `json:"required"` Type string `json:"type"` Title string `json:"title"` Properties struct { Kind struct { Default string `json:"default"` ReadOnly bool `json:"readOnly"` Type string `json:"type"` Description string `json:"description"` XNtnxEnum []string `json:"x-ntnx-enum"` } `json:"kind"` Name struct { ReadOnly bool `json:"readOnly"` Type string `json:"type"` } `json:"name"` UUID struct { Pattern string `json:"pattern"` Type string `json:"type"` Format string `json:"format"` } `json:"uuid"` } `json:"properties"` } `json:"project_reference"` CreationTime struct { ReadOnly bool `json:"readOnly"` Type string `json:"type"` Description string `json:"description"` Format string `json:"format"` } `json:"creation_time"` SpecVersion struct { Type string `json:"type"` Description string `json:"description"` } `json:"spec_version"` SpecHash struct { Type string `json:"type"` Description string `json:"description"` } `json:"spec_hash"` CategoriesMapping struct { Type string `json:"type"` Description string `json:"description"` AdditionalProperties struct { Type string `json:"type"` Items struct { Type string `json:"type"` } `json:"items"` } `json:"additionalProperties"` } `json:"categories_mapping"` ShouldForceTranslate struct { Type string `json:"type"` Description string `json:"description"` } `json:"should_force_translate"` OwnerReference struct { Description string `json:"description"` Required []string `json:"required"` Type string `json:"type"` Title string `json:"title"` Properties struct { Kind struct { Default string `json:"default"` ReadOnly bool `json:"readOnly"` Type string `json:"type"` Description string `json:"description"` XNtnxEnum []string `json:"x-ntnx-enum"` } `json:"kind"` Name struct { ReadOnly bool `json:"readOnly"` Type string `json:"type"` } `json:"name"` UUID struct { Pattern string `json:"pattern"` Type string `json:"type"` Format string `json:"format"` } `json:"uuid"` } `json:"properties"` } `json:"owner_reference"` Categories struct { Type string `json:"type"` Description string `json:"description"` AdditionalProperties struct { Type string `json:"type"` } `json:"additionalProperties"` } `json:"categories"` Name struct { ReadOnly bool `json:"readOnly"` Type string `json:"type"` Description string `json:"description"` MaxLength int `json:"maxLength"` } `json:"name"` } `json:"properties"` } `json:"metadata"` } `json:"properties"` Title string `json:"title"` }
BlueprintRunRequest is the request used run a blueprint
type BlueprintRunResponse ¶
type BlueprintRunResponse struct { Required []string `json:"required"` Type string `json:"type"` Properties struct { Status struct { Required []string `json:"required"` Description string `json:"description"` Properties struct { TrlID struct { Type string `json:"type"` Description string `json:"description"` } `json:"trl_id"` RequestID struct { Type string `json:"type"` Description string `json:"description"` } `json:"request_id"` RunID struct { Type string `json:"type"` Description string `json:"description"` } `json:"run_id"` } `json:"properties"` } `json:"status"` Metadata struct { Description string `json:"description"` Required []string `json:"required"` Type string `json:"type"` Title string `json:"title"` Properties struct { LastUpdateTime struct { ReadOnly bool `json:"readOnly"` Type string `json:"type"` Description string `json:"description"` Format string `json:"format"` } `json:"last_update_time"` UseCategoriesMapping struct { Default bool `json:"default"` Type string `json:"type"` Description string `json:"description"` } `json:"use_categories_mapping"` Kind struct { Default string `json:"default"` ReadOnly bool `json:"readOnly"` Type string `json:"type"` Description string `json:"description"` XNtnxEnum []string `json:"x-ntnx-enum"` } `json:"kind"` UUID struct { Pattern string `json:"pattern"` Type string `json:"type"` Description string `json:"description"` Format string `json:"format"` } `json:"uuid"` ProjectReference struct { Description string `json:"description"` Required []string `json:"required"` Type string `json:"type"` Title string `json:"title"` Properties struct { Kind struct { Default string `json:"default"` ReadOnly bool `json:"readOnly"` Type string `json:"type"` Description string `json:"description"` XNtnxEnum []string `json:"x-ntnx-enum"` } `json:"kind"` Name struct { ReadOnly bool `json:"readOnly"` Type string `json:"type"` } `json:"name"` UUID struct { Pattern string `json:"pattern"` Type string `json:"type"` Format string `json:"format"` } `json:"uuid"` } `json:"properties"` } `json:"project_reference"` CreationTime struct { ReadOnly bool `json:"readOnly"` Type string `json:"type"` Description string `json:"description"` Format string `json:"format"` } `json:"creation_time"` SpecVersion struct { Type string `json:"type"` Description string `json:"description"` } `json:"spec_version"` SpecHash struct { Type string `json:"type"` Description string `json:"description"` } `json:"spec_hash"` CategoriesMapping struct { Type string `json:"type"` Description string `json:"description"` AdditionalProperties struct { Type string `json:"type"` Items struct { Type string `json:"type"` } `json:"items"` } `json:"additionalProperties"` } `json:"categories_mapping"` ShouldForceTranslate struct { Type string `json:"type"` Description string `json:"description"` } `json:"should_force_translate"` OwnerReference struct { Description string `json:"description"` Required []string `json:"required"` Type string `json:"type"` Title string `json:"title"` Properties struct { Kind struct { Default string `json:"default"` ReadOnly bool `json:"readOnly"` Type string `json:"type"` Description string `json:"description"` XNtnxEnum []string `json:"x-ntnx-enum"` } `json:"kind"` Name struct { ReadOnly bool `json:"readOnly"` Type string `json:"type"` } `json:"name"` UUID struct { Pattern string `json:"pattern"` Type string `json:"type"` Format string `json:"format"` } `json:"uuid"` } `json:"properties"` } `json:"owner_reference"` Categories struct { Type string `json:"type"` Description string `json:"description"` AdditionalProperties struct { Type string `json:"type"` } `json:"additionalProperties"` } `json:"categories"` Name struct { ReadOnly bool `json:"readOnly"` Type string `json:"type"` Description string `json:"description"` MaxLength int `json:"maxLength"` } `json:"name"` } `json:"properties"` } `json:"metadata"` } `json:"properties"` }
BlueprintRunResponse is the response from calling Run
type BlueprintService ¶
type BlueprintService Service
BlueprintService handles communication to the Calm BPs REST API endpoint
func (*BlueprintService) Export ¶
func (bps *BlueprintService) Export(reqdata *BlueprintExportRequest, uuid string) (*BlueprintExportResponse, *http.Response, error)
Export will export the identified blueprint
func (*BlueprintService) Run ¶
func (bps *BlueprintService) Run(reqdata *BlueprintRunRequest, uuid string) (*BlueprintRunResponse, *http.Response, error)
Run makes the call to cluster run
func (*BlueprintService) Upload ¶
func (bps *BlueprintService) Upload(reqdata *BlueprintUploadRequest, uuid string) (*BlueprintUploadResponse, *http.Response, error)
Upload will update the cluster defined by the UUID with the provided information
type BlueprintUploadRequest ¶
type BlueprintUploadRequest struct {
Type string `json:"type"`
}
BlueprintUploadRequest is the request to upload a blueprint
type BlueprintUploadResponse ¶
type BlueprintUploadResponse struct{}
type Categories ¶
type Categories struct { Type string `json:"type"` Description string `json:"description"` AdditionalProperties *AdditionalProperties `json:"additionalProperties"` }
type CategoriesMapping ¶
type CategoriesMapping struct { Type string `json:"type"` Description string `json:"description"` AdditionalProperties *AdditionalProperties `json:"additionalProperties"` }
type Client ¶
type Client struct { CalmURL *url.URL Login AuthCredentials Blueprints *BlueprintService // contains filtered or unexported fields }
Client is an HTTP Client
func NewClient ¶
func NewClient(httpClient *http.Client, conf *ServiceConfig) (*Client, error)
NewClient is used for Nutanix Calm client instantiation
func (*Client) Do ¶
Do sends an API request and returns the API response. The API response is JSON decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred. If v implements the io.Writer interface, the raw response body will be written to v, without attempting to first decode it. If rate limit is exceeded and reset time is in the future, Do returns *RateLimitError immediately without making a network API call.
type CreationTime ¶
type LastUpdateTime ¶
type Metadata ¶
type Metadata struct { Description string `json:"description"` Required []string `json:"required"` Type string `json:"type"` Title string `json:"title"` Properties *Properties `json:"properties"` }
type OwnerReference ¶
type OwnerReference struct { Description string `json:"description"` Required []string `json:"required"` Type string `json:"type"` Title string `json:"title"` Properties *Properties `json:"properties"` }
type ProjectReference ¶
type ProjectReference struct { Description string `json:"description"` Required []string `json:"required"` Type string `json:"type"` Title string `json:"title"` Properties *Properties `json:"properties"` }
type Properties ¶
type Properties struct { LastUpdateTime *LastUpdateTime `json:"last_update_time"` UseCategoriesMapping *UseCategoriesMapping `json:"use_categories_mapping"` Kind *Kind `json:"kind"` UUID *UUID `json:"uuid"` ProjectReference *ProjectReference `json:"project_reference"` CreationTime *CreationTime `json:"creation_time"` SpecVersion *SpecVersion `json:"spec_version"` SpecHash *SpecHash `json:"spec_hash"` CategoriesMapping *CategoriesMapping `json:"categories_mapping"` ShouldForceTranslate *ShouldForceTranslate `json:"should_force_translate"` OwnerReference *OwnerReference `json:"owner_reference"` Categories *Categories `json:"categories"` Name *Name `json:"name"` Spec *Spec `json:"spec"` APIVersion *APIVersion `json:"api_version"` Metadata *Metadata `json:"metadata"` TargetDetails *TargetDetails `json:"targetDetails"` Machine *Machine `json:"machine"` ProviderOperationPayload *ProviderOperationPayload `json:"provider_operation_payload"` Attrs *Attrs `json:"attrs"` Port *Port `json:"port"` Runid *Runid `json:"runid"` }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is used to create endpoint specific services to utilize concurrency with timeouts
type ServiceConfig ¶
ServiceConfig is the configuration to use PC
type ShouldForceTranslate ¶
type Spec ¶
type Spec struct { Description string `json:"description"` Type string `json:"type"` Title string `json:"title"` Properties *Properties `json:"properties"` }