Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var RequestOpts golangsdk.RequestOpts = golangsdk.RequestOpts{ MoreHeaders: map[string]string{"Content-Type": "application/json"}, }
Functions ¶
This section is empty.
Types ¶
type CreateMetaData ¶
type CreateMetaData struct {
//Network unique name
Name string `json:"name" required:"true"`
//Network annotation, key/value pair format
Annotations map[string]string `json:"annotations" required:"true"`
}
Metadata required to create a network
type CreateOpts ¶
type CreateOpts struct {
// API type, fixed value Network
Kind string `json:"kind" required:"true"`
// API version, fixed value networking.cci.io
ApiVersion string `json:"apiVersion" required:"true"`
// Metadata required to create a network
Metadata CreateMetaData `json:"metadata" required:"true"`
// Specifications to create a network
Spec Spec `json:"spec" required:"true"`
}
CreateOpts contains all the values needed to create a new network
func (CreateOpts) ToNetworkCreateMap ¶
func (opts CreateOpts) ToNetworkCreateMap() (map[string]interface{}, error)
ToNetworkCreateMap builds a create request body from CreateOpts.
type CreateOptsBuilder ¶
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 Network.
func Create ¶
func Create(c *golangsdk.ServiceClient, ns string, opts CreateOptsBuilder) (r CreateResult)
Create accepts a CreateOpts struct and uses the values to create a new network.
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, ns, id string) (r DeleteResult)
Delete will permanently delete a particular network 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 Network.
type MetaData ¶
type MetaData struct {
//Network unique name
Name string `json:"name"`
//Network unique Id
Id string `json:"uid"`
//Network annotation, key/value pair format
Annotations map[string]string `json:"annotations"`
}
Metadata required to create a network
type Network ¶
type Network struct {
//API type, fixed value Network
Kind string `json:"kind"`
//API version, fixed value networking.cci.io
ApiVersion string `json:"apiVersion"`
//Metadata of a Network
Metadata MetaData `json:"metadata"`
//Specifications of a Network
Spec Spec `json:"spec"`
//Status of a Network
Status Status `json:"status"`
}
type Spec ¶
type Spec struct {
// Network CIDR
Cidr string `json:"type,omitempty"`
// Network VPC ID
AttachedVPC string `json:"attachedVPC" required:"true"`
// Network Type
NetworkType string `json:"networkType" required:"true"`
// Network ID
NetworkID string `json:"networkID" required:"true"`
// Subnet ID
SubnetID string `json:"subnetID" required:"true"`
// Network AZ
AvailableZone string `json:"availableZone" required:"true"`
}
Specifications to create a network