Skip to content

Commit

Permalink
additional changes
Browse files Browse the repository at this point in the history
  • Loading branch information
deepaksibm committed Sep 2, 2024
1 parent 9e1dfca commit fc9fdbb
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 13 deletions.
23 changes: 19 additions & 4 deletions ibm/service/vpc/data_source_ibm_is_private_path_service_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
25 changes: 22 additions & 3 deletions ibm/service/vpc/resource_ibm_is_private_path_service_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down Expand Up @@ -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))
Expand Down
4 changes: 3 additions & 1 deletion website/docs/d/is_private_path_service_gateway.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 3 additions & 1 deletion website/docs/r/is_private_path_service_gateway.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit fc9fdbb

Please sign in to comment.