Skip to content

Commit

Permalink
Add huaweicloud_api_gateway_group and huaweicloud_api_gateway_api res…
Browse files Browse the repository at this point in the history
…ources (#270)

* Add huaweicloud_api_gateway_group resource and doc

Signed-off-by: ShiChangkuo <[email protected]>

* sync vendor from huaweicloud golangsdk

* Add huaweicloud_api_gateway_api resource and doc

Co-authored-by: Zhenguo Niu <[email protected]>
  • Loading branch information
ShiChangkuo and niuzhenguo authored Mar 2, 2020
1 parent 600b1c3 commit 90f33ae
Show file tree
Hide file tree
Showing 21 changed files with 1,696 additions and 53 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ require (
github.com/hashicorp/errwrap v1.0.0
github.com/hashicorp/go-cleanhttp v0.5.1
github.com/hashicorp/terraform-plugin-sdk v1.0.0
github.com/huaweicloud/golangsdk v0.0.0-20200214070017-e223495ff90d
github.com/huaweicloud/golangsdk v0.0.0-20200229071744-cde13ac05a94
github.com/jen20/awspolicyequivalence v0.0.0-20170831201602-3d48364a137a
github.com/mitchellh/go-homedir v1.1.0
github.com/smartystreets/goconvey v0.0.0-20190222223459-a17d461953aa // indirect
Expand Down
5 changes: 3 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,9 @@ github.com/huaweicloud/golangsdk v0.0.0-20191210113552-8f6bd7a6f1d8 h1:7dfGs0ENj
github.com/huaweicloud/golangsdk v0.0.0-20191210113552-8f6bd7a6f1d8/go.mod h1:WQBcHRNX9shz3928lWEvstQJtAtYI7ks6XlgtRT9Tcw=
github.com/huaweicloud/golangsdk v0.0.0-20200204080439-744c2b9d7746 h1:c2HOmXuDF1VSiBdCZAPo6kbOSTt9Kh6jV87mmiegkE0=
github.com/huaweicloud/golangsdk v0.0.0-20200204080439-744c2b9d7746/go.mod h1:WQBcHRNX9shz3928lWEvstQJtAtYI7ks6XlgtRT9Tcw=
github.com/huaweicloud/golangsdk v0.0.0-20200214070017-e223495ff90d h1:9zNtiJP0i3E6p/Psh4sC3OiRpJyc5oVmvReMgovwqp0=
github.com/huaweicloud/golangsdk v0.0.0-20200214070017-e223495ff90d/go.mod h1:WQBcHRNX9shz3928lWEvstQJtAtYI7ks6XlgtRT9Tcw=
github.com/huaweicloud/golangsdk v0.0.0-20200226090834-31e7d87f9e61 h1:cHkhULuZneNT7GRwigfbRM8IXxLH4mNdDEUezszJ3go=
github.com/huaweicloud/golangsdk v0.0.0-20200229071744-cde13ac05a94 h1:3MKOAqfBneQCxf7+GMMql6n+JIvE+rmdgtjoM1IhDWc=
github.com/huaweicloud/golangsdk v0.0.0-20200229071744-cde13ac05a94/go.mod h1:WQBcHRNX9shz3928lWEvstQJtAtYI7ks6XlgtRT9Tcw=
github.com/jen20/awspolicyequivalence v0.0.0-20170831201602-3d48364a137a h1:FyS/ubzBR5xJlnJGRTwe7GUHpJOR4ukYK3y+LFNffuA=
github.com/jen20/awspolicyequivalence v0.0.0-20170831201602-3d48364a137a/go.mod h1:uoIMjNxUfXi48Ci40IXkPRbghZ1vbti6v9LCbNqRgHY=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
Expand Down
7 changes: 7 additions & 0 deletions huaweicloud/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,13 @@ func (c *Config) newObjectStorageClient(region string) (*obs.ObsClient, error) {
return obs.New(c.AccessKey, c.SecretKey, client.Endpoint)
}

func (c *Config) apiGatewayV1Client(region string) (*golangsdk.ServiceClient, error) {
return huaweisdk.ApiGateWayV1(c.HwClient, golangsdk.EndpointOpts{
Region: c.determineRegion(region),
Availability: c.getHwEndpointType(),
})
}

func (c *Config) blockStorageV1Client(region string) (*golangsdk.ServiceClient, error) {
return huaweisdk.NewBlockStorageV1(c.HwClient, golangsdk.EndpointOpts{
Region: c.determineRegion(region),
Expand Down
2 changes: 2 additions & 0 deletions huaweicloud/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ func Provider() terraform.ResourceProvider {
},

ResourcesMap: map[string]*schema.Resource{
"huaweicloud_api_gateway_group": resourceAPIGatewayGroup(),
"huaweicloud_api_gateway_api": resourceAPIGatewayAPI(),
"huaweicloud_blockstorage_volume_v2": resourceBlockStorageVolumeV2(),
"huaweicloud_compute_instance_v2": resourceComputeInstanceV2(),
"huaweicloud_compute_interface_attach_v2": resourceComputeInterfaceAttachV2(),
Expand Down
Loading

0 comments on commit 90f33ae

Please sign in to comment.