softwaredeployment

package
v0.5.11 Latest Latest
Warning

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

Go to latest
Published: May 18, 2022 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Overview

Package softwaredeployment enables management and retrieval of Software Deployments

Example to List Software Deployments

listOpts := softwaredeployment.ListOpts{}
allDeployments, err := softwaredeployment.List(client,listOpts)
if err != nil {
	panic(err)
}

for _, deployment := range allDeployments {
	fmt.Printf("%+v\n", allDeployments)
}

Example to Get Software Deployment

	deploymentID:="bd7d48a5-6e33-4b95-aa28-d0d3af46c635"

 	deployments,err:=softwaredeployment.Get(client,deploymentID).Extract()

	if err != nil {
		panic(err)
	}

Example to Create a Software Deployments

input:=map[string]interface{}{"name":"foo"}

createOpts := softwaredeployment.CreateOpts{
	Status:"IN_PROGRESS",
	ServerId:"f274ac7d-334d-41ff-83bd-1de669f7781b",
	ConfigId:"a6ff3598-f2e0-4111-81b0-aa3e1cac2529",
	InputValues:input,
	TenantId:"17fbda95add24720a4038ba4b1c705ed",
	Action:"CREATE"
}

deployment, err := softwaredeployment.Create(client, createOpts).Extract()
if err != nil {
	panic(err)
}

Example to Update a Software Deployments

deploymentID:="bd7d48a5-6e33-4b95-aa28-d0d3af46c635"

ouput:=map[string]interface{}{"deploy_stdout":"Writing to /tmp/baaaaa\nWritten to /tmp/baaaaa\n","deploy_stderr":"+ echo Writing to /tmp/baaaaa\n+ echo fooooo\n+ cat /tmp/baaaaa\n+ echo -n The file /tmp/baaaaa contains fooooo for server ec14c864-096e-4e27-bb8a-2c2b4dc6f3f5 during CREATE\n+ echo Written to /tmp/baaaaa\n+ echo Output to stderr\nOutput to stderr\n",
	"deploy_status_code":0,"result":"The file /tmp/baaaaa contains fooooo for server ec14c864-096e-4e27-bb8a-2c2b4dc6f3f5 during CREATE"}

updateOpts := softwaredeployment.UpdateOpts{
Status:"COMPLETE",
ConfigId:"a6ff3598-f2e0-4111-81b0-aa3e1cac2529",
OutputValues:ouput,
StatusReason:"Outputs received"}

deployment, err := softwaredeployment.Update(client, deploymentID, updateOpts).Extract()
if err != nil {
	panic(err)
}

Example to Delete a Software Deployments

deploymentID:="bd7d48a5-6e33-4b95-aa28-d0d3af46c635"
del:=softwaredeployment.Delete(client,deploymentID).ExtractErr()
if err != nil {
	panic(err)
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateOpts

type CreateOpts struct {
	// Specifies the stack action that triggers this deployment resource.
	Action string `json:"action,omitempty"`
	// Specifies the ID of the software configuration resource running on an instance.
	ConfigId string `json:"config_id" required:"true"`
	// Specifies input data stored in the form of a key-value pair.
	InputValues map[string]interface{} `json:"input_values,omitempty"`
	// Specifies the ID of the instance deployed by the software configuration.
	ServerId string `json:"server_id" required:"true"`
	// Specifies the ID of the authenticated tenant who can perform operations on the deployment resources.
	TenantId string `json:"stack_user_project_id,omitempty"`
	// Specifies the current status of deployment resources. Valid values include COMPLETE, IN_PROGRESS, and FAILED.
	Status string `json:"status,omitempty"`
	// Specifies the cause of the current deployment resource status.
	StatusReason string `json:"status_reason,omitempty"`
}

CreateOpts contains all the values needed to create a new Software Deployment. There are no required values.

func (CreateOpts) ToSoftwareDeploymentCreateMap

func (opts CreateOpts) ToSoftwareDeploymentCreateMap() (map[string]interface{}, error)

ToSoftwareDeploymentCreateMap builds a create request body from CreateOpts.

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToSoftwareDeploymentCreateMap() (map[string]interface{}, error)
}

CreateOptsBuilder allows extensions to add additional parameters to the Create request.

type CreateResult

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

CreateResult represents the result of a create operation. Call its Extract method to interpret it as a Software Deployments.

func Create

func Create(c *golangsdk.ServiceClient, opts CreateOptsBuilder) (r CreateResult)

Create accepts a CreateOpts struct and uses the values to create a new Software Deployment

func (CreateResult) Extract

func (r CreateResult) Extract() (*Deployment, error)

Extract is a function that accepts a result and extracts a Software Deployments.

type DeleteResult

type DeleteResult struct {
	golangsdk.ErrResult
}

DeleteResult represents the result of a delete operation. Call its ExtractErr method to determine if the request succeeded or failed.

func Delete

func Delete(c *golangsdk.ServiceClient, id string) (r DeleteResult)

Delete will permanently delete a particular Software Deployment based on its unique ID.

type Deployment

