Documentation ¶
Overview ¶
*Copyright 2015 Huawei Technologies Co., Ltd. All rights reserved. * eSDK is licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
*Copyright 2015 Huawei Technologies Co., Ltd. All rights reserved. * eSDK is licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
*Copyright 2015 Huawei Technologies Co., Ltd. All rights reserved. * eSDK is licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
*Copyright 2015 Huawei Technologies Co., Ltd. All rights reserved. * eSDK is licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
*Copyright 2015 Huawei Technologies Co., Ltd. All rights reserved. * eSDK is licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
*Copyright 2015 Huawei Technologies Co., Ltd. All rights reserved. * eSDK is licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
Index ¶
- func GetToken(username, password, tenant_id string, ...) string
- type AuthStruct
- type AuthStructInfo
- type Client
- func (client *Client) CreateCloudServer(createCloudServerReq ecsModules.CreateCloudServerReq) ecsModules.CreateCloudServerResp
- func (client *Client) CreateKeypair(createKeypairReq novaModules.CreateKeypairReq) novaModules.CreateKeypairResp
- func (client *Client) CreatePublicIp(createPublicipReq *vpcModules.CreatePublicIpReq) *vpcModules.CreatePublicIpResp
- func (client *Client) CreateSecurityGroup(createSecurityGroupReq *vpcModules.CreateSecurityGroupReq) *vpcModules.CreateSecurityGroupResp
- func (client *Client) CreateSecurityGroupRule(createSecurityGroupRuleReq *neutronModules.CreateSecurityGroupRuleReq) *neutronModules.CreateSecurityGroupRuleResp
- func (client *Client) CreateSubnet(createSubnetReq *vpcModules.CreateSubnetReq) *vpcModules.CreateSubnetResp
- func (client *Client) CreateVpc(createVpcReq vpcModules.CreateVpcReq) *vpcModules.CreateVpcResp
- func (client *Client) DeleteAnServer(server_id string) novaModules.DeleteAnServerResp
- func (client *Client) DeleteCloudServer(deleteCloudServerReq ecsModules.DeleteCloudServerReq) ecsModules.DeleteCloudServerResp
- func (client *Client) DeleteKeyPair(keypair_name string) novaModules.DeleteKeyPairResp
- func (client *Client) DeletePublicIp(publicip_id string) *vpcModules.DeletePublicIpResp
- func (client *Client) DeleteSecurityGroupRule(rules_security_groups_id string) *neutronModules.DeleteSecurityGroupRuleResp
- func (client *Client) DeleteSubnet(vpc_id, subnet_id string) *vpcModules.DeleteSubnetResp
- func (client *Client) DeleteVpc(vpc_id string) *vpcModules.DeleteVpcResp
- func (client *Client) ListBandwidths(limit int, marker string) *vpcModules.ListBandwidthsResp
- func (client *Client) ListCloudImages(listCloudImagesReqEx *imsModules.ListCloudImagesReqEx) *imsModules.ListCloudImagesResp
- func (client *Client) ListCloudServerFlavorsExt() ecsModules.ListCloudServerFlavorsExtResp
- func (client *Client) ListInterfaces(server_id string) novaModules.ListInterfacesResp
- func (client *Client) ListSecurityGroups(limit int, marker, vpc_id string) *vpcModules.ListSecurityGroupsResp
- func (client *Client) ListSubnets(limit int, marker, vpc_id string) *vpcModules.ListSubnetsResp
- func (client *Client) RebootServer(server_id, rebootType string) novaModules.RebootServerResp
- func (client *Client) ShowEcsJob(job_id string) ecsModules.ShowEcsJobResp
- func (client *Client) ShowSecurityGroupRule(rules_security_groups_id string) *neutronModules.ShowSecurityGroupRuleResp
- func (client *Client) ShowServer(server_id string) novaModules.ShowServerResp
- func (client *Client) ShowSubnet(subnet_id string) *vpcModules.ShowSubnetResp
- func (client *Client) ShowVpc(vpc_id string) *vpcModules.ShowVpcResp
- func (client *Client) StartServer(server_id string) novaModules.StartServerResp
- func (client *Client) StopServer(server_id string) novaModules.StopServerResp
- func (client *Client) UpdateBandwidth(bandwidth_id string, updateBandwidthReq *vpcModules.UpdateBandwidthReq) *vpcModules.UpdateBandwidthResp
- func (client *Client) UpdatePublicIp(publicip_id string, updatePublicIpReq *vpcModules.UpdatePublicIpReq) *vpcModules.UpdatePublicIpResp
- type DomainStruct
- type Domin
- type IdentityStruct
- type PasswordStruct
- type Project
- type ProjectStruct
- type Role
- type ScopeStruct
- type Token
- type TokenInfo
- type User
- type UserStruct
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthStruct ¶
type AuthStruct struct { Identity IdentityStruct `json:"identity"` Scope ScopeStruct `json:"scope"` }
Authration information
type AuthStructInfo ¶
type AuthStructInfo struct {
AuthStruct AuthStruct `json:"auth"`
}
Authration structure
type Client ¶
type Client struct { TenantID string // Tenant ID RequestParam *modules.RequestParam // Request parameters }
The client
func InitTokenClient ¶
func InitTokenClient(Token, TenantID string, clientConfiguration modules.ClientConfiguration) (client *Client)
* @fn func InitClient(AK, SK, TenantID, Endpoint string) (client *Client) * @brief Initialize the client * @param[in] Token: Token value * @param[in] TenantID: The tenant ID * @param[in] Endpoint: Server address * @param[out] * @return client
func InitV4Client ¶
func InitV4Client(AK, SK, TenantID string, clientConfiguration modules.ClientConfiguration) (client *Client)
* @fn func InitClient(AK, SK, TenantID, Endpoint string) (client *Client) * @brief Initialize the client * @param[in] AK: The Access Key * @param[in] SK: The Secret Key * @param[in] TenantID: The tenant ID * @param[in] Endpoint: Server address * @param[out] * @return client
func (*Client) CreateCloudServer ¶
func (client *Client) CreateCloudServer(createCloudServerReq ecsModules.CreateCloudServerReq) ecsModules.CreateCloudServerResp
func (*Client) CreateKeypair ¶
func (client *Client) CreateKeypair(createKeypairReq novaModules.CreateKeypairReq) novaModules.CreateKeypairResp
func (*Client) CreatePublicIp ¶
func (client *Client) CreatePublicIp(createPublicipReq *vpcModules.CreatePublicIpReq) *vpcModules.CreatePublicIpResp
- @fn func (client *Client) CreatePublicIp(createPublicipReq *vpcModules.CreatePublicIpReq) *vpcModules.CreatePublicIpResp
- @brief This interface is used to apply for an elastic IP address.
- @param[in] createPublicipReq: Body parameters
- @param[out]
- @return *vpcModules.CreatePublicIpResp
func (*Client) CreateSecurityGroup ¶
func (client *Client) CreateSecurityGroup(createSecurityGroupReq *vpcModules.CreateSecurityGroupReq) *vpcModules.CreateSecurityGroupResp
- @fn func (client *Client) CreateSecurityGroup(createSecurityGroupReq *vpcModules.CreateSecurityGroupReq) *vpcModules.CreateSecurityGroupResp
- @brief This interface is used to create a security group.
- @param[in] createSecurityGroupReq: Body parameters
- @param[out]
- @return *vpcModules.CreateSecurityGroupResp
func (*Client) CreateSecurityGroupRule ¶
func (client *Client) CreateSecurityGroupRule(createSecurityGroupRuleReq *neutronModules.CreateSecurityGroupRuleReq) *neutronModules.CreateSecurityGroupRuleResp
- @fn func (client *Client) CreateSecurityGroupRule(createSecurityGroupRuleReq *neutronModules.CreateSecurityGroupRuleReq) *neutronModules.CreateSecurityGroupRuleResp
- @brief This interface is used to create a security group rule.
- @param[in] createSecurityGroupRuleReq: URI parameters
- @param[out]
- @return *neutronModules.CreateSecurityGroupRuleResp
func (*Client) CreateSubnet ¶
func (client *Client) CreateSubnet(createSubnetReq *vpcModules.CreateSubnetReq) *vpcModules.CreateSubnetResp
- @fn func (client *Client) CreateSubnet(createSubnetReq *vpcModules.CreateSubnetReq) *vpcModules.CreateSubnetResp
- @brief This interface is used to create a subnet.
- @param[in] createSubnetReq: URI parameters
- @param[out]
- @return *vpcModules.CreateSubnetResp
func (*Client) CreateVpc ¶
func (client *Client) CreateVpc(createVpcReq vpcModules.CreateVpcReq) *vpcModules.CreateVpcResp
* @fn func (client *Client) CreateVpc(createVpcReq vpcModules.CreateVpcReq) *vpcModules.CreateVpcResp * @brief This interface is used to create a VPC. * @param[in] createVpcReq: Body parameters * @param[out] * @return *vpcModules.CreateVpcResp
func (*Client) DeleteAnServer ¶
func (client *Client) DeleteAnServer(server_id string) novaModules.DeleteAnServerResp
func (*Client) DeleteCloudServer ¶
func (client *Client) DeleteCloudServer(deleteCloudServerReq ecsModules.DeleteCloudServerReq) ecsModules.DeleteCloudServerResp
func (*Client) DeleteKeyPair ¶
func (client *Client) DeleteKeyPair(keypair_name string) novaModules.DeleteKeyPairResp
func (*Client) DeletePublicIp ¶
func (client *Client) DeletePublicIp(publicip_id string) *vpcModules.DeletePublicIpResp
- @fn func (client *Client) DeletePublicIp(publicip_id string) *vpcModules.DeletePublicIpResp
- @brief This interface is used to delete an elastic IP address.
- @param[in] publicip_id: Specifies the ID of the elastic IP address, which uniquely identifies the elastic IP address.
- @param[out]
- @return *vpcModules.DeletePublicIpResp
func (*Client) DeleteSecurityGroupRule ¶
func (client *Client) DeleteSecurityGroupRule(rules_security_groups_id string) *neutronModules.DeleteSecurityGroupRuleResp
- @fn func (client *Client) DeleteSecurityGroupRule(rules_security_groups_id string) *neutronModules.DeleteSecurityGroupRuleResp
- @brief This interface is used to delete a security group rule.
- @param[in] rules_security_groups_id: Specifies the security group rule ID, which uniquely identifies the security group rule.
- @param[out]
- @return *neutronModules.DeleteSecurityGroupRuleResp
func (*Client) DeleteSubnet ¶
func (client *Client) DeleteSubnet(vpc_id, subnet_id string) *vpcModules.DeleteSubnetResp
* @fn func (client *Client) DeleteSubnet(vpc_id, subnet_id string) *vpcModules.DeleteSubnetResp * @brief This interface is used to delete a subnet. * @param[in] vpc_id: Specifies the ID of the subnet VPC. * @param[in] subnet_id:Specifies the subnet ID, which uniquely identifies the subnet. * @param[out] * @return *vpcModules.DeleteSubnetResp
func (*Client) DeleteVpc ¶
func (client *Client) DeleteVpc(vpc_id string) *vpcModules.DeleteVpcResp
* @fn func (client *Client) DeleteVpc(vpc_id string) *vpcModules.DeleteVpcResp * @brief This interface is used to delete a VPC. * @param[in] vpc_id: Specifies the VPC ID, which uniquely identifies the VPC. * @param[out] * @return *vpcModules.DeleteVpcResp
func (*Client) ListBandwidths ¶
func (client *Client) ListBandwidths(limit int, marker string) *vpcModules.ListBandwidthsResp
- @fn func (client *Client) ListBandwidths(limit int, marker string) *vpcModules.ListBandwidthsResp
- @brief This interface is used to query bandwidths using search criteria and to display the bandwidths in a list.
- @param[in] limit:Specifies the number of records returned on each page. The value ranges from 0 to intmax.
- @param[in] marker:Specifies the resource ID of the pagination query. If the parameter is left empty, only resources on the first page are queried.
- @param[out]
- @return *vpcModules.ListBandwidthsResp
func (*Client) ListCloudImages ¶
func (client *Client) ListCloudImages(listCloudImagesReqEx *imsModules.ListCloudImagesReqEx) *imsModules.ListCloudImagesResp
- @fn func (client *Client) ListCloudImages(listCloudImagesReqEx *imsModules.ListCloudImagesReqEx) *imsModules.ListCloudImagesResp
- @brief This interface is used to query images using search criteria and to display the images in a list.
- @param[in] listCloudImagesReqEx: URI parameters
- @param[out]
- @return *imsModules.ListCloudImagesResp
func (*Client) ListCloudServerFlavorsExt ¶
func (client *Client) ListCloudServerFlavorsExt() ecsModules.ListCloudServerFlavorsExtResp
func (*Client) ListInterfaces ¶
func (client *Client) ListInterfaces(server_id string) novaModules.ListInterfacesResp
func (*Client) ListSecurityGroups ¶
func (client *Client) ListSecurityGroups(limit int, marker, vpc_id string) *vpcModules.ListSecurityGroupsResp
- @fn func (client *Client) ListSecurityGroups(limit int, marker, vpc_id string) *vpcModules.ListSecurityGroupsResp
- @brief This interface is used to query security groups using search criteria and to display the security groups in a list.
- @param[in] limit: Specifies the number of records returned on each page. The value ranges from 0 to intmax.
- @param[in] marker: Specifies the resource ID of the pagination query. If the parameter is left empty, only resources on the first page are queried.
- @param[in] vpc_id: Specifies the VPC ID used as the query filter.
- @param[out]
- @return *vpcModules.ListSecurityGroupsResp
func (*Client) ListSubnets ¶
func (client *Client) ListSubnets(limit int, marker, vpc_id string) *vpcModules.ListSubnetsResp
func (*Client) RebootServer ¶
func (client *Client) RebootServer(server_id, rebootType string) novaModules.RebootServerResp
func (*Client) ShowEcsJob ¶
func (client *Client) ShowEcsJob(job_id string) ecsModules.ShowEcsJobResp
func (*Client) ShowSecurityGroupRule ¶
func (client *Client) ShowSecurityGroupRule(rules_security_groups_id string) *neutronModules.ShowSecurityGroupRuleResp
- @fn func (client *Client) ShowSecurityGroupRule(rules_security_groups_id string) *neutronModules.ShowSecurityGroupRuleResp
- @brief This interface is used to query details about a security group rule.
- @param[in] rules_security_groups_id: Specifies the security group rule ID, which uniquely identifies the security group rule.
- @param[out]
- @return *neutronModules.ShowSecurityGroupRuleResp
func (*Client) ShowServer ¶
func (client *Client) ShowServer(server_id string) novaModules.ShowServerResp
func (*Client) ShowSubnet ¶
func (client *Client) ShowSubnet(subnet_id string) *vpcModules.ShowSubnetResp
* @fn func (client *Client) ShowSubnet(subnet_id string) *vpcModules.ShowSubnetResp * @brief This interface is used to query details about a subnet. * @param[in] subnet_id:Specifies the subnet ID, which uniquely identifies the subnet. * @param[out] * @return *vpcModules.ShowSubnetResp
func (*Client) ShowVpc ¶
func (client *Client) ShowVpc(vpc_id string) *vpcModules.ShowVpcResp
* @fn func (client *Client) ShowVpc(vpc_id string) *vpcModules.ShowVpcResp * @brief This interface is used to query details about a VPC. * @param[in] vpc_id: Specifies the VPC ID, which uniquely identifies the VPC. * @param[out] * @return *vpcModules.ShowVpcResp
func (*Client) StartServer ¶
func (client *Client) StartServer(server_id string) novaModules.StartServerResp
func (*Client) StopServer ¶
func (client *Client) StopServer(server_id string) novaModules.StopServerResp
func (*Client) UpdateBandwidth ¶
func (client *Client) UpdateBandwidth(bandwidth_id string, updateBandwidthReq *vpcModules.UpdateBandwidthReq) *vpcModules.UpdateBandwidthResp
- @fn func (client *Client) UpdateBandwidth(bandwidth_id string, updateBandwidthReq *vpcModules.UpdateBandwidthReq) *vpcModules.UpdateBandwidthResp
- @brief This interface is used to update information about a bandwidth.
- @param[in] bandwidth_id: Specifies the bandwidth ID, which uniquely identifies the bandwidth.
- @param[in] updateBandwidthReq: Body parameters
- @param[out]
- @return *vpcModules.UpdateBandwidthResp
func (*Client) UpdatePublicIp ¶
func (client *Client) UpdatePublicIp(publicip_id string, updatePublicIpReq *vpcModules.UpdatePublicIpReq) *vpcModules.UpdatePublicIpResp
- @fn func (client *Client) UpdatePublicIp(publicip_id string, updatePublicIpReq *vpcModules.UpdatePublicIpReq) *vpcModules.UpdatePublicIpResp
- @brief This interface is used to update information about an elastic IP address, that is, binding an elastic IP address to a NIC or unbinding an elastic IP address from a NIC.
- @param[in] publicip_id: Specifies the ID of the elastic IP address, which uniquely identifies the elastic IP address.
- @param[out]
- @return *vpcModules.UpdatePublicIpResp
type IdentityStruct ¶
type IdentityStruct struct { Methods []string `json:"methods"` Password PasswordStruct `json:"password"` }
Identity
type PasswordStruct ¶
type PasswordStruct struct {
User UserStruct `json:"user"`
}
Password structure
type ScopeStruct ¶
type ScopeStruct struct { Domain DomainStruct `json:"domain"` Project ProjectStruct `json:"project"` }
Scope structure
type UserStruct ¶
type UserStruct struct { Domain DomainStruct `json:"domain"` Name string `json:"name"` Password string `json:"password"` }
User stucture