From fc9fdbb4304b504e6c70ad33533ad0290abdf362 Mon Sep 17 00:00:00 2001 From: Deepak Selvakumar <77007253+deepaksibm@users.noreply.github.com> Date: Mon, 2 Sep 2024 17:38:34 +0530 Subject: [PATCH] additional changes --- ...rce_ibm_is_private_path_service_gateway.go | 23 ++++++++++++++--- ...ce_ibm_is_private_path_service_gateways.go | 20 +++++++++++++-- ...m_is_private_path_service_gateways_test.go | 2 +- ...rce_ibm_is_private_path_service_gateway.go | 25 ++++++++++++++++--- ...private_path_service_gateway.html.markdown | 4 ++- ...rivate_path_service_gateways.html.markdown | 4 ++- .../is_private_path_service_gateway.markdown | 4 ++- 7 files changed, 69 insertions(+), 13 deletions(-) diff --git a/ibm/service/vpc/data_source_ibm_is_private_path_service_gateway.go b/ibm/service/vpc/data_source_ibm_is_private_path_service_gateway.go index caab92297c..d62e8cf5e1 100644 --- a/ibm/service/vpc/data_source_ibm_is_private_path_service_gateway.go +++ b/ibm/service/vpc/data_source_ibm_is_private_path_service_gateway.go @@ -48,11 +48,21 @@ func DataSourceIBMIsPrivatePathServiceGateway() *schema.Resource { Computed: true, Description: "The policy to use for bindings from accounts without an explicit account policy.", }, - "endpoint_gateways_count": { + "endpoint_gateway_count": { Type: schema.TypeInt, Computed: true, Description: "The number of endpoint gateways using this private path service gateway.", }, + "endpoint_gateway_binding_auto_delete": { + Type: schema.TypeBool, + Computed: true, + Description: "Indicates whether endpoint gateway bindings will be automatically deleted after endpoint_gateway_binding_auto_delete_timeout hours have passed.", + }, + "endpoint_gateway_binding_auto_delete_timeout": { + Type: schema.TypeInt, + Computed: true, + Description: "If endpoint_gateway_binding_auto_delete is true, the hours after which endpoint gateway bindings will be automatically deleted.", + }, "href": { Type: schema.TypeString, Computed: true, @@ -285,10 +295,15 @@ func dataSourceIBMIsPrivatePathServiceGatewayRead(context context.Context, d *sc return diag.FromErr(fmt.Errorf("Error setting default_access_policy: %s", err)) } - if err = d.Set("endpoint_gateways_count", flex.IntValue(privatePathServiceGateway.EndpointGatewayCount)); err != nil { - return diag.FromErr(fmt.Errorf("Error setting endpoint_gateways_count: %s", err)) + if err = d.Set("endpoint_gateway_count", flex.IntValue(privatePathServiceGateway.EndpointGatewayCount)); err != nil { + return diag.FromErr(fmt.Errorf("Error setting endpoint_gateway_count: %s", err)) + } + if err = d.Set("endpoint_gateway_binding_auto_delete", privatePathServiceGateway.EndpointGatewayBindingAutoDelete); err != nil { + return diag.FromErr(fmt.Errorf("Error setting endpoint_gateway_binding_auto_delete: %s", err)) + } + if err = d.Set("endpoint_gateway_binding_auto_delete_timeout", privatePathServiceGateway.EndpointGatewayBindingAutoDeleteTimeout); err != nil { + return diag.FromErr(fmt.Errorf("Error setting endpoint_gateway_binding_auto_delete_timeout: %s", err)) } - if err = d.Set("href", privatePathServiceGateway.Href); err != nil { return diag.FromErr(fmt.Errorf("Error setting href: %s", err)) } diff --git a/ibm/service/vpc/data_source_ibm_is_private_path_service_gateways.go b/ibm/service/vpc/data_source_ibm_is_private_path_service_gateways.go index c7ad8dcd41..cb40543672 100644 --- a/ibm/service/vpc/data_source_ibm_is_private_path_service_gateways.go +++ b/ibm/service/vpc/data_source_ibm_is_private_path_service_gateways.go @@ -43,11 +43,21 @@ func DataSourceIBMIsPrivatePathServiceGateways() *schema.Resource { Computed: true, Description: "The policy to use for bindings from accounts without an explicit account policy.", }, - "endpoint_gateways_count": { + "endpoint_gateway_count": { Type: schema.TypeInt, Computed: true, Description: "The number of endpoint gateways using this private path service gateway.", }, + "endpoint_gateway_binding_auto_delete": { + Type: schema.TypeBool, + Computed: true, + Description: "Indicates whether endpoint gateway bindings will be automatically deleted after endpoint_gateway_binding_auto_delete_timeout hours have passed.", + }, + "endpoint_gateway_binding_auto_delete_timeout": { + Type: schema.TypeInt, + Computed: true, + Description: "If endpoint_gateway_binding_auto_delete is true, the hours after which endpoint gateway bindings will be automatically deleted.", + }, "href": { Type: schema.TypeString, Computed: true, @@ -303,7 +313,13 @@ func dataSourceIBMIsPrivatePathServiceGatewaysPrivatePathServiceGatewayToMap(mod modelMap["default_access_policy"] = *model.DefaultAccessPolicy } if model.EndpointGatewayCount != nil { - modelMap["endpoint_gateways_count"] = *model.EndpointGatewayCount + modelMap["endpoint_gateway_count"] = *model.EndpointGatewayCount + } + if model.EndpointGatewayBindingAutoDelete != nil { + modelMap["endpoint_gateway_binding_auto_delete"] = *model.EndpointGatewayBindingAutoDelete + } + if model.EndpointGatewayBindingAutoDeleteTimeout != nil { + modelMap["endpoint_gateway_binding_auto_delete_timeout"] = *model.EndpointGatewayBindingAutoDeleteTimeout } if model.Href != nil { modelMap["href"] = *model.Href diff --git a/ibm/service/vpc/data_source_ibm_is_private_path_service_gateways_test.go b/ibm/service/vpc/data_source_ibm_is_private_path_service_gateways_test.go index 190cf33db1..d360458021 100644 --- a/ibm/service/vpc/data_source_ibm_is_private_path_service_gateways_test.go +++ b/ibm/service/vpc/data_source_ibm_is_private_path_service_gateways_test.go @@ -24,7 +24,7 @@ func TestAccIBMIsPrivatePathServiceGatewaysDataSourceBasic(t *testing.T) { resource.TestCheckResourceAttrSet("data.ibm_is_private_path_service_gateways.is_private_path_service_gateways", "private_path_service_gateways.0.created_at"), resource.TestCheckResourceAttrSet("data.ibm_is_private_path_service_gateways.is_private_path_service_gateways", "private_path_service_gateways.0.crn"), resource.TestCheckResourceAttrSet("data.ibm_is_private_path_service_gateways.is_private_path_service_gateways", "private_path_service_gateways.0.default_access_policy"), - resource.TestCheckResourceAttrSet("data.ibm_is_private_path_service_gateways.is_private_path_service_gateways", "private_path_service_gateways.0.endpoint_gateways_count"), + resource.TestCheckResourceAttrSet("data.ibm_is_private_path_service_gateways.is_private_path_service_gateways", "private_path_service_gateways.0.endpoint_gateway_count"), resource.TestCheckResourceAttrSet("data.ibm_is_private_path_service_gateways.is_private_path_service_gateways", "private_path_service_gateways.0.href"), resource.TestCheckResourceAttrSet("data.ibm_is_private_path_service_gateways.is_private_path_service_gateways", "private_path_service_gateways.0.id"), resource.TestCheckResourceAttrSet("data.ibm_is_private_path_service_gateways.is_private_path_service_gateways", "private_path_service_gateways.0.lifecycle_state"), diff --git a/ibm/service/vpc/resource_ibm_is_private_path_service_gateway.go b/ibm/service/vpc/resource_ibm_is_private_path_service_gateway.go index cc65a45c84..7f24d48fde 100644 --- a/ibm/service/vpc/resource_ibm_is_private_path_service_gateway.go +++ b/ibm/service/vpc/resource_ibm_is_private_path_service_gateway.go @@ -69,7 +69,17 @@ func ResourceIBMIsPrivatePathServiceGateway() *schema.Resource { Computed: true, Description: "The date and time that the account policy was created.", }, - "endpoint_gateways_count": &schema.Schema{ + "endpoint_gateway_binding_auto_delete": &schema.Schema{ + Type: schema.TypeBool, + Computed: true, + Description: "Indicates whether endpoint gateway bindings will be automatically deleted after endpoint_gateway_binding_auto_delete_timeout hours have passed.", + }, + "endpoint_gateway_binding_auto_delete_timeout": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + Description: "If endpoint_gateway_binding_auto_delete is true, the hours after which endpoint gateway bindings will be automatically deleted.", + }, + "endpoint_gateway_count": &schema.Schema{ Type: schema.TypeInt, Computed: true, Description: "The number of endpoint gateways using this private path service gateway.", @@ -266,8 +276,17 @@ func resourceIBMIsPrivatePathServiceGatewayRead(context context.Context, d *sche if err = d.Set("href", privatePathServiceGateway.Href); err != nil { return diag.FromErr(fmt.Errorf("Error setting href: %s", err)) } - if err = d.Set("endpoint_gateways_count", privatePathServiceGateway.EndpointGatewayCount); err != nil { - return diag.FromErr(fmt.Errorf("Error setting endpoint_gateways_count: %s", err)) + if err = d.Set("endpoint_gateway_count", privatePathServiceGateway.EndpointGatewayCount); err != nil { + return diag.FromErr(fmt.Errorf("Error setting endpoint_gateway_count: %s", err)) + } + if err = d.Set("endpoint_gateway_binding_auto_delete", privatePathServiceGateway.EndpointGatewayBindingAutoDelete); err != nil { + return diag.FromErr(fmt.Errorf("Error setting endpoint_gateway_binding_auto_delete: %s", err)) + } + if err = d.Set("endpoint_gateway_binding_auto_delete_timeout", privatePathServiceGateway.EndpointGatewayBindingAutoDeleteTimeout); err != nil { + return diag.FromErr(fmt.Errorf("Error setting endpoint_gateway_binding_auto_delete_timeout: %s", err)) + } + if err = d.Set("published", privatePathServiceGateway.Published); err != nil { + return diag.FromErr(fmt.Errorf("Error setting published: %s", err)) } if err = d.Set("published", privatePathServiceGateway.Published); err != nil { return diag.FromErr(fmt.Errorf("Error setting published: %s", err)) diff --git a/website/docs/d/is_private_path_service_gateway.html.markdown b/website/docs/d/is_private_path_service_gateway.html.markdown index e9d613ed1c..f169c5ac27 100644 --- a/website/docs/d/is_private_path_service_gateway.html.markdown +++ b/website/docs/d/is_private_path_service_gateway.html.markdown @@ -56,7 +56,9 @@ In addition to all argument references listed, you can access the following attr - `created_at` - (String) The date and time that the private path service gateway was created. - `crn` - (String) The CRN for this private path service gateway. - `default_access_policy` - (String) The policy to use for bindings from accounts without an explicit account policy. -- `endpoint_gateways_count` - (Integer) The number of endpoint gateways using this private path service gateway. +- `endpoint_gateway_count` - (Integer) The number of endpoint gateways using this private path service gateway. +- `endpoint_gateway_binding_auto_delete` - (Boolean) Indicates whether endpoint gateway bindings will be automatically deleted after endpoint_gateway_binding_auto_delete_timeout hours have passed. At present, this is always true, but may be modifiable in the future. +- `endpoint_gateway_binding_auto_delete_timeout` - (Integer) If endpoint_gateway_binding_auto_delete is true, the hours after which endpoint gateway bindings will be automatically deleted. If the value is 0, abandoned endpoint gateway bindings will be deleted immediately. At present, this is always set to 0. This value may be modifiable in the future. - `href` - (String) The URL for this private path service gateway. - `lifecycle_state` - (String) The lifecycle state of the private path service gateway. - `load_balancer` - (List) The load balancer for this private path service gateway. diff --git a/website/docs/d/is_private_path_service_gateways.html.markdown b/website/docs/d/is_private_path_service_gateways.html.markdown index a690c50e92..000f0f8872 100644 --- a/website/docs/d/is_private_path_service_gateways.html.markdown +++ b/website/docs/d/is_private_path_service_gateways.html.markdown @@ -27,7 +27,9 @@ In addition to all argument references listed, you can access the following attr - `created_at` - (String) The date and time that the private path service gateway was created. - `crn` - (String) The CRN for this private path service gateway. - `default_access_policy` - (String) The policy to use for bindings from accounts without an explicit account policy. - - `endpoint_gateways_count` - (Integer) The number of endpoint gateways using this private path service gateway. + - `endpoint_gateway_count` - (Integer) The number of endpoint gateways using this private path service gateway. + - `endpoint_gateway_binding_auto_delete` - (Boolean) Indicates whether endpoint gateway bindings will be automatically deleted after endpoint_gateway_binding_auto_delete_timeout hours have passed. At present, this is always true, but may be modifiable in the future. + - `endpoint_gateway_binding_auto_delete_timeout` - (Integer) If endpoint_gateway_binding_auto_delete is true, the hours after which endpoint gateway bindings will be automatically deleted. If the value is 0, abandoned endpoint gateway bindings will be deleted immediately. At present, this is always set to 0. This value may be modifiable in the future. - `href` - (String) The URL for this private path service gateway. - `id` - (String) The unique identifier for this private path service gateway. - `lifecycle_state` - (String) The lifecycle state of the private path service gateway. diff --git a/website/docs/r/is_private_path_service_gateway.markdown b/website/docs/r/is_private_path_service_gateway.markdown index 356fdaac64..459fbb61d8 100644 --- a/website/docs/r/is_private_path_service_gateway.markdown +++ b/website/docs/r/is_private_path_service_gateway.markdown @@ -41,7 +41,9 @@ In addition to all argument references listed, you can access the following attr - `created_at` - (String) The date and time that the private path service gateway was created. - `crn` - (String) The CRN for this private path service gateway. - `default_access_policy` - (String) The policy to use for bindings from accounts without an explicit account policy. -- `endpoint_gateways_count` - (Integer) The number of endpoint gateways using this private path service gateway. +- `endpoint_gateway_count` - (Integer) The number of endpoint gateways using this private path service gateway. +- `endpoint_gateway_binding_auto_delete` - (Boolean) Indicates whether endpoint gateway bindings will be automatically deleted after endpoint_gateway_binding_auto_delete_timeout hours have passed. At present, this is always true, but may be modifiable in the future. +- `endpoint_gateway_binding_auto_delete_timeout` - (Integer) If endpoint_gateway_binding_auto_delete is true, the hours after which endpoint gateway bindings will be automatically deleted. If the value is 0, abandoned endpoint gateway bindings will be deleted immediately. At present, this is always set to 0. This value may be modifiable in the future. - `href` - (String) The URL for this private path service gateway. - `id` - The unique identifier of the PrivatePathServiceGateway - `lifecycle_state` - (String) The lifecycle state of the private path service gateway.