type Deployment struct {
	// Specifies the stack action that triggers this deployment resource.
	Action string `json:"action"`
	// Specifies the ID of the software Deployments resource running on an instance.
	ConfigId string `json:"config_id"`
	// Specifies the creation time. The timestamp format is ISO 8601: CCYY-MM-DDThh:mm:ss±hh:mm
	CreationTime golangsdk.JSONRFC3339NoZ `json:"creation_time"`
	// Specifies the ID of this deployment resource.
	Id string `json:"id"`
	// Specifies input data stored in the form of a key-value pair.
	InputValues map[string]interface{} `json:"input_values"`
	// Specifies output data stored in the form of a key-value pair.
	OutputValues map[string]interface{} `json:"output_values"`
	// Specifies the ID of the instance deployed by the software Deployments.
	ServerId string `json:"server_id"`
	// Specifies the current status of deployment resources. Valid values include COMPLETE, IN_PROGRESS, and FAILED.
	Status string `json:"status"`
	// Specifies the cause of the current deployment resource status.
	StatusReason string `json:"status_reason"`
	// Specifies the updated time. The timestamp format is ISO 8601: CCYY-MM-DDThh:mm:ss±hh:mm
	UpdatedTime golangsdk.JSONRFC3339NoZ `json:"updated_time"`
}

func ExtractDeployments

func ExtractDeployments(r pagination.Page) ([]Deployment, error)

ExtractDeployments accepts a Page struct, specifically a DeploymentPage struct, and extracts the elements into a slice of Software Deployments structs. In other words, a generic collection is mapped into a relevant slice.

func FilterDeployments

func FilterDeployments(deployments []Deployment, opts ListOpts) ([]Deployment, error)

func List

func List(client *golangsdk.ServiceClient, opts ListOpts) ([]Deployment, error)

List returns collection of Software Deployment. It accepts a ListOpts struct, which allows you to filter and sort the returned collection for greater efficiency.

Default policy settings return only those Software Deployment that are owned by the tenant who submits the request, unless an admin user submits the request.

type DeploymentPage

type DeploymentPage struct {
	pagination.LinkedPageBase
}

DeploymentPage is the page returned by a pager when traversing over a collection of Software Deployments.

func (DeploymentPage) IsEmpty

func (r DeploymentPage) IsEmpty() (bool, error)

IsEmpty checks whether a DeploymentPage struct is empty.

func (DeploymentPage) NextPageURL

func (r DeploymentPage) NextPageURL() (string, error)

NextPageURL is invoked when a paginated collection of Software Deployments has reached the end of a page and the pager seeks to traverse over a new one. In order to do this, it needs to construct the next page's URL.

type GetResult

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

GetResult represents the result of a get operation. Call its Extract method to interpret it as a Software Deployments.

func Get

func Get(c *golangsdk.ServiceClient, id string) (r GetResult)

Get retrieves a particular software Deployment based on its unique ID.

func (GetResult) Extract

func (r GetResult) Extract() (*Deployment, error)

Extract is a function that accepts a result and extracts a Software Deployments.

type ListOpts

type ListOpts struct {
	// Specifies the ID of the instance deployed by the software configuration.
	ServerId string `q:"server_id"`
	// Specifies the ID of this deployment resource.
	Id string
	// Specifies the ID of the software configuration resource running on an instance.
	ConfigId string
	// Specifies the current status of deployment resources. Valid values include COMPLETE, IN_PROGRESS, and FAILED.
	Status string
	// Specifies the stack action that triggers this deployment resource.
	Action string
}

ListOpts allows the filtering and sorting of paginated collections through the API.

type UpdateOpts

type UpdateOpts struct {
	// Specifies the stack action that triggers this deployment resource.
	Action string `json:"action,omitempty"`
	// Specifies the ID of the software configuration resource running on an instance.
	ConfigId string `json:"config_id" required:"true"`
	// Specifies input data stored in the form of a key-value pair.
	InputValues map[string]interface{} `json:"input_values,omitempty"`
	// Specifies output data stored in the form of a key-value pair.
	OutputValues map[string]interface{} `json:"output_values" required:"true"`
	// Specifies the current status of deployment resources. Valid values include COMPLETE, IN_PROGRESS, and FAILED.
	Status string `json:"status,omitempty"`
	// Specifies the cause of the current deployment resource status.
	StatusReason string `json:"status_reason,omitempty"`
}

UpdateOpts is a struct which represents the request body of update method.

func (UpdateOpts) ToSoftwareDeploymentUpdateMap

func (opts UpdateOpts) ToSoftwareDeploymentUpdateMap() (map[string]interface{}, error)

ToSoftwareDeploymentUpdateMap builds a update request body from UpdateOpts.

type UpdateOptsBuilder

type UpdateOptsBuilder interface {
	ToSoftwareDeploymentUpdateMap() (map[string]interface{}, error)
}

UpdateOptsBuilder is an interface by which can be able to build the request body of software deployment.

type UpdateResult

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

UpdateResult represents the result of an update operation. Call its Extract method to interpret it as a Software Deployments.

func Update

func Update(client *golangsdk.ServiceClient, id string, opts UpdateOptsBuilder) (r UpdateResult)

Update is a method which can be able to update the name of software deployment.

func (UpdateResult) Extract

func (r UpdateResult) Extract() (*Deployment, error)

Extract is a function that accepts a result and extracts a Software Deployments.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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