Documentation ¶
Overview ¶
Package tenant_connection_requests manages and retrieves Tenant Connection Request in the Enterprise Cloud Provider Connectivity Service.
Example to List Tenant Connection Request
allPages, err := tenant_connection_requests.List(tcrClient).AllPages() if err != nil { panic(err) } allTenantConnectionRequests, err := tenant_connection_requests.ExtractTenantConnectionRequests(allPages) if err != nil { panic(err) } for _, tenantConnectionRequest := range allTenantConnectionRequests { fmt.Printf("%+v\n", tenantConnectionRequest) }
Example to Get a Tenant Connection Request
tenant_connection_request_id := "85a1dc30-2e48-11ea-9e55-525403060300" tenantConnectionRequest, err := tenant_connection_requests.Get(tcrClient, tenant_connection_request_id).Extract() if err != nil { panic(err) } fmt.Printf("%+v\n", tenantConnectionRequest)
Example to Create a Tenant Connection Request
createOpts := tenant_connection_requests.CreateOpts{ TenantIDOther: "7e91b19b9baa423793ee74a8e1ff2be1", NetworkID: "c4d5fc41-b7e8-4f19-96f4-85299e54373c", Name: "create_test_name", Description: "create_test_desc", Tags: map[string]string{"foo", "bar"}, } result := tenant_connection_requests.Create(tcrClient, createOpts) if result.Err != nil { panic(result.Err) }
Example to Update a Tenant Connection Request
tenant_connection_request_id := "85a1dc30-2e48-11ea-9e55-525403060300" updateOpts := tenant_connection_requests.UpdateOpts{ Name: "update_test_name", Description: "update_test_desc", Tags: map[string]string{ "keyword1": "value1", "keyword2": "value2", }, NameOther: "update_test_name_other", DescriptionOther: "update_test_desc_other", TagsOther: map[string]string{ "keyword1": "value1", "keyword2": "value2", }, } result := tenant_connection_requests.Update(tcrClient, tenant_connection_request_id, updateOpts) if result.Err != nil { panic(result.Err) }
Example to Delete a Tenant Connection Request
tenant_connection_request_id := "85a1dc30-2e48-11ea-9e55-525403060300" result := tenant_connection_requests.Delete(tcrClient, tenant_connection_request_id) if result.Err != nil { panic(result.Err) }
Index ¶
- func List(client *eclcloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
- type CreateOpts
- type CreateOptsBuilder
- type CreateResult
- type DeleteResult
- type GetResult
- type ListOpts
- type ListOptsBuilder
- type TenantConnectionRequest
- type TenantConnectionRequestPage
- type UpdateOpts
- type UpdateOptsBuilder
- type UpdateResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func List ¶
func List(client *eclcloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
List retrieves a list of Tenant Connection Requests.
Types ¶
type CreateOpts ¶
type CreateOpts struct { TenantIDOther string `json:"tenant_id_other" required:"true"` NetworkID string `json:"network_id" required:"true"` Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Tags map[string]string `json:"tags,omitempty"` }
CreateOpts provides options used to create a Tenant Connection Request.
func (CreateOpts) ToTenantConnectionRequestCreateMap ¶
func (opts CreateOpts) ToTenantConnectionRequestCreateMap() (map[string]interface{}, error)
ToTenantConnectionRequestCreateMap formats a CreateOpts into a create request.
type CreateOptsBuilder ¶
type CreateOptsBuilder interface {
ToTenantConnectionRequestCreateMap() (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 is the response from a Create operation. Call its Extract method to interpret it as a Tenant Connection Request.
func Create ¶
func Create(client *eclcloud.ServiceClient, opts CreateOptsBuilder) (r CreateResult)
Create creates a new Tenant Connection Request.
func (CreateResult) Extract ¶
func (r CreateResult) Extract() (*TenantConnectionRequest, error)
Extract interprets any commonResult as a Tenant Connection Request.
type DeleteResult ¶
DeleteResult is the response from a Delete operation. Call its ExtractErr to determine if the request succeeded or failed.
func Delete ¶
func Delete(client *eclcloud.ServiceClient, id string) (r DeleteResult)
Delete deletes a Tenant Connection Request.
type GetResult ¶
type GetResult struct {
// contains filtered or unexported fields
}
GetResult is the response from a Get operation. Call its Extract method to interpret it as a Tenant Connection Request.
func Get ¶
func Get(client *eclcloud.ServiceClient, id string) (r GetResult)
Get retrieves details of an Tenant Connection Request.
func (GetResult) Extract ¶
func (r GetResult) Extract() (*TenantConnectionRequest, error)
Extract interprets any commonResult as a Tenant Connection Request.
type ListOpts ¶
type ListOpts struct { TenantConnectionRequestID string `q:"tenant_connection_request_id"` Status string `q:"status"` Name string `q:"name"` TenantID string `q:"tenant_id"` NameOther string `q:"name_other"` TenantIDOther string `q:"tenant_id_other"` NetworkID string `q:"network_id"` ApprovalRequestID string `q:"approval_request_id"` }
ListOpts provides options to filter the List results.
func (ListOpts) ToTenantConnectionRequestListQuery ¶
ToTenantConnectionRequestListQuery formats a ListOpts into a query string.
type ListOptsBuilder ¶
ListOptsBuilder allows extensions to add additional parameters to the List request
type TenantConnectionRequest ¶
type TenantConnectionRequest struct { ID string `json:"id"` Status string `json:"status"` Name string `json:"name"` Description string `json:"description"` Tags map[string]string `json:"tags"` TenantID string `json:"tenant_id"` NameOther string `json:"name_other"` DescriptionOther string `json:"description_other"` TagsOther map[string]string `json:"tags_other"` TenantIDOther string `json:"tenant_id_other"` NetworkID string `json:"network_id"` ApprovalRequestID string `json:"approval_request_id"` }
TenantConnectionRequest represents Tenant Connection Request.
func ExtractTenantConnectionRequests ¶
func ExtractTenantConnectionRequests(r pagination.Page) ([]TenantConnectionRequest, error)
ExtractTenantConnectionRequests returns a slice of Tenant Connection Requests contained in a single page of results.
type TenantConnectionRequestPage ¶
type TenantConnectionRequestPage struct {
pagination.LinkedPageBase
}
TenantConnectionRequestPage is a single page of Tenant Connection Request results.
func (TenantConnectionRequestPage) IsEmpty ¶
func (r TenantConnectionRequestPage) IsEmpty() (bool, error)
IsEmpty determines whether or not a page of Tenant Connection Request contains any results.
type UpdateOpts ¶
type UpdateOpts struct { Name *string `json:"name,omitempty"` Description *string `json:"description,omitempty"` Tags *map[string]string `json:"tags,omitempty"` NameOther *string `json:"name_other,omitempty"` DescriptionOther *string `json:"description_other,omitempty"` TagsOther *map[string]string `json:"tags_other,omitempty"` }
UpdateOpts represents parameters to update a Tenant Connection Request.
func (UpdateOpts) ToTenantConnectionRequestUpdateMap ¶
func (opts UpdateOpts) ToTenantConnectionRequestUpdateMap() (map[string]interface{}, error)
ToResourceUpdateCreateMap formats a UpdateOpts into an update request.
type UpdateOptsBuilder ¶
type UpdateOptsBuilder interface {
ToTenantConnectionRequestUpdateMap() (map[string]interface{}, error)
}
UpdateOptsBuilder allows extensions to add additional parameters to the Update request.
type UpdateResult ¶
type UpdateResult struct {
// contains filtered or unexported fields
}
UpdateResult is the result of an Update request. Call its Extract method to interpret it as a Tenant Connection Request.
func Update ¶
func Update(client *eclcloud.ServiceClient, id string, opts UpdateOptsBuilder) (r UpdateResult)
Update modifies the attributes of a Tenant Connection Request.
func (UpdateResult) Extract ¶
func (r UpdateResult) Extract() (*TenantConnectionRequest, error)
Extract interprets any commonResult as a Tenant Connection Request.