Skip to content

Commit

Permalink
feat: add dashboard URL to service instance (#865)
Browse files Browse the repository at this point in the history
  • Loading branch information
lechnerc77 authored Jul 26, 2024
1 parent 021d3c9 commit ec29a47
Show file tree
Hide file tree
Showing 23 changed files with 3,029 additions and 3,008 deletions.
1 change: 1 addition & 0 deletions docs/data-sources/subaccount_service_instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ data "btp_subaccount_service_instance" "by_name" {

- `context` (String) Contextual data for the resource.
- `created_date` (String) The date and time when the resource was created in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) format.
- `dashboard_url` (String) The URL of the web-based management UI for the service instance.
- `labels` (Map of Set of String) The set of words or phrases assigned to the service instance.
- `last_modified` (String) The date and time when the resource was last modified in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) format.
- `parameters` (String) The configuration parameters for the service instance.
Expand Down
1 change: 1 addition & 0 deletions docs/data-sources/subaccount_service_instances.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ Read-Only:

- `context` (String) Contextual data for the resource.
- `created_date` (String) The date and time when the resource was created in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) format.
- `dashboard_url` (String) The URL of the web-based management UI for the service instance.
- `id` (String) The ID of the service instance.
- `labels` (Map of Set of String) The set of words or phrases assigned to the service instance.
- `last_modified` (String) The date and time when the resource was last modified in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) format.
Expand Down
1 change: 1 addition & 0 deletions docs/resources/subaccount_service_instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ resource "btp_subaccount_service_instance" "xsuaa_application" {

- `context` (String) Contextual data for the resource.
- `created_date` (String) The date and time when the resource was created in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) format.
- `dashboard_url` (String) The URL of the web-based management UI for the service instance.
- `id` (String) The ID of the service instance.
- `last_modified` (String) The date and time when the resource was last modified in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) format.
- `platform_id` (String) The platform ID.
Expand Down
4 changes: 4 additions & 0 deletions internal/provider/datasource_subaccount_service_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ You must be assigned to the admin or viewer role of the subaccount.`,
MarkdownDescription: "The set of words or phrases assigned to the service instance.",
Computed: true,
},
"dashboard_url": schema.StringAttribute{
MarkdownDescription: "The URL of the web-based management UI for the service instance.",
Computed: true,
},
},
}
}
Expand Down
6 changes: 6 additions & 0 deletions internal/provider/datasource_subaccount_service_instances.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ type subaccountServiceInstancesValueConfig struct {
CreatedDate types.String `tfsdk:"created_date"`
LastModified types.String `tfsdk:"last_modified"`
Labels types.Map `tfsdk:"labels"`
DashboardUrl types.String `tfsdk:"dashboard_url"`
}

type subaccountServiceInstancesDataSourceConfig struct {
Expand Down Expand Up @@ -136,6 +137,10 @@ You must be assigned to the admin or viewer role of the subaccount.`,
MarkdownDescription: "The set of words or phrases assigned to the service instance.",
Computed: true,
},
"dashboard_url": schema.StringAttribute{
MarkdownDescription: "The URL of the web-based management UI for the service instance.",
Computed: true,
},
},
},
Computed: true,
Expand Down Expand Up @@ -181,6 +186,7 @@ func (ds *subaccountServiceInstancesDataSource) Read(ctx context.Context, req da
Context: types.StringValue(string(serviceInstance.Context)),
CreatedDate: timeToValue(serviceInstance.CreatedAt),
LastModified: timeToValue(serviceInstance.UpdatedAt),
DashboardUrl: types.StringValue(serviceInstance.DashboardUrl),
}

val.Labels, diags = types.MapValueFrom(ctx, types.SetType{ElemType: types.StringType}, serviceInstance.Labels)
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions internal/provider/resource_subaccount_service_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ You must be assigned to the admin or the service administrator role of the subac
MarkdownDescription: "The date and time when the resource was last modified in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) format.",
Computed: true,
},
"dashboard_url": schema.StringAttribute{
MarkdownDescription: "The URL of the web-based management UI for the service instance.",
Computed: true,
},
},
}
}
Expand Down
4 changes: 4 additions & 0 deletions internal/provider/type_subaccount_service_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ type subaccountServiceInstanceType struct {
LastModified types.String `tfsdk:"last_modified"`
Labels types.Map `tfsdk:"labels"`
Timeouts timeouts.Value `tfsdk:"timeouts"`
DashboardUrl types.String `tfsdk:"dashboard_url"`
}

func subaccountServiceInstanceValueFrom(ctx context.Context, value servicemanager.ServiceInstanceResponseObject) (subaccountServiceInstanceType, diag.Diagnostics) {
Expand All @@ -45,6 +46,7 @@ func subaccountServiceInstanceValueFrom(ctx context.Context, value servicemanage
State: types.StringValue(value.LastOperation.State),
CreatedDate: timeToValue(value.CreatedAt),
LastModified: timeToValue(value.UpdatedAt),
DashboardUrl: types.StringValue(value.DashboardUrl),
}

var diags, diagnostics diag.Diagnostics
Expand Down Expand Up @@ -74,6 +76,7 @@ type subaccountServiceInstanceDataSourceType struct {
CreatedDate types.String `tfsdk:"created_date"`
LastModified types.String `tfsdk:"last_modified"`
Labels types.Map `tfsdk:"labels"`
DashboardUrl types.String `tfsdk:"dashboard_url"`
}

func subaccountServiceInstanceDataSourceValueFrom(ctx context.Context, value servicemanager.ServiceInstanceResponseObject) (subaccountServiceInstanceDataSourceType, diag.Diagnostics) {
Expand All @@ -92,6 +95,7 @@ func subaccountServiceInstanceDataSourceValueFrom(ctx context.Context, value ser
Context: types.StringValue(string(value.Context)),
CreatedDate: timeToValue(value.CreatedAt),
LastModified: timeToValue(value.UpdatedAt),
DashboardUrl: types.StringValue(value.DashboardUrl),
}

var diags, diagnostics diag.Diagnostics
Expand Down

0 comments on commit ec29a47

Please sign in to comment.