Documentation ¶
Index ¶
- func Delete(c *golangsdk.ServiceClient, envId string) *golangsdk.ErrResult
- type CreateOpts
- type Environment
- func Create(c *golangsdk.ServiceClient, opts CreateOpts) (*Environment, error)
- func ExtractEnvironments(r pagination.Page) ([]Environment, error)
- func Get(c *golangsdk.ServiceClient, envId string) (*Environment, error)
- func List(c *golangsdk.ServiceClient, opts ListOpts) ([]Environment, error)
- func Update(c *golangsdk.ServiceClient, envId string, opts UpdateOpts) (*Environment, error)
- func UpdateResources(c *golangsdk.ServiceClient, envId string, opts ResourceOpts) (*Environment, error)
- type EnvironmentPage
- type ListOpts
- type Resource
- type ResourceOpts
- type UpdateOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CreateOpts ¶
type CreateOpts struct { // Specified the environment name with 2 to 64 characters long. // It consists of English letters, numbers, underscores (-), and underscores (_). // It must start with an English letter and end with an English letter or number. Name string `json:"name" required:"true"` // Specifies the VPC ID. VpcId string `json:"vpc_id" required:"true"` // Specified the environment alias. // The alias can contain a maximum of 96 characters. Alias string `json:"alias,omitempty"` // Specified the environment description. // The description can contain a maximum of 96 characters. Description *string `json:"description,omitempty"` // Specified the enterprise project ID. EnterpriseProjectId string `json:"enterprise_project_id,omitempty"` // Specified the billing mode. The valid values are: // provided: provided resources are used and no fees are charged. // on_demanded: on-demand charging. // monthly: monthly subscription. ChargeMode string `json:"charge_mode,omitempty"` // Specifies the basic resources. BaseResources []Resource `json:"base_resources,omitempty"` // Specifies the optional resources. OptionalResources []Resource `json:"optional_resources,omitempty"` }
UpdateOpts is the structure required by the Create method to create a new environment.
type Environment ¶
type Environment struct { // The environment ID. ID string `json:"id"` // The environment name. Name string `json:"name"` // The environment alias Alias string `json:"alias"` // The environment description. Description string `json:"description"` // The project ID. ProjectId string `json:"project_id"` // The enterprise project ID. EnterpriseProjectId string `json:"enterprise_project_id"` // The charging mode. ChargeMode string `json:"charge_mode"` // The VPC ID. VpcId string `json:"vpc_id"` // The basic resources. BaseResources []Resource `json:"base_resources"` // The optional resources. OptionalResources []Resource `json:"optional_resources"` // The Creator. Creator string `json:"creator"` // The creation time. CreatedAt int `json:"create_time"` // The update time. UpdatedAt int `json:"update_time"` }
Environment is the structure that represents the detail of the ServiceStage environment.
func Create ¶
func Create(c *golangsdk.ServiceClient, opts CreateOpts) (*Environment, error)
Create is a method to create a new ServiceStage environment using create option. Environment is a collection of infrestructures, covering computing, storage and networks, used for application deployment and running.
func ExtractEnvironments ¶
func ExtractEnvironments(r pagination.Page) ([]Environment, error)
ExtractEnvironments is a method to extract the list of environment details for ServiceStage service.
func Get ¶
func Get(c *golangsdk.ServiceClient, envId string) (*Environment, error)
Get is a method to obtain the details of a specified ServiceStage environment using its ID.
func List ¶
func List(c *golangsdk.ServiceClient, opts ListOpts) ([]Environment, error)
List is a method to query the list of the environments using given opts.
func Update ¶
func Update(c *golangsdk.ServiceClient, envId string, opts UpdateOpts) (*Environment, error)
Update is a method to update the current dependency configuration.
func UpdateResources ¶
func UpdateResources(c *golangsdk.ServiceClient, envId string, opts ResourceOpts) (*Environment, error)
UpdateResources is a method to add or remove the basic resources and the optional resources.
type EnvironmentPage ¶
type EnvironmentPage struct {
pagination.OffsetPageBase
}
EnvironmentPage is a single page maximum result representing a query by offset page.
type ListOpts ¶
type ListOpts struct { // Number of records to be queried. // Value range: 0–100. // Default value: 1000, indicating that a maximum of 1000 records can be queried and all records are displayed on // the same page. Limit int `q:"limit"` // The offset number. Offset int `q:"offset"` // Sorting field. By default, query results are sorted by creation time. // The following enumerated values are supported: create_time, name, and update_time. OrderBy string `q:"order_by"` // Descending or ascending order. Default value: desc. Order string `q:"order"` }
ListOpts allows to filter list data using given parameters.
type Resource ¶
type Resource struct { // Specified the resource ID. ID string `json:"id" required:"true"` // Specified the resource type. the valid values are: CCE, CCI, ECS and AS. Type string `json:"type" required:"true"` // Specified the resource name. Name string `json:"name,omitempty"` }
Resource is an object specifying the basic or optional resource.
type ResourceOpts ¶
type ResourceOpts struct { // Basic resources to be added. AddBaseResources []Resource `json:"add_base_resources,omitempty"` // Other resources to be added. AddOptionalResources []Resource `json:"add_optional_resources,omitempty"` // Resources to be removed. RemoveResources []Resource `json:"remove_resources,omitempty"` }
ResourceOpts is a structure required bu the UpdateResources method to bind or unbind the resources.
type UpdateOpts ¶
type UpdateOpts struct { // Specified the environment description. // The description can contain a maximum of 96 characters. Description *string `json:"description,omitempty"` // Specified the environment name with 2 to 64 characters long. // It consists of English letters, numbers, underscores (-), and underscores (_). // It must start with an English letter and end with an English letter or number. Name string `json:"name,omitempty"` // Specified the environment alias. // The alias can contain a maximum of 96 characters. Alias string `json:"alias,omitempty"` }
UpdateOpts is the structure required by the Update method to update the configuration of the specified environment.