diff --git a/go.mod b/go.mod index 2669b596d2..4248d65661 100644 --- a/go.mod +++ b/go.mod @@ -28,7 +28,7 @@ require ( github.com/IBM/project-go-sdk v0.1.6 github.com/IBM/push-notifications-go-sdk v0.0.0-20210310100607-5790b96c47f5 github.com/IBM/scc-go-sdk/v5 v5.1.3 - github.com/IBM/schematics-go-sdk v0.2.2 + github.com/IBM/schematics-go-sdk v0.2.3 github.com/IBM/secrets-manager-go-sdk/v2 v2.0.2 github.com/IBM/vpc-beta-go-sdk v0.6.0 github.com/IBM/vpc-go-sdk v0.47.0 diff --git a/go.sum b/go.sum index 3d4a146889..f32ddb4c0b 100644 --- a/go.sum +++ b/go.sum @@ -168,8 +168,8 @@ github.com/IBM/sarama v1.41.2 h1:ZDBZfGPHAD4uuAtSv4U22fRZBgst0eEwGFzLj0fb85c= github.com/IBM/sarama v1.41.2/go.mod h1:xdpu7sd6OE1uxNdjYTSKUfY8FaKkJES9/+EyjSgiGQk= github.com/IBM/scc-go-sdk/v5 v5.1.3 h1:8zqJx/HgChTlMaC21HzthIR4HbFkuJ3dR/D68254jRg= github.com/IBM/scc-go-sdk/v5 v5.1.3/go.mod h1:YtAVlzq10bwR82QX4ZavhDIwa1s85RuVO9N/KmXVcuk= -github.com/IBM/schematics-go-sdk v0.2.2 h1:8S3hoVLzF/ZRgWDaLqwHnLmZvlEBHCKgHszmMh7yD2E= -github.com/IBM/schematics-go-sdk v0.2.2/go.mod h1:Tw2OSAPdpC69AxcwoyqcYYaGTTW6YpERF9uNEU+BFRQ= +github.com/IBM/schematics-go-sdk v0.2.3 h1:lgTt0Sbudii3cuSk1YSQgrtiZAXDbBABAoVj3eQuBrU= +github.com/IBM/schematics-go-sdk v0.2.3/go.mod h1:Tw2OSAPdpC69AxcwoyqcYYaGTTW6YpERF9uNEU+BFRQ= github.com/IBM/secrets-manager-go-sdk/v2 v2.0.2 h1:+Svh1OmoFxMBnZQSOUtp2UUzrOGFsSQlE5TFL/ptJco= github.com/IBM/secrets-manager-go-sdk/v2 v2.0.2/go.mod h1:WII+LS4VkQYykmq65NWSuPb5xGNvsqkcK1aCWZoU2x4= github.com/IBM/vpc-beta-go-sdk v0.6.0 h1:wfM3AcW3zOM3xsRtZ+EA6+sESlGUjQ6Yf4n5QQyz4uc= diff --git a/ibm/service/schematics/data_source_ibm_schematics_agent.go b/ibm/service/schematics/data_source_ibm_schematics_agent.go index a5c21acfd5..70cd85f7d3 100644 --- a/ibm/service/schematics/data_source_ibm_schematics_agent.go +++ b/ibm/service/schematics/data_source_ibm_schematics_agent.go @@ -541,9 +541,13 @@ func dataSourceIbmSchematicsAgentRead(context context.Context, d *schema.Resourc } getAgentDataOptions := &schematicsv1.GetAgentDataOptions{ - XFeatureAgents: core.BoolPtr(true), - Profile: core.StringPtr("detailed"), + // XFeatureAgents: core.BoolPtr(true), + Profile: core.StringPtr("detailed"), } + ff := map[string]string{ + "X-Feature-Agents": "true", + } + getAgentDataOptions.Headers = ff getAgentDataOptions.SetAgentID(d.Get("agent_id").(string)) diff --git a/ibm/service/schematics/data_source_ibm_schematics_agent_deploy.go b/ibm/service/schematics/data_source_ibm_schematics_agent_deploy.go index 7fa062e5b4..d1e758d291 100644 --- a/ibm/service/schematics/data_source_ibm_schematics_agent_deploy.go +++ b/ibm/service/schematics/data_source_ibm_schematics_agent_deploy.go @@ -79,9 +79,13 @@ func dataSourceIbmSchematicsAgentDeployRead(context context.Context, d *schema.R } getAgentDataOptions := &schematicsv1.GetAgentDataOptions{ - XFeatureAgents: core.BoolPtr(true), - Profile: core.StringPtr("detailed"), + // XFeatureAgents: core.BoolPtr(true), + Profile: core.StringPtr("detailed"), } + ff := map[string]string{ + "X-Feature-Agents": "true", + } + getAgentDataOptions.Headers = ff getAgentDataOptions.SetAgentID(d.Get("agent_id").(string)) agentData, response, err := schematicsClient.GetAgentDataWithContext(context, getAgentDataOptions) diff --git a/ibm/service/schematics/data_source_ibm_schematics_agent_health.go b/ibm/service/schematics/data_source_ibm_schematics_agent_health.go index 87ea05609d..bd6b34faf6 100644 --- a/ibm/service/schematics/data_source_ibm_schematics_agent_health.go +++ b/ibm/service/schematics/data_source_ibm_schematics_agent_health.go @@ -74,9 +74,13 @@ func dataSourceIbmSchematicsAgentHealthRead(context context.Context, d *schema.R } getAgentDataOptions := &schematicsv1.GetAgentDataOptions{ - XFeatureAgents: core.BoolPtr(true), - Profile: core.StringPtr("detailed"), + // XFeatureAgents: core.BoolPtr(true), + Profile: core.StringPtr("detailed"), } + ff := map[string]string{ + "X-Feature-Agents": "true", + } + getAgentDataOptions.Headers = ff getAgentDataOptions.SetAgentID(d.Get("agent_id").(string)) agentData, response, err := schematicsClient.GetAgentDataWithContext(context, getAgentDataOptions) diff --git a/ibm/service/schematics/data_source_ibm_schematics_agent_prs.go b/ibm/service/schematics/data_source_ibm_schematics_agent_prs.go index e0c4eb613f..a1f1fab48c 100644 --- a/ibm/service/schematics/data_source_ibm_schematics_agent_prs.go +++ b/ibm/service/schematics/data_source_ibm_schematics_agent_prs.go @@ -74,9 +74,13 @@ func dataSourceIbmSchematicsAgentPrsRead(context context.Context, d *schema.Reso } getAgentDataOptions := &schematicsv1.GetAgentDataOptions{ - XFeatureAgents: core.BoolPtr(true), - Profile: core.StringPtr("detailed"), + // XFeatureAgents: core.BoolPtr(true), + Profile: core.StringPtr("detailed"), } + ff := map[string]string{ + "X-Feature-Agents": "true", + } + getAgentDataOptions.Headers = ff getAgentDataOptions.SetAgentID(d.Get("agent_id").(string)) agentData, response, err := schematicsClient.GetAgentDataWithContext(context, getAgentDataOptions) diff --git a/ibm/service/schematics/data_source_ibm_schematics_job.go b/ibm/service/schematics/data_source_ibm_schematics_job.go index 64f35170d5..663e3fa14b 100644 --- a/ibm/service/schematics/data_source_ibm_schematics_job.go +++ b/ibm/service/schematics/data_source_ibm_schematics_job.go @@ -4212,7 +4212,7 @@ func dataSourceJobLogSummaryToMap(logSummaryItem schematicsv1.JobLogSummary) (lo return logSummaryMap } -func dataSourceJobLogSummaryLogErrorsToMap(logErrorsItem schematicsv1.JobLogSummaryLogErrors) (logErrorsMap map[string]interface{}) { +func dataSourceJobLogSummaryLogErrorsToMap(logErrorsItem schematicsv1.JobLogSummaryLogErrorsItem) (logErrorsMap map[string]interface{}) { logErrorsMap = map[string]interface{}{} if logErrorsItem.ErrorCode != nil { diff --git a/ibm/service/schematics/data_source_ibm_schematics_output.go b/ibm/service/schematics/data_source_ibm_schematics_output.go index ec81390106..0e46b0c9c9 100644 --- a/ibm/service/schematics/data_source_ibm_schematics_output.go +++ b/ibm/service/schematics/data_source_ibm_schematics_output.go @@ -123,37 +123,3 @@ func dataSourceIBMSchematicsOutputRead(d *schema.ResourceData, meta interface{}) func dataSourceIBMSchematicsOutputID(d *schema.ResourceData) string { return time.Now().UTC().String() } - -func dataSourceOutputValuesListFlattenOutputValues(result []schematicsv1.OutputValuesInner) (outputValues interface{}) { - for _, outputValuesItem := range result { - outputValues = dataSourceOutputValuesListOutputValuesToMap(outputValuesItem) - } - - return outputValues -} - -func dataSourceOutputValuesListOutputValuesToMap(outputValuesItem schematicsv1.OutputValuesInner) (outputValuesMap map[string]interface{}) { - outputValuesMap = map[string]interface{}{} - - if outputValuesItem.Folder != nil { - outputValuesMap["folder"] = outputValuesItem.Folder - } - if outputValuesItem.ID != nil { - outputValuesMap["id"] = outputValuesItem.ID - } - - m := []flex.Map{} - - for _, outputValues := range outputValuesItem.OutputValues { - m = append(m, flex.Flatten(outputValues)) - } - - if outputValuesItem.OutputValues != nil { - outputValuesMap["output_values"] = m - } - if outputValuesItem.ValueType != nil { - outputValuesMap["value_type"] = outputValuesItem.ValueType - } - - return outputValuesMap -} diff --git a/ibm/service/schematics/data_source_ibm_schematics_workspace.go b/ibm/service/schematics/data_source_ibm_schematics_workspace.go index bdd9f28d1f..7e59232d2f 100644 --- a/ibm/service/schematics/data_source_ibm_schematics_workspace.go +++ b/ibm/service/schematics/data_source_ibm_schematics_workspace.go @@ -5,6 +5,7 @@ package schematics import ( "context" + "encoding/json" "fmt" "log" @@ -86,30 +87,10 @@ func DataSourceIBMSchematicsWorkspace() *schema.Resource { Description: "The version of the software template that you chose to install from the IBM Cloud catalog.", }, "service_extensions": { - Type: schema.TypeList, + Type: schema.TypeString, Computed: true, - Description: "List of service data", - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Computed: true, - Description: "Name of the Service Data.", - }, - "value": { - Type: schema.TypeString, - Computed: true, - Description: "Value of the Service Data.", - }, - "type": { - Type: schema.TypeString, - Computed: true, - Description: "Type of the value string, int, bool.", - }, - }, - }, - }, - }}}, + Description: "Service extensions defined as string of json", + }}}}, "created_at": { Type: schema.TypeString, Computed: true, @@ -880,30 +861,16 @@ func dataSourceWorkspaceResponseCatalogRefToMap(catalogRefItem schematicsv1.Cata catalogRefMap["offering_version"] = catalogRefItem.OfferingVersion } if catalogRefItem.ServiceExtensions != nil { - serviceExtensionsList := []map[string]interface{}{} - for _, serviceExtensionsItem := range catalogRefItem.ServiceExtensions { - serviceExtensionsList = append(serviceExtensionsList, dataSourceWorkspaceResponseCatalogRefServiceExtensionsToMap(serviceExtensionsItem)) + serviceExtensionsByte, err := json.MarshalIndent(catalogRefItem.ServiceExtensions, "", "") + if err != nil { + log.Printf("[DEBUG] Marshelling of service extensions failed %s", err) } - catalogRefMap["service_extensions"] = serviceExtensionsList + serviceExtensionsJSON := string(serviceExtensionsByte[:]) + catalogRefMap["service_extensions"] = serviceExtensionsJSON } return catalogRefMap } -func dataSourceWorkspaceResponseCatalogRefServiceExtensionsToMap(serviceExtensionsItem schematicsv1.ServiceExtensions) (serviceExtensionMap map[string]interface{}) { - serviceExtensionMap = map[string]interface{}{} - - if serviceExtensionsItem.Name != nil { - serviceExtensionMap["name"] = *serviceExtensionsItem.Name - } - if serviceExtensionsItem.Type != nil { - serviceExtensionMap["type"] = serviceExtensionsItem.Type - } - if serviceExtensionsItem.Value != nil { - serviceExtensionMap["value"] = *serviceExtensionsItem.Value - } - return serviceExtensionMap -} - func dataSourceWorkspaceResponseFlattenRuntimeData(result []schematicsv1.TemplateRunTimeDataResponse) (runtimeData []map[string]interface{}) { for _, runtimeDataItem := range result { runtimeData = append(runtimeData, dataSourceWorkspaceResponseRuntimeDataToMap(runtimeDataItem)) diff --git a/ibm/service/schematics/resource_ibm_schematics_agent.go b/ibm/service/schematics/resource_ibm_schematics_agent.go index edfbf33540..8f7896fd03 100644 --- a/ibm/service/schematics/resource_ibm_schematics_agent.go +++ b/ibm/service/schematics/resource_ibm_schematics_agent.go @@ -560,8 +560,12 @@ func resourceIbmSchematicsAgentCreate(context context.Context, d *schema.Resourc } createAgentDataOptions := &schematicsv1.CreateAgentDataOptions{ - XFeatureAgents: core.BoolPtr(true), + // XFeatureAgents: core.BoolPtr(true), } + ff := map[string]string{ + "X-Feature-Agents": "true", + } + createAgentDataOptions.Headers = ff createAgentDataOptions.SetName(d.Get("name").(string)) createAgentDataOptions.SetResourceGroup(d.Get("resource_group").(string)) @@ -636,9 +640,13 @@ func resourceIbmSchematicsAgentRead(context context.Context, d *schema.ResourceD } getAgentDataOptions := &schematicsv1.GetAgentDataOptions{ - XFeatureAgents: core.BoolPtr(true), - Profile: core.StringPtr("detailed"), + // XFeatureAgents: core.BoolPtr(true), + Profile: core.StringPtr("detailed"), + } + ff := map[string]string{ + "X-Feature-Agents": "true", } + getAgentDataOptions.Headers = ff getAgentDataOptions.SetAgentID(d.Id()) @@ -788,8 +796,12 @@ func resourceIbmSchematicsAgentUpdate(context context.Context, d *schema.Resourc } updateAgentDataOptions := &schematicsv1.UpdateAgentDataOptions{ - XFeatureAgents: core.BoolPtr(true), + // XFeatureAgents: core.BoolPtr(true), } + ff := map[string]string{ + "X-Feature-Agents": "true", + } + updateAgentDataOptions.Headers = ff updateAgentDataOptions.SetAgentID(d.Id()) @@ -878,8 +890,12 @@ func resourceIbmSchematicsAgentDelete(context context.Context, d *schema.Resourc } deleteAgentDataOptions := &schematicsv1.DeleteAgentDataOptions{ - XFeatureAgents: core.BoolPtr(true), + // XFeatureAgents: core.BoolPtr(true), + } + ff := map[string]string{ + "X-Feature-Agents": "true", } + deleteAgentDataOptions.Headers = ff deleteAgentDataOptions.SetAgentID(d.Id()) diff --git a/ibm/service/schematics/resource_ibm_schematics_agent_deploy.go b/ibm/service/schematics/resource_ibm_schematics_agent_deploy.go index ec9564c686..7944008120 100644 --- a/ibm/service/schematics/resource_ibm_schematics_agent_deploy.go +++ b/ibm/service/schematics/resource_ibm_schematics_agent_deploy.go @@ -120,7 +120,6 @@ func resourceIbmSchematicsAgentDeployCreate(context context.Context, d *schema.R d.SetId(fmt.Sprintf("%s/%s", *deployAgentJobOptions.AgentID, *agentDeployJob.JobID)) log.Printf("[INFO] Agent : %s", *deployAgentJobOptions.AgentID) - d.Set("status_message", *agentDeployJob.StatusMessage) _, err = isWaitForAgentAvailable(context, schematicsClient, *deployAgentJobOptions.AgentID, d.Timeout(schema.TimeoutCreate)) if err != nil { @@ -152,10 +151,13 @@ func isWaitForAgentAvailable(context context.Context, schematicsClient *schemati func agentRefreshFunc(schematicsClient *schematicsv1.SchematicsV1, id string) resource.StateRefreshFunc { return func() (interface{}, string, error) { getAgentDataOptions := &schematicsv1.GetAgentDataOptions{ - AgentID: core.StringPtr(id), - XFeatureAgents: core.BoolPtr(true), - Profile: core.StringPtr("detailed"), + AgentID: core.StringPtr(id), + Profile: core.StringPtr("detailed"), } + ff := map[string]string{ + "X-Feature-Agents": "true", + } + getAgentDataOptions.Headers = ff agent, response, err := schematicsClient.GetAgentData(getAgentDataOptions) if err != nil { @@ -180,9 +182,12 @@ func resourceIbmSchematicsAgentDeployRead(context context.Context, d *schema.Res } getAgentDataOptions := &schematicsv1.GetAgentDataOptions{ - XFeatureAgents: core.BoolPtr(true), - Profile: core.StringPtr("detailed"), + Profile: core.StringPtr("detailed"), + } + ff := map[string]string{ + "X-Feature-Agents": "true", } + getAgentDataOptions.Headers = ff getAgentDataOptions.SetAgentID(parts[0]) agentData, response, err := schematicsClient.GetAgentDataWithContext(context, getAgentDataOptions) @@ -269,7 +274,6 @@ func resourceIbmSchematicsAgentDeployUpdate(context context.Context, d *schema.R return diag.FromErr(fmt.Errorf("DeployAgentJobWithContext failed %s\n%s", err, response)) } d.SetId(fmt.Sprintf("%s/%s", *deployAgentJobOptions.AgentID, *agentDeployJob.JobID)) - d.Set("status_message", *agentDeployJob.StatusMessage) _, err = isWaitForAgentAvailable(context, schematicsClient, parts[0], d.Timeout(schema.TimeoutUpdate)) if err != nil { diff --git a/ibm/service/schematics/resource_ibm_schematics_agent_deploy_test.go b/ibm/service/schematics/resource_ibm_schematics_agent_deploy_test.go index bd73dc2fcf..da25827366 100644 --- a/ibm/service/schematics/resource_ibm_schematics_agent_deploy_test.go +++ b/ibm/service/schematics/resource_ibm_schematics_agent_deploy_test.go @@ -106,9 +106,13 @@ func testAccCheckIbmSchematicsAgentDeployExists(n string, obj *schematicsv1.Agen } getAgentDataOptions := &schematicsv1.GetAgentDataOptions{ - XFeatureAgents: core.BoolPtr(true), - Profile: core.StringPtr("detailed"), + // XFeatureAgents: core.BoolPtr(true), + Profile: core.StringPtr("detailed"), } + ff := map[string]string{ + "X-Feature-Agents": "true", + } + getAgentDataOptions.Headers = ff parts, err := flex.SepIdParts(rs.Primary.ID, "/") if err != nil { @@ -138,8 +142,8 @@ func testAccCheckIbmSchematicsAgentDeployDestroy(s *terraform.State) error { } getAgentDataOptions := &schematicsv1.GetAgentDataOptions{ - XFeatureAgents: core.BoolPtr(true), - Profile: core.StringPtr("detailed"), + // XFeatureAgents: core.BoolPtr(true), + Profile: core.StringPtr("detailed"), } parts, err := flex.SepIdParts(rs.Primary.ID, "/") diff --git a/ibm/service/schematics/resource_ibm_schematics_agent_health.go b/ibm/service/schematics/resource_ibm_schematics_agent_health.go index 01f9e5c34b..a49e9e63f9 100644 --- a/ibm/service/schematics/resource_ibm_schematics_agent_health.go +++ b/ibm/service/schematics/resource_ibm_schematics_agent_health.go @@ -124,9 +124,13 @@ func resourceIbmSchematicsAgentHealthRead(context context.Context, d *schema.Res } getAgentDataOptions := &schematicsv1.GetAgentDataOptions{ - XFeatureAgents: core.BoolPtr(true), - Profile: core.StringPtr("detailed"), + // XFeatureAgents: core.BoolPtr(true), + Profile: core.StringPtr("detailed"), } + ff := map[string]string{ + "X-Feature-Agents": "true", + } + getAgentDataOptions.Headers = ff getAgentDataOptions.SetAgentID(parts[0]) diff --git a/ibm/service/schematics/resource_ibm_schematics_agent_health_test.go b/ibm/service/schematics/resource_ibm_schematics_agent_health_test.go index 3b20dc5dd5..87577ec253 100644 --- a/ibm/service/schematics/resource_ibm_schematics_agent_health_test.go +++ b/ibm/service/schematics/resource_ibm_schematics_agent_health_test.go @@ -106,9 +106,13 @@ func testAccCheckIbmSchematicsAgentHealthExists(n string, obj *schematicsv1.Agen } getAgentDataOptions := &schematicsv1.GetAgentDataOptions{ - XFeatureAgents: core.BoolPtr(true), - Profile: core.StringPtr("detailed"), + // XFeatureAgents: core.BoolPtr(true), + Profile: core.StringPtr("detailed"), } + ff := map[string]string{ + "X-Feature-Agents": "true", + } + getAgentDataOptions.Headers = ff parts, err := flex.SepIdParts(rs.Primary.ID, "/") if err != nil { @@ -138,8 +142,8 @@ func testAccCheckIbmSchematicsAgentHealthDestroy(s *terraform.State) error { } getAgentDataOptions := &schematicsv1.GetAgentDataOptions{ - XFeatureAgents: core.BoolPtr(true), - Profile: core.StringPtr("detailed"), + // XFeatureAgents: core.BoolPtr(true), + Profile: core.StringPtr("detailed"), } parts, err := flex.SepIdParts(rs.Primary.ID, "/") diff --git a/ibm/service/schematics/resource_ibm_schematics_agent_prs.go b/ibm/service/schematics/resource_ibm_schematics_agent_prs.go index a672152b16..4bb0950451 100644 --- a/ibm/service/schematics/resource_ibm_schematics_agent_prs.go +++ b/ibm/service/schematics/resource_ibm_schematics_agent_prs.go @@ -123,9 +123,13 @@ func resourceIbmSchematicsAgentPrsRead(context context.Context, d *schema.Resour } getAgentDataOptions := &schematicsv1.GetAgentDataOptions{ - XFeatureAgents: core.BoolPtr(true), - Profile: core.StringPtr("detailed"), + // XFeatureAgents: core.BoolPtr(true), + Profile: core.StringPtr("detailed"), } + ff := map[string]string{ + "X-Feature-Agents": "true", + } + getAgentDataOptions.Headers = ff getAgentDataOptions.SetAgentID(parts[0]) diff --git a/ibm/service/schematics/resource_ibm_schematics_agent_prs_test.go b/ibm/service/schematics/resource_ibm_schematics_agent_prs_test.go index 66894e0125..5538cc95bd 100644 --- a/ibm/service/schematics/resource_ibm_schematics_agent_prs_test.go +++ b/ibm/service/schematics/resource_ibm_schematics_agent_prs_test.go @@ -105,8 +105,8 @@ func testAccCheckIbmSchematicsAgentPrsExists(n string, obj *schematicsv1.AgentDa } getAgentDataOptions := &schematicsv1.GetAgentDataOptions{ - XFeatureAgents: core.BoolPtr(true), - Profile: core.StringPtr("detailed"), + // XFeatureAgents: core.BoolPtr(true), + Profile: core.StringPtr("detailed"), } parts, err := flex.SepIdParts(rs.Primary.ID, "/") @@ -137,9 +137,13 @@ func testAccCheckIbmSchematicsAgentPrsDestroy(s *terraform.State) error { } getAgentDataOptions := &schematicsv1.GetAgentDataOptions{ - XFeatureAgents: core.BoolPtr(true), - Profile: core.StringPtr("detailed"), + // XFeatureAgents: core.BoolPtr(true), + Profile: core.StringPtr("detailed"), } + ff := map[string]string{ + "X-Feature-Agents": "true", + } + getAgentDataOptions.Headers = ff parts, err := flex.SepIdParts(rs.Primary.ID, "/") if err != nil { diff --git a/ibm/service/schematics/resource_ibm_schematics_agent_test.go b/ibm/service/schematics/resource_ibm_schematics_agent_test.go index b4fcbcc098..ac1be46629 100644 --- a/ibm/service/schematics/resource_ibm_schematics_agent_test.go +++ b/ibm/service/schematics/resource_ibm_schematics_agent_test.go @@ -13,7 +13,6 @@ import ( acc "github.com/IBM-Cloud/terraform-provider-ibm/ibm/acctest" "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" - "github.com/IBM/go-sdk-core/v5/core" "github.com/IBM/schematics-go-sdk/schematicsv1" ) @@ -205,7 +204,7 @@ func testAccCheckIbmSchematicsAgentExists(n string, obj schematicsv1.AgentData) } getAgentDataOptions := &schematicsv1.GetAgentDataOptions{ - XFeatureAgents: core.BoolPtr(true), + // XFeatureAgents: core.BoolPtr(true), } getAgentDataOptions.SetAgentID(rs.Primary.ID) @@ -231,8 +230,12 @@ func testAccCheckIbmSchematicsAgentDestroy(s *terraform.State) error { } getAgentDataOptions := &schematicsv1.GetAgentDataOptions{ - XFeatureAgents: core.BoolPtr(true), + // XFeatureAgents: core.BoolPtr(true), } + ff := map[string]string{ + "X-Feature-Agents": "true", + } + getAgentDataOptions.Headers = ff getAgentDataOptions.SetAgentID(rs.Primary.ID) diff --git a/ibm/service/schematics/resource_ibm_schematics_job.go b/ibm/service/schematics/resource_ibm_schematics_job.go index 4893b8b7ae..b8927e5101 100644 --- a/ibm/service/schematics/resource_ibm_schematics_job.go +++ b/ibm/service/schematics/resource_ibm_schematics_job.go @@ -3701,7 +3701,7 @@ func resourceIBMSchematicsJobMapToJobLogSummary(jobLogSummaryMap map[string]inte jobLogSummary.ElapsedTime = core.Float64Ptr(jobLogSummaryMap["elapsed_time"].(float64)) } if jobLogSummaryMap["log_errors"] != nil { - logErrors := []schematicsv1.JobLogSummaryLogErrors{} + logErrors := []schematicsv1.JobLogSummaryLogErrorsItem{} for _, logErrorsItem := range jobLogSummaryMap["log_errors"].([]interface{}) { logErrorsItemModel := resourceIBMSchematicsJobMapToJobLogSummaryLogErrors(logErrorsItem.(map[string]interface{})) logErrors = append(logErrors, logErrorsItemModel) @@ -3732,8 +3732,8 @@ func resourceIBMSchematicsJobMapToJobLogSummary(jobLogSummaryMap map[string]inte return jobLogSummary } -func resourceIBMSchematicsJobMapToJobLogSummaryLogErrors(jobLogSummaryLogErrorsMap map[string]interface{}) schematicsv1.JobLogSummaryLogErrors { - jobLogSummaryLogErrors := schematicsv1.JobLogSummaryLogErrors{} +func resourceIBMSchematicsJobMapToJobLogSummaryLogErrors(jobLogSummaryLogErrorsMap map[string]interface{}) schematicsv1.JobLogSummaryLogErrorsItem { + jobLogSummaryLogErrors := schematicsv1.JobLogSummaryLogErrorsItem{} if jobLogSummaryLogErrorsMap["error_code"] != nil { jobLogSummaryLogErrors.ErrorCode = core.StringPtr(jobLogSummaryLogErrorsMap["error_code"].(string)) @@ -4803,7 +4803,7 @@ func resourceIBMSchematicsJobJobLogSummaryToMap(jobLogSummary schematicsv1.JobLo return jobLogSummaryMap } -func resourceIBMSchematicsJobJobLogSummaryLogErrorsToMap(jobLogSummaryLogErrors schematicsv1.JobLogSummaryLogErrors) map[string]interface{} { +func resourceIBMSchematicsJobJobLogSummaryLogErrorsToMap(jobLogSummaryLogErrors schematicsv1.JobLogSummaryLogErrorsItem) map[string]interface{} { jobLogSummaryLogErrorsMap := map[string]interface{}{} if jobLogSummaryLogErrors.ErrorCode != nil { diff --git a/website/docs/d/schematics_workspace.html.markdown b/website/docs/d/schematics_workspace.html.markdown index 2f21acc368..4aa3a50e45 100644 --- a/website/docs/d/schematics_workspace.html.markdown +++ b/website/docs/d/schematics_workspace.html.markdown @@ -45,11 +45,7 @@ Nested scheme for **catalog_ref**: * `item_url` - (String) The URL to the software template in the IBM Cloud catalog. * `launch_url` - (String) The URL to the dashboard to access your software. * `offering_version` - (String) The version of the software template that you chose to install from the IBM Cloud catalog. - * `service_extensions` - (List) List of service data -Nested scheme for **service_extensions**: - * `name` - (String) Name of the Service Data. - * `value` - (String) Value of the Service Data. - * `type` - (String) Type of the value string, int, bool. + * `service_extensions` - (String) Service extensions defined as string of json * `created_at` - (String) The timestamp when the workspace was created.