Skip to content

Commit

Permalink
fix: add api comments from yaml (#4105)
Browse files Browse the repository at this point in the history
  • Loading branch information
houpeng80 authored Jan 30, 2024
1 parent 8c664d3 commit 17244e0
Show file tree
Hide file tree
Showing 622 changed files with 2,343 additions and 15 deletions.
4 changes: 2 additions & 2 deletions docs/api/resource_huaweicloud_as_notification.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ tags:
servers:
- url: https://AsNotification.myhuaweicloud.com
paths:
autoscaling-api/v1/{project_id}/scaling_notification/{scaling_group_id}:
/autoscaling-api/v1/{project_id}/scaling_notification/{scaling_group_id}:
GET:
tag: AS
operationId: GetASNotification
Expand All @@ -16,7 +16,7 @@ paths:
tag: AS
operationId: CreateAsNotification
x-ref-api: PUT autoscaling-api/v1/{project_id}/scaling_notification/{scaling_group_id}
autoscaling-api/v1/{project_id}/scaling_notification/{scaling_group_id}/{topic_urn}:
/autoscaling-api/v1/{project_id}/scaling_notification/{scaling_group_id}/{topic_urn}:
DELETE:
tag: AS
operationId: DeleteAsNotification
Expand Down
3 changes: 0 additions & 3 deletions docs/api/resource_huaweicloud_ccm_certificate_push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,3 @@ paths:
get:
tag: ELB
operationId: Get
get:
tag: WAF
operationId: Get
3 changes: 0 additions & 3 deletions docs/api/resource_huaweicloud_gaussdb_redis_instance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ paths:
tag: GaussDBforNoSQL
operationId: Delete
/v3/{project_id}/instances:
get:
tag: GaussDBforNoSQL
operationId: GetInstanceByID
get:
tag: GaussDBforNoSQL
operationId: GetInstanceByID
Expand Down
7 changes: 3 additions & 4 deletions docs/api/resource_huaweicloud_vpc_bandwidth.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,16 @@ paths:
tag: EIP
operationId: ChangeToPeriod
/v2.0/{project_id}/bandwidths/{ID}:
put:
tag: EIP
operationId: Update
delete:
tag: EIP
operationId: Delete
/v1/{project_id}/bandwidths/{id}:
get:
tag: EIP
operationId: Get
/v2.0/{project_id}/bandwidths/{ID}:
put:
tag: EIP
operationId: Update
/v2.0/{project_id}/bandwidths:
post:
tag: EIP
Expand Down
4 changes: 2 additions & 2 deletions docs/api/resource_huaweicloud_waf_address_group.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ tags:
servers:
- url: https://waf.cn-north-4.myhuaweicloud.com
paths:
v1/{project_id}/waf/ip-group/{id}:
/v1/{project_id}/waf/ip-group/{id}:
DELETE:
tag: WAF
operationId: DeleteWAFAddressGroup
Expand All @@ -20,7 +20,7 @@ paths:
tag: WAF
operationId: UpdateWAFAddressGroup
x-ref-api: PUT v1/{project_id}/waf/ip-group/{id}
v1/{project_id}/waf/ip-groups:
/v1/{project_id}/waf/ip-groups:
POST:
tag: WAF
operationId: CreateWAFAddressGroup
Expand Down
1 change: 1 addition & 0 deletions huaweicloud/data_source_huaweicloud_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/config"
)

