softwareconfig

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Overview

Package softwareconfig enables management and retrieval of Software Configs

Example to List Software Configs

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

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

Example to Get Software Deployment

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

 	configs,err:=softwareconfig.Get(client,configID).Extract()

	if err != nil {
		panic(err)
	}

Example to Create a Software Configs

createOpts := softwareconfig.CreateOpts{
	Name:         "config_test",
}

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

Example to Delete a Software Configs

configID := "8de48948-b6d6-4417-82a5-071f7811af91"
del:=softwareconfig.Delete(client,configID).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 script used for defining the configuration.
	Config string `json:"config,omitempty"`
	// Specifies the name of the software configuration group.
	Group string `json:"group,omitempty"`
	// Specifies the name of the software configuration.
	Name string `json:"name" required:"true"`
	// Specifies the software configuration input.
	Inputs []map[string]interface{} `json:"inputs,omitempty"`
	// Specifies the software configuration output.
	Outputs []map[string]interface{} `json:"outputs,omitempty"`
	// Specifies options used by a software configuration management tool.
	Options map[string]interface{} `json:"options,omitempty"`
}

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

func (CreateOpts) ToSoftwareConfigCreateMap

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

ToSoftwareConfigCreateMap builds a create request body from CreateOpts.

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToSoftwareConfigCreateMap() (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 configuration.

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 config

func (CreateResult) Extract

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

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

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 Config based on its unique ID.

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 configuration.

func Get

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

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

func (GetResult) Extract

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

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

type ListOpts

type ListOpts struct {
	Id     string
	Name   string
	Marker string `q:"marker"`
	Limit  int    `q:"limit"`
}

ListOpts allows the filtering and sorting of paginated collections through the API. Filtering is achieved by passing in struct field values that map to the software config attributes you want to see returned. Marker and Limit are used for pagination.

type SoftwareConfig

type SoftwareConfig struct {
	// Specifies the software configuration input.
	Inputs []map[string]interface{} `json:"inputs"`
	// Specifies the name of the software configuration.
	Name string `json:"name"`
	// Specifies the software configuration output.
	Outputs []map[string]interface{} `json:"outputs"`
	// Specifies the time when a configuration is created.
	CreationTime golangsdk.JSONRFC3339NoZ `json:"creation_time"`
	// Specifies the name of the software configuration group.
	Group string `json:"group"`
	// Specifies the configuration code.
	Config string `json:"config"`
	// Specifies configuration options.
	Options map[string]interface{} `json:"options"`
	// Specifies the software configuration ID.
	Id string `json:"id"`
}

func ExtractSoftwareConfigs

func ExtractSoftwareConfigs(r pagination.Page) ([]SoftwareConfig, error)

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

func FilterSoftwareConfig

func FilterSoftwareConfig(config []SoftwareConfig, opts ListOpts) ([]SoftwareConfig, error)

func List

func List(c *golangsdk.ServiceClient, opts ListOpts) ([]SoftwareConfig, error)

List returns collection of Software Config. 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 Config that are owned by the tenant who submits the request, unless an admin user submits the request.

type SoftwareConfigPage

type SoftwareConfigPage struct {
	pagination.LinkedPageBase
}

SoftwareConfigPage is the page returned by a pager when traversing over a collection of Software Configurations.

func (SoftwareConfigPage) IsEmpty

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

IsEmpty checks whether a SoftwareConfigPage struct is empty.

func (SoftwareConfigPage) NextPageURL

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

NextPageURL is invoked when a paginated collection of Software Configs 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 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 configuration.

func (UpdateResult) Extract

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

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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