Add context to DecortAPICall method
This commit is contained in:
@@ -41,7 +41,7 @@ import (
|
||||
)
|
||||
|
||||
func dataSourceBasicServiceRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
|
||||
bs, err := utilityBasicServiceCheckPresence(d, m)
|
||||
bs, err := utilityBasicServiceCheckPresence(ctx, d, m)
|
||||
if err != nil {
|
||||
return diag.FromErr(err)
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ import (
|
||||
)
|
||||
|
||||
func dataSourceBasicServiceDeletedListRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
|
||||
basicServiceDeletedList, err := utilityBasicServiceDeletedListCheckPresence(d, m)
|
||||
basicServiceDeletedList, err := utilityBasicServiceDeletedListCheckPresence(ctx, d, m)
|
||||
if err != nil {
|
||||
return diag.FromErr(err)
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ import (
|
||||
)
|
||||
|
||||
func dataSourceBasicServiceGroupRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
|
||||
bsg, err := utilityBasicServiceGroupCheckPresence(d, m)
|
||||
bsg, err := utilityBasicServiceGroupCheckPresence(ctx, d, m)
|
||||
if err != nil {
|
||||
return diag.FromErr(err)
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ func flattenBasicServiceList(bsl BasicServiceList) []map[string]interface{} {
|
||||
}
|
||||
|
||||
func dataSourceBasicServiceListRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
|
||||
basicServiceList, err := utilityBasicServiceListCheckPresence(d, m)
|
||||
basicServiceList, err := utilityBasicServiceListCheckPresence(ctx, d, m)
|
||||
if err != nil {
|
||||
return diag.FromErr(err)
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ import (
|
||||
)
|
||||
|
||||
func dataSourceBasicServiceSnapshotListRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
|
||||
basicServiceSnapshotList, err := utilityBasicServiceSnapshotListCheckPresence(d, m)
|
||||
basicServiceSnapshotList, err := utilityBasicServiceSnapshotListCheckPresence(ctx, d, m)
|
||||
if err != nil {
|
||||
return diag.FromErr(err)
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ func resourceBasicServiceCreate(ctx context.Context, d *schema.ResourceData, m i
|
||||
log.Debugf("resourceBasicServiceCreate")
|
||||
|
||||
if serviceId, ok := d.GetOk("service_id"); ok {
|
||||
if exists, err := resourceBasicServiceExists(d, m); exists {
|
||||
if exists, err := resourceBasicServiceExists(ctx, d, m); exists {
|
||||
if err != nil {
|
||||
return diag.FromErr(err)
|
||||
}
|
||||
@@ -78,7 +78,7 @@ func resourceBasicServiceCreate(ctx context.Context, d *schema.ResourceData, m i
|
||||
urlValues.Add("sshUser", sshUser.(string))
|
||||
}
|
||||
|
||||
serviceId, err := c.DecortAPICall("POST", bserviceCreateAPI, urlValues)
|
||||
serviceId, err := c.DecortAPICall(ctx, "POST", bserviceCreateAPI, urlValues)
|
||||
if err != nil {
|
||||
return diag.FromErr(err)
|
||||
}
|
||||
@@ -100,7 +100,7 @@ func resourceBasicServiceCreate(ctx context.Context, d *schema.ResourceData, m i
|
||||
func resourceBasicServiceRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
|
||||
log.Debugf("resourceBasicServiceRead")
|
||||
|
||||
bs, err := utilityBasicServiceCheckPresence(d, m)
|
||||
bs, err := utilityBasicServiceCheckPresence(ctx, d, m)
|
||||
if bs == nil {
|
||||
d.SetId("")
|
||||
return diag.FromErr(err)
|
||||
@@ -143,7 +143,7 @@ func resourceBasicServiceRead(ctx context.Context, d *schema.ResourceData, m int
|
||||
func resourceBasicServiceDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
|
||||
log.Debugf("resourceBasicServiceDelete")
|
||||
|
||||
bs, err := utilityBasicServiceCheckPresence(d, m)
|
||||
bs, err := utilityBasicServiceCheckPresence(ctx, d, m)
|
||||
if bs == nil {
|
||||
if err != nil {
|
||||
return diag.FromErr(err)
|
||||
@@ -156,7 +156,7 @@ func resourceBasicServiceDelete(ctx context.Context, d *schema.ResourceData, m i
|
||||
urlValues.Add("serviceId", strconv.Itoa(d.Get("service_id").(int)))
|
||||
urlValues.Add("permanently", strconv.FormatBool(d.Get("permanently").(bool)))
|
||||
|
||||
_, err = c.DecortAPICall("POST", bserviceDeleteAPI, urlValues)
|
||||
_, err = c.DecortAPICall(ctx, "POST", bserviceDeleteAPI, urlValues)
|
||||
if err != nil {
|
||||
return diag.FromErr(err)
|
||||
}
|
||||
@@ -165,10 +165,10 @@ func resourceBasicServiceDelete(ctx context.Context, d *schema.ResourceData, m i
|
||||
return nil
|
||||
}
|
||||
|
||||
func resourceBasicServiceExists(d *schema.ResourceData, m interface{}) (bool, error) {
|
||||
func resourceBasicServiceExists(ctx context.Context, d *schema.ResourceData, m interface{}) (bool, error) {
|
||||
log.Debugf("resourceBasicServiceExists")
|
||||
|
||||
bservice, err := utilityBasicServiceCheckPresence(d, m)
|
||||
bservice, err := utilityBasicServiceCheckPresence(ctx, d, m)
|
||||
if bservice == nil {
|
||||
if err != nil {
|
||||
return false, err
|
||||
@@ -192,7 +192,7 @@ func resourceBasicServiceEdit(ctx context.Context, d *schema.ResourceData, m int
|
||||
}
|
||||
urlValues.Add("serviceId", strconv.Itoa(d.Get("service_id").(int)))
|
||||
|
||||
_, err := c.DecortAPICall("POST", api, urlValues)
|
||||
_, err := c.DecortAPICall(ctx, "POST", api, urlValues)
|
||||
if err != nil {
|
||||
return diag.FromErr(err)
|
||||
}
|
||||
@@ -204,7 +204,7 @@ func resourceBasicServiceEdit(ctx context.Context, d *schema.ResourceData, m int
|
||||
restore := d.Get("restore").(bool)
|
||||
if restore {
|
||||
urlValues.Add("serviceId", strconv.Itoa(d.Get("service_id").(int)))
|
||||
_, err := c.DecortAPICall("POST", bserviceRestoreAPI, urlValues)
|
||||
_, err := c.DecortAPICall(ctx, "POST", bserviceRestoreAPI, urlValues)
|
||||
if err != nil {
|
||||
return diag.FromErr(err)
|
||||
}
|
||||
@@ -221,7 +221,7 @@ func resourceBasicServiceEdit(ctx context.Context, d *schema.ResourceData, m int
|
||||
}
|
||||
urlValues.Add("serviceId", strconv.Itoa(d.Get("service_id").(int)))
|
||||
|
||||
_, err := c.DecortAPICall("POST", api, urlValues)
|
||||
_, err := c.DecortAPICall(ctx, "POST", api, urlValues)
|
||||
if err != nil {
|
||||
return diag.FromErr(err)
|
||||
}
|
||||
@@ -257,7 +257,7 @@ func resourceBasicServiceEdit(ctx context.Context, d *schema.ResourceData, m int
|
||||
snapshotConv := snapshot.(map[string]interface{})
|
||||
urlValues.Add("serviceId", strconv.Itoa(d.Get("service_id").(int)))
|
||||
urlValues.Add("label", snapshotConv["label"].(string))
|
||||
_, err := c.DecortAPICall("POST", bserviceSnapshotDeleteAPI, urlValues)
|
||||
_, err := c.DecortAPICall(ctx, "POST", bserviceSnapshotDeleteAPI, urlValues)
|
||||
if err != nil {
|
||||
return diag.FromErr(err)
|
||||
}
|
||||
@@ -271,7 +271,7 @@ func resourceBasicServiceEdit(ctx context.Context, d *schema.ResourceData, m int
|
||||
snapshotConv := snapshot.(map[string]interface{})
|
||||
urlValues.Add("serviceId", strconv.Itoa(d.Get("service_id").(int)))
|
||||
urlValues.Add("label", snapshotConv["label"].(string))
|
||||
_, err := c.DecortAPICall("POST", bserviceSnapshotCreateAPI, urlValues)
|
||||
_, err := c.DecortAPICall(ctx, "POST", bserviceSnapshotCreateAPI, urlValues)
|
||||
if err != nil {
|
||||
return diag.FromErr(err)
|
||||
}
|
||||
@@ -285,7 +285,7 @@ func resourceBasicServiceEdit(ctx context.Context, d *schema.ResourceData, m int
|
||||
snapshotConv := snapshot.(map[string]interface{})
|
||||
urlValues.Add("serviceId", strconv.Itoa(d.Get("service_id").(int)))
|
||||
urlValues.Add("label", snapshotConv["label"].(string))
|
||||
_, err := c.DecortAPICall("POST", bserviceSnapshotRollbackAPI, urlValues)
|
||||
_, err := c.DecortAPICall(ctx, "POST", bserviceSnapshotRollbackAPI, urlValues)
|
||||
if err != nil {
|
||||
return diag.FromErr(err)
|
||||
}
|
||||
@@ -545,7 +545,6 @@ func ResourceBasicService() *schema.Resource {
|
||||
ReadContext: resourceBasicServiceRead,
|
||||
UpdateContext: resourceBasicServiceEdit,
|
||||
DeleteContext: resourceBasicServiceDelete,
|
||||
Exists: resourceBasicServiceExists,
|
||||
|
||||
Importer: &schema.ResourceImporter{
|
||||
State: schema.ImportStatePassthrough,
|
||||
|
||||
@@ -51,7 +51,7 @@ func resourceBasicServiceGroupCreate(ctx context.Context, d *schema.ResourceData
|
||||
|
||||
if compgroupId, ok := d.GetOk("compgroup_id"); ok {
|
||||
if _, ok := d.GetOk("service_id"); ok {
|
||||
if exists, err := resourceBasicServiceGroupExists(d, m); exists {
|
||||
if exists, err := resourceBasicServiceGroupExists(ctx, d, m); exists {
|
||||
if err != nil {
|
||||
return diag.FromErr(err)
|
||||
}
|
||||
@@ -119,7 +119,7 @@ func resourceBasicServiceGroupCreate(ctx context.Context, d *schema.ResourceData
|
||||
urlValues.Add("extnets", temp)
|
||||
}
|
||||
|
||||
compgroupId, err := c.DecortAPICall("POST", bserviceGroupAddAPI, urlValues)
|
||||
compgroupId, err := c.DecortAPICall(ctx, "POST", bserviceGroupAddAPI, urlValues)
|
||||
if err != nil {
|
||||
return diag.FromErr(err)
|
||||
}
|
||||
@@ -141,7 +141,7 @@ func resourceBasicServiceGroupCreate(ctx context.Context, d *schema.ResourceData
|
||||
func resourceBasicServiceGroupRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
|
||||
log.Debugf("resourceBasicServiceGroupRead")
|
||||
|
||||
bsg, err := utilityBasicServiceGroupCheckPresence(d, m)
|
||||
bsg, err := utilityBasicServiceGroupCheckPresence(ctx, d, m)
|
||||
if bsg == nil {
|
||||
d.SetId("")
|
||||
return diag.FromErr(err)
|
||||
@@ -185,7 +185,7 @@ func resourceBasicServiceGroupRead(ctx context.Context, d *schema.ResourceData,
|
||||
func resourceBasicServiceGroupDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
|
||||
log.Debugf("resourceBasicServiceGroupDelete")
|
||||
|
||||
bsg, err := utilityBasicServiceGroupCheckPresence(d, m)
|
||||
bsg, err := utilityBasicServiceGroupCheckPresence(ctx, d, m)
|
||||
if bsg == nil {
|
||||
if err != nil {
|
||||
return diag.FromErr(err)
|
||||
@@ -198,7 +198,7 @@ func resourceBasicServiceGroupDelete(ctx context.Context, d *schema.ResourceData
|
||||
urlValues.Add("serviceId", strconv.Itoa(d.Get("service_id").(int)))
|
||||
urlValues.Add("compgroupId", strconv.Itoa(d.Get("compgroup_id").(int)))
|
||||
|
||||
_, err = c.DecortAPICall("POST", bserviceGroupRemoveAPI, urlValues)
|
||||
_, err = c.DecortAPICall(ctx, "POST", bserviceGroupRemoveAPI, urlValues)
|
||||
if err != nil {
|
||||
return diag.FromErr(err)
|
||||
}
|
||||
@@ -207,10 +207,10 @@ func resourceBasicServiceGroupDelete(ctx context.Context, d *schema.ResourceData
|
||||
return nil
|
||||
}
|
||||
|
||||
func resourceBasicServiceGroupExists(d *schema.ResourceData, m interface{}) (bool, error) {
|
||||
func resourceBasicServiceGroupExists(ctx context.Context, d *schema.ResourceData, m interface{}) (bool, error) {
|
||||
log.Debugf("resourceBasicServiceGroupExists")
|
||||
|
||||
bserviceGroup, err := utilityBasicServiceGroupCheckPresence(d, m)
|
||||
bserviceGroup, err := utilityBasicServiceGroupCheckPresence(ctx, d, m)
|
||||
if bserviceGroup == nil {
|
||||
if err != nil {
|
||||
return false, err
|
||||
@@ -232,7 +232,7 @@ func resourceBasicServiceGroupEdit(ctx context.Context, d *schema.ResourceData,
|
||||
urlValues.Add("compgroupId", strconv.Itoa(d.Get("compgroup_id").(int)))
|
||||
urlValues.Add("count", strconv.Itoa(d.Get("comp_count").(int)))
|
||||
urlValues.Add("mode", strings.ToUpper(d.Get("mode").(string)))
|
||||
_, err := c.DecortAPICall("POST", bserviceGroupResizeAPI, urlValues)
|
||||
_, err := c.DecortAPICall(ctx, "POST", bserviceGroupResizeAPI, urlValues)
|
||||
if err != nil {
|
||||
return diag.FromErr(err)
|
||||
}
|
||||
@@ -251,7 +251,7 @@ func resourceBasicServiceGroupEdit(ctx context.Context, d *schema.ResourceData,
|
||||
urlValues.Add("serviceId", strconv.Itoa(d.Get("service_id").(int)))
|
||||
urlValues.Add("compgroupId", strconv.Itoa(d.Get("compgroup_id").(int)))
|
||||
|
||||
_, err := c.DecortAPICall("POST", api, urlValues)
|
||||
_, err := c.DecortAPICall(ctx, "POST", api, urlValues)
|
||||
if err != nil {
|
||||
return diag.FromErr(err)
|
||||
}
|
||||
@@ -270,7 +270,7 @@ func resourceBasicServiceGroupEdit(ctx context.Context, d *schema.ResourceData,
|
||||
urlValues.Add("serviceId", strconv.Itoa(d.Get("service_id").(int)))
|
||||
urlValues.Add("compgroupId", strconv.Itoa(d.Get("compgroup_id").(int)))
|
||||
|
||||
_, err := c.DecortAPICall("POST", bserviceGroupUpdateAPI, urlValues)
|
||||
_, err := c.DecortAPICall(ctx, "POST", bserviceGroupUpdateAPI, urlValues)
|
||||
if err != nil {
|
||||
return diag.FromErr(err)
|
||||
}
|
||||
@@ -296,7 +296,7 @@ func resourceBasicServiceGroupEdit(ctx context.Context, d *schema.ResourceData,
|
||||
urlValues.Add("serviceId", strconv.Itoa(d.Get("service_id").(int)))
|
||||
urlValues.Add("compgroupId", strconv.Itoa(d.Get("compgroup_id").(int)))
|
||||
urlValues.Add("extnets", temp)
|
||||
_, err := c.DecortAPICall("POST", bserviceGroupUpdateExtnetAPI, urlValues)
|
||||
_, err := c.DecortAPICall(ctx, "POST", bserviceGroupUpdateExtnetAPI, urlValues)
|
||||
if err != nil {
|
||||
return diag.FromErr(err)
|
||||
}
|
||||
@@ -322,7 +322,7 @@ func resourceBasicServiceGroupEdit(ctx context.Context, d *schema.ResourceData,
|
||||
urlValues.Add("serviceId", strconv.Itoa(d.Get("service_id").(int)))
|
||||
urlValues.Add("compgroupId", strconv.Itoa(d.Get("compgroup_id").(int)))
|
||||
urlValues.Add("vinses", temp)
|
||||
_, err := c.DecortAPICall("POST", bserviceGroupUpdateVinsAPI, urlValues)
|
||||
_, err := c.DecortAPICall(ctx, "POST", bserviceGroupUpdateVinsAPI, urlValues)
|
||||
if err != nil {
|
||||
return diag.FromErr(err)
|
||||
}
|
||||
@@ -356,7 +356,7 @@ func resourceBasicServiceGroupEdit(ctx context.Context, d *schema.ResourceData,
|
||||
urlValues.Add("compgroupId", strconv.Itoa(d.Get("compgroup_id").(int)))
|
||||
urlValues.Add("parentId", strconv.Itoa(parentConv))
|
||||
|
||||
_, err := c.DecortAPICall("POST", bserviceGroupParentRemoveAPI, urlValues)
|
||||
_, err := c.DecortAPICall(ctx, "POST", bserviceGroupParentRemoveAPI, urlValues)
|
||||
if err != nil {
|
||||
return diag.FromErr(err)
|
||||
}
|
||||
@@ -371,7 +371,7 @@ func resourceBasicServiceGroupEdit(ctx context.Context, d *schema.ResourceData,
|
||||
urlValues.Add("serviceId", strconv.Itoa(d.Get("service_id").(int)))
|
||||
urlValues.Add("compgroupId", strconv.Itoa(d.Get("compgroup_id").(int)))
|
||||
urlValues.Add("parentId", strconv.Itoa(parentConv))
|
||||
_, err := c.DecortAPICall("POST", bserviceGroupParentAddAPI, urlValues)
|
||||
_, err := c.DecortAPICall(ctx, "POST", bserviceGroupParentAddAPI, urlValues)
|
||||
if err != nil {
|
||||
return diag.FromErr(err)
|
||||
}
|
||||
@@ -389,7 +389,7 @@ func resourceBasicServiceGroupEdit(ctx context.Context, d *schema.ResourceData,
|
||||
urlValues.Add("compgroupId", strconv.Itoa(d.Get("compgroup_id").(int)))
|
||||
urlValues.Add("computeId", strconv.Itoa(rc.(int)))
|
||||
|
||||
_, err := c.DecortAPICall("POST", bserviceGroupComputeRemoveAPI, urlValues)
|
||||
_, err := c.DecortAPICall(ctx, "POST", bserviceGroupComputeRemoveAPI, urlValues)
|
||||
if err != nil {
|
||||
return diag.FromErr(err)
|
||||
}
|
||||
@@ -652,7 +652,6 @@ func ResourceBasicServiceGroup() *schema.Resource {
|
||||
ReadContext: resourceBasicServiceGroupRead,
|
||||
UpdateContext: resourceBasicServiceGroupEdit,
|
||||
DeleteContext: resourceBasicServiceGroupDelete,
|
||||
Exists: resourceBasicServiceGroupExists,
|
||||
|
||||
Importer: &schema.ResourceImporter{
|
||||
State: schema.ImportStatePassthrough,
|
||||
|
||||
@@ -32,6 +32,7 @@ Documentation: https://github.com/rudecs/terraform-provider-decort/wiki
|
||||
package bservice
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"net/url"
|
||||
"strconv"
|
||||
@@ -42,7 +43,7 @@ import (
|
||||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
|
||||
)
|
||||
|
||||
func utilityBasicServiceDeletedListCheckPresence(d *schema.ResourceData, m interface{}) (BasicServiceList, error) {
|
||||
func utilityBasicServiceDeletedListCheckPresence(ctx context.Context, d *schema.ResourceData, m interface{}) (BasicServiceList, error) {
|
||||
basicServiceDeletedList := BasicServiceList{}
|
||||
c := m.(*controller.ControllerCfg)
|
||||
urlValues := &url.Values{}
|
||||
@@ -61,7 +62,7 @@ func utilityBasicServiceDeletedListCheckPresence(d *schema.ResourceData, m inter
|
||||
}
|
||||
|
||||
log.Debugf("utilityBasicServiceDeletedListCheckPresence")
|
||||
basicServiceDeletedListRaw, err := c.DecortAPICall("POST", bserviceListDeletedAPI, urlValues)
|
||||
basicServiceDeletedListRaw, err := c.DecortAPICall(ctx, "POST", bserviceListDeletedAPI, urlValues)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ Documentation: https://github.com/rudecs/terraform-provider-decort/wiki
|
||||
package bservice
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"net/url"
|
||||
"strconv"
|
||||
@@ -42,7 +43,7 @@ import (
|
||||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
|
||||
)
|
||||
|
||||
func utilityBasicServiceCheckPresence(d *schema.ResourceData, m interface{}) (*BasicServiceExtend, error) {
|
||||
func utilityBasicServiceCheckPresence(ctx context.Context, d *schema.ResourceData, m interface{}) (*BasicServiceExtend, error) {
|
||||
bservice := &BasicServiceExtend{}
|
||||
c := m.(*controller.ControllerCfg)
|
||||
urlValues := &url.Values{}
|
||||
@@ -54,7 +55,7 @@ func utilityBasicServiceCheckPresence(d *schema.ResourceData, m interface{}) (*B
|
||||
}
|
||||
|
||||
log.Debugf("utilityBasicServiceCheckPresence")
|
||||
bserviceRaw, err := c.DecortAPICall("POST", bserviceGetAPI, urlValues)
|
||||
bserviceRaw, err := c.DecortAPICall(ctx, "POST", bserviceGetAPI, urlValues)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ Documentation: https://github.com/rudecs/terraform-provider-decort/wiki
|
||||
package bservice
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"net/url"
|
||||
"strconv"
|
||||
@@ -42,7 +43,7 @@ import (
|
||||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
|
||||
)
|
||||
|
||||
func utilityBasicServiceGroupCheckPresence(d *schema.ResourceData, m interface{}) (*BasicServiceGroup, error) {
|
||||
func utilityBasicServiceGroupCheckPresence(ctx context.Context, d *schema.ResourceData, m interface{}) (*BasicServiceGroup, error) {
|
||||
bserviceGroup := &BasicServiceGroup{}
|
||||
c := m.(*controller.ControllerCfg)
|
||||
urlValues := &url.Values{}
|
||||
@@ -55,7 +56,7 @@ func utilityBasicServiceGroupCheckPresence(d *schema.ResourceData, m interface{}
|
||||
}
|
||||
|
||||
log.Debugf("utilityBasicServiceGroupCheckPresence")
|
||||
bserviceGroupRaw, err := c.DecortAPICall("POST", bserviceGroupGetAPI, urlValues)
|
||||
bserviceGroupRaw, err := c.DecortAPICall(ctx, "POST", bserviceGroupGetAPI, urlValues)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ Documentation: https://github.com/rudecs/terraform-provider-decort/wiki
|
||||
package bservice
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"net/url"
|
||||
"strconv"
|
||||
@@ -42,7 +43,7 @@ import (
|
||||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
|
||||
)
|
||||
|
||||
func utilityBasicServiceListCheckPresence(d *schema.ResourceData, m interface{}) (BasicServiceList, error) {
|
||||
func utilityBasicServiceListCheckPresence(ctx context.Context, d *schema.ResourceData, m interface{}) (BasicServiceList, error) {
|
||||
basicServiceList := BasicServiceList{}
|
||||
c := m.(*controller.ControllerCfg)
|
||||
urlValues := &url.Values{}
|
||||
@@ -61,7 +62,7 @@ func utilityBasicServiceListCheckPresence(d *schema.ResourceData, m interface{})
|
||||
}
|
||||
|
||||
log.Debugf("utilityBasicServiceListCheckPresence")
|
||||
basicServiceListRaw, err := c.DecortAPICall("POST", bserviceListAPI, urlValues)
|
||||
basicServiceListRaw, err := c.DecortAPICall(ctx, "POST", bserviceListAPI, urlValues)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ Documentation: https://github.com/rudecs/terraform-provider-decort/wiki
|
||||
package bservice
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"net/url"
|
||||
"strconv"
|
||||
@@ -42,7 +43,7 @@ import (
|
||||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
|
||||
)
|
||||
|
||||
func utilityBasicServiceSnapshotListCheckPresence(d *schema.ResourceData, m interface{}) (BasicServiceSnapshots, error) {
|
||||
func utilityBasicServiceSnapshotListCheckPresence(ctx context.Context, d *schema.ResourceData, m interface{}) (BasicServiceSnapshots, error) {
|
||||
basicServiceSnapshotList := BasicServiceSnapshots{}
|
||||
c := m.(*controller.ControllerCfg)
|
||||
urlValues := &url.Values{}
|
||||
@@ -52,7 +53,7 @@ func utilityBasicServiceSnapshotListCheckPresence(d *schema.ResourceData, m inte
|
||||
}
|
||||
|
||||
log.Debugf("utilityBasicServiceSnapshotListCheckPresence")
|
||||
basicServiceSnapshotListRaw, err := c.DecortAPICall("POST", bserviceSnapshotListAPI, urlValues)
|
||||
basicServiceSnapshotListRaw, err := c.DecortAPICall(ctx, "POST", bserviceSnapshotListAPI, urlValues)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user