// @API IAM GET /v3/auth/domains
func DataSourceAccount() *schema.Resource {
return &schema.Resource{
ReadContext: dataSourceAccountRead,
Expand Down
1 change: 1 addition & 0 deletions huaweicloud/data_source_huaweicloud_availability_zones.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/utils/fmtp"
)

// @API ECS GET /v2.1/{project_id}/os-availability-zone
func DataSourceAvailabilityZones() *schema.Resource {
return &schema.Resource{
Read: dataSourceAvailabilityZonesRead,
Expand Down
3 changes: 3 additions & 0 deletions huaweicloud/resource_huaweicloud_compute_keypair.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import (
"github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/utils/logp"
)

// @API ECS DELETE /v2.1/{project_id}/os-keypairs/{name}
// @API ECS GET /v2.1/{project_id}/os-keypairs/{name}
// @API ECS POST /v2.1/{project_id}/os-keypairs
func ResourceComputeKeypairV2() *schema.Resource {
return &schema.Resource{
Create: resourceComputeKeypairV2Create,
Expand Down
7 changes: 7 additions & 0 deletions huaweicloud/resource_huaweicloud_mrs_cluster_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ import (
"github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/utils/logp"
)

// @API MRS GET /v1.1/{project_id}/cluster_infos/{id}
// @API MRS POST /v1.1/{project_id}/clusters/{id}/tags/action
// @API MRS GET /v1.1/{project_id}/clusters/{id}/tags
// @API MRS DELETE /v1.1/{project_id}/clusters/{id}
// @API MRS POST /v1.1/{project_id}/run-job-flow
// @API VPC GET /v1/{project_id}/subnets/{id}
// @API VPC GET /v1/{project_id}/vpcs/{id}
func ResourceMRSClusterV1() *schema.Resource {
return &schema.Resource{
Create: resourceClusterV1Create,
Expand Down
3 changes: 3 additions & 0 deletions huaweicloud/resource_huaweicloud_mrs_job_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ import (
"github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/utils/logp"
)

// @API MRS DELETE /v1.1/{project_id}/job-executions/{id}
// @API MRS GET /v1.1/{project_id}/job-exes/{id}
// @API MRS POST /v1.1/{project_id}/jobs/submit-job
func ResourceMRSJobV1() *schema.Resource {
return &schema.Resource{
Create: resourceMRSJobV1Create,
Expand Down
9 changes: 9 additions & 0 deletions huaweicloud/resource_huaweicloud_network_acl.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ type FirewallGroup struct {
routerinsertion.FirewallGroupExt
}

// @API VPC GET /v2.0/ports
// @API VPC GET /v1/{project_id}/subnets/{id}
// @API VPC DELETE /v2.0/fwaas/firewall_groups/{id}
// @API VPC GET /v2.0/fwaas/firewall_groups/{id}
// @API VPC PUT /v2.0/fwaas/firewall_groups/{id}
// @API VPC POST /v2.0/fwaas/firewall_groups
// @API VPC DELETE /v2.0/fwaas/firewall_policies/{id}
// @API VPC PUT /v2.0/fwaas/firewall_policies/{id}
// @API VPC POST /v2.0/fwaas/firewall_policies
func ResourceNetworkACL() *schema.Resource {
return &schema.Resource{
Create: resourceNetworkACLCreate,
Expand Down
6 changes: 6 additions & 0 deletions huaweicloud/resource_huaweicloud_network_acl_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ import (
"github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/utils/logp"
)

// @API VPC PUT /v2.0/fwaas/firewall_policies/{id}/remove_rule
// @API VPC GET /v2.0/fwaas/firewall_policies
// @API VPC DELETE /v2.0/fwaas/firewall_rules/{id}
// @API VPC GET /v2.0/fwaas/firewall_rules/{id}
// @API VPC PUT /v2.0/fwaas/firewall_rules/{id}
// @API VPC POST /v2.0/fwaas/firewall_rules
func ResourceNetworkACLRule() *schema.Resource {
return &schema.Resource{
Create: resourceNetworkACLRuleCreate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ import (
)

// ResourceForwardRule is the imple of huaweicloud_aad_forward_rule
// @API AAD POST /v1/aad/instances/{instanceId}/{ip}/rules/batch-create
// @API AAD POST /v1/aad/instances/{instanceId}/{ip}/rules/batch-delete
// @API AAD PUT /v1/aad/instances/{instanceId}/{ip}/rules/{ruleId}
// @API AAD GET /v1/aad/instances/{instanceId}/{ip}/rules
func ResourceForwardRule() *schema.Resource {
return &schema.Resource{
CreateContext: resourceForwardRuleCreate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ var (
)

// ResourceCloudNativeAntiDdos is the imple of huaweicloud_antiddos_basic
// @API Anti-DDoS GET /v1/{project_id}/antiddos/{floatingIpId}/status
// @API Anti-DDoS GET /v1/{project_id}/antiddos/{floatingIpId}
// @API Anti-DDoS PUT /v1/{project_id}/antiddos/{floatingIpId}
// @API Anti-DDoS GET /v1/{project_id}/antiddos
// @API Anti-DDoS GET /v2/{project_id}/warnalert/alertconfig/query
// @API Anti-DDoS POST /v2/{project_id}/warnalert/alertconfig/update
// @API EIP GET /v1/{project_id}/publicips/{id}
func ResourceCloudNativeAntiDdos() *schema.Resource {
return &schema.Resource{
CreateContext: resourceCloudNativeAntiDdosUpdate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ import (
"github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/utils"
)

// @API AOM DELETE /v2/{project_id}/alert/action-rules
// @API AOM POST /v2/{project_id}/alert/action-rules
// @API AOM PUT /v2/{project_id}/alert/action-rules
// @API AOM GET /v2/{project_id}/alert/action-rules/{id}
func ResourceAlarmActionRule() *schema.Resource {
return &schema.Resource{
CreateContext: resourceAlarmActionRuleCreate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ import (
"github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/utils"
)

// @API AOM DELETE /v2/{project_id}/alarm-rules/{alarm_rule_id}
// @API AOM GET /v2/{project_id}/alarm-rules/{alarm_rule_id}
// @API AOM POST /v2/{project_id}/alarm-rules
// @API AOM PUT /v2/{project_id}/alarm-rules
func ResourceAlarmRule() *schema.Resource {
return &schema.Resource{
CreateContext: resourceAlarmRuleCreate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ import (
"github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/utils"
)

// @API AOM POST /v2/{project_id}/alert/mute-rules
// @API AOM PUT /v2/{project_id}/alert/mute-rules
// @API AOM DELETE /v2/{project_id}/alert/mute-rules
// @API AOM GET /v2/{project_id}/alert/mute-rules
func ResourceAlarmSilenceRule() *schema.Resource {
return &schema.Resource{
CreateContext: resourceAlarmSilenceRuleCreate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ const (
EnvNotExistsCode = "AOM.30004303"
)

// @API AOM POST /v1/applications
// @API AOM DELETE /v1/applications/{id}
// @API AOM GET /v1/applications/{id}
// @API AOM PUT /v1/applications/{id}
func ResourceCmdbApplication() *schema.Resource {
return &schema.Resource{
CreateContext: resourceCmdbApplicationCreate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ import (
"github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/utils"
)

// @API AOM POST /v1/components
// @API AOM PUT /v1/components/{id}
// @API AOM DELETE /v1/components/{id}
// @API AOM GET /v1/components/{id}
func ResourceCmdbComponent() *schema.Resource {
return &schema.Resource{
CreateContext: resourceCmdbComponentCreate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ import (
"github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/utils"
)

// @API AOM POST /v1/environments
// @API AOM DELETE /v1/environments/{id}
// @API AOM GET /v1/environments/{id}
// @API AOM PUT /v1/environments/{id}
func ResourceCmdbEnvironment() *schema.Resource {
return &schema.Resource{
CreateContext: resourceCmdbEnvironmentCreate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ import (
"github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/utils"
)

// @API AOM POST /v2/{project_id}/event2alarm-rule
// @API AOM PUT /v2/{project_id}/event2alarm-rule
// @API AOM DELETE /v2/{project_id}/event2alarm-rule
// @API AOM GET /v2/{project_id}/event2alarm-rule
func ResourceEventAlarmRule() *schema.Resource {
return &schema.Resource{
CreateContext: resourceEventAlarmRuleCreate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ var basicNameRule = schema.Schema{
},
}

// @API AOM GET /v1/{project_id}/inv/servicediscoveryrules
// @API AOM PUT /v1/{project_id}/inv/servicediscoveryrules
// @API AOM DELETE /v1/{project_id}/inv/servicediscoveryrules
func ResourceServiceDiscoveryRule() *schema.Resource {
return &schema.Resource{
CreateContext: resourceServiceDiscoveryRuleCreateOrUpdate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/helper/hashcode"
)

// @API APIG GET /v2/{project_id}/apigw/instances/{instanceId}/{path}
func DataSourceEnvironments() *schema.Resource {
return &schema.Resource{
ReadContext: dataSourceEnvironmentsRead,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/config"
)

// @API APIG GET /v2/{project_id}/apigw/instances/{instanceId}/api-groups
func DataSourceGroups() *schema.Resource {
return &schema.Resource{
ReadContext: dataSourceGroupsRead,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ import (
)

// ResourceAclPolicy is a provider resource of the APIG ACL policy.
// @API APIG DELETE /v2/{project_id}/apigw/instances/{instanceId}/acls/{policyId}
// @API APIG GET /v2/{project_id}/apigw/instances/{instanceId}/acls/{policyId}
// @API APIG PUT /v2/{project_id}/apigw/instances/{instanceId}/acls/{policyId}
// @API APIG POST /v2/{project_id}/apigw/instances/{instanceId}/acls
func ResourceAclPolicy() *schema.Resource {
return &schema.Resource{
CreateContext: resourceAclPolicyCreate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import (
"github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/utils"
)

// @API APIG GET /v2/{project_id}/apigw/instances/{instanceId}/acl-bindings/binded-apis
// @API APIG POST /v2/{project_id}/apigw/instances/{instanceId}/acl-bindings
func ResourceAclPolicyAssociate() *schema.Resource {
return &schema.Resource{
CreateContext: resourceAclPolicyAssociateCreate,
Expand Down
5 changes: 5 additions & 0 deletions huaweicloud/services/apig/resource_huaweicloud_apig_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ var (
}
)

// @API APIG DELETE /v2/{project_id}/apigw/instances/{instanceId}/apis/{apiId}
// @API APIG GET /v2/{project_id}/apigw/instances/{instanceId}/apis/{apiId}
// @API APIG PUT /v2/{project_id}/apigw/instances/{instanceId}/apis/{apiId}
// @API APIG GET /v2/{project_id}/apigw/instances/{instanceId}/apis
// @API APIG POST /v2/{project_id}/apigw/instances/{instanceId}/apis
func ResourceApigAPIV2() *schema.Resource {
return &schema.Resource{
CreateContext: resourceApiCreate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ import (
"github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/config"
)

// @API APIG GET /v2/{project_id}/apigw/instances/{instanceId}/apis/{apiId}
// @API APIG POST /v2/{project_id}/apigw/instances/{instanceId}/apis/action
// @API APIG GET /v2/{project_id}/apigw/instances/{instanceId}/apis/publish/{apiId}
// @API APIG PUT /v2/{project_id}/apigw/instances/{instanceId}/apis/publish/{apiId}
func ResourceApigApiPublishment() *schema.Resource {
return &schema.Resource{
CreateContext: ResourceApiPublishmentCreate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ import (
"github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/config"
)

// @API APIG DELETE /v2/{project_id}/apigw/instances/{instanceId}/apps/{appId}/app-codes/{codeId}
// @API APIG GET /v2/{project_id}/apigw/instances/{instanceId}/apps/{appId}/app-codes/{codeId}
// @API APIG POST /v2/{project_id}/apigw/instances/{instanceId}/apps/{appId}/app-codes
// @API APIG PUT /v2/{project_id}/apigw/instances/{instanceId}/apps/{appId}/app-codes
func ResourceAppcode() *schema.Resource {
return &schema.Resource{
CreateContext: resourceAppcodeCreate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ const (
SecretActionReset SecretAction = "RESET"
)

// @API APIG DELETE /v2/{project_id}/apigw/instances/{instanceId}/apps/{appId}/app-codes/{codeId}
// @API APIG GET /v2/{project_id}/apigw/instances/{instanceId}/apps/{appId}/app-codes
// @API APIG POST /v2/{project_id}/apigw/instances/{instanceId}/apps/{appId}/app-codes
// @API APIG DELETE /v2/{project_id}/apigw/instances/{instanceId}/apps/{appId}
// @API APIG GET /v2/{project_id}/apigw/instances/{instanceId}/apps/{appId}
// @API APIG PUT /v2/{project_id}/apigw/instances/{instanceId}/apps/{appId}
// @API APIG POST /v2/{project_id}/apigw/instances/{instanceId}/apps
// @API APIG PUT /v2/{project_id}/apigw/instances/{instanceId}/apps/secret/{appId}
func ResourceApigApplicationV2() *schema.Resource {
return &schema.Resource{
CreateContext: resourceApplicationCreate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ import (
"github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/utils"
)

// @API APIG DELETE /v2/{project_id}/apigw/instances/{instanceId}/app-auths/{authId}
// @API APIG POST /v2/{project_id}/apigw/instances/{instanceId}/app-auths
// @API APIG GET /v2/{project_id}/apigw/instances/{instanceId}/app-auths/binded-apis
// @API APIG GET /v2/{project_id}/apigw/instances/{instanceId}/app-auths/unbinded-apis
func ResourceAppAuth() *schema.Resource {
return &schema.Resource{
CreateContext: resourceAppAuthCreate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ import (
"github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/config"
)

// @API APIG POST /v2/{project_id}/apigw/certificates
// @API APIG DELETE /v2/{project_id}/apigw/certificates/{certificateId}
// @API APIG GET /v2/{project_id}/apigw/certificates/{certificateId}
// @API APIG PUT /v2/{project_id}/apigw/certificates/{certificateId}
func ResourceCertificate() *schema.Resource {
return &schema.Resource{
CreateContext: resourceCertificateCreate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ import (
"github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/utils"
)

// @API APIG DELETE /v2/{project_id}/apigw/instances/{instanceId}/vpc-channels/{chanId}
// @API APIG GET /v2/{project_id}/apigw/instances/{instanceId}/vpc-channels/{chanId}
// @API APIG PUT /v2/{project_id}/apigw/instances/{instanceId}/vpc-channels/{chanId}
// @API APIG POST /v2/{project_id}/apigw/instances/{instanceId}/vpc-channels
func ResourceChannel() *schema.Resource {
return &schema.Resource{
CreateContext: resourceChannelCreate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ const (
AuthTypeBackend AuthType = "BACKEND"
)

// @API APIG DELETE /v2/{project_id}/apigw/instances/{instanceId}/authorizers/{id}
// @API APIG GET /v2/{project_id}/apigw/instances/{instanceId}/authorizers/{id}
// @API APIG PUT /v2/{project_id}/apigw/instances/{instanceId}/authorizers/{id}
// @API APIG GET /v2/{project_id}/apigw/instances/{instanceId}/authorizers
// @API APIG POST /v2/{project_id}/apigw/instances/{instanceId}/authorizers
func ResourceApigCustomAuthorizerV2() *schema.Resource {
return &schema.Resource{
CreateContext: resourceCustomAuthorizerCreate,
Expand Down
Loading

0 comments on commit 17244e0

Please sign in to comment.