@ -9,13 +9,13 @@ import (
"github.com/hashicorp/terraform-plugin-framework/types"
"github.com/hashicorp/terraform-plugin-framework/types/basetypes"
"github.com/hashicorp/terraform-plugin-log/tflog"
decort "repository.basistech.ru/BASIS/decort-golang-sdk"
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/bservice"
"repository.basistech.ru/BASIS/terraform-provider-dynamix/internal/client"
"repository.basistech.ru/BASIS/terraform-provider-dynamix/internal/service/cloudapi/bservice/models"
"repository.basistech.ru/BASIS/terraform-provider-dynamix/internal/status"
)
func BServiceGroupResourceCheckPresence ( ctx context . Context , serviceID uint64 , compGroupID uint64 , c * decort. Decort Client) ( * bservice . RecordGroup , error ) {
func BServiceGroupResourceCheckPresence ( ctx context . Context , serviceID uint64 , compGroupID uint64 , c * client. Client) ( * bservice . RecordGroup , error ) {
tflog . Info ( ctx , fmt . Sprintf ( "BServiceGroupResourceCheckPresence: Get info about bserivce group with ID - %v" , compGroupID ) )
req := bservice . GroupGetRequest { ServiceID : serviceID , CompGroupID : compGroupID }
@ -28,7 +28,7 @@ func BServiceGroupResourceCheckPresence(ctx context.Context, serviceID uint64, c
return record , err
}
func BServiceGroupResourceCreate ( ctx context . Context , plan * models . ResourceRecordGroupModel , c * decort. Decort Client) diag . Diagnostics {
func BServiceGroupResourceCreate ( ctx context . Context , plan * models . ResourceRecordGroupModel , c * client. Client) diag . Diagnostics {
tflog . Info ( ctx , "Start BServiceGroupResourceCreate" , map [ string ] any { "service" : plan . ServiceID . ValueInt64 ( ) } )
diags := diag . Diagnostics { }
@ -113,7 +113,7 @@ func BServiceGroupResourceCreate(ctx context.Context, plan *models.ResourceRecor
return diags
}
func BServiceGroupResize ( ctx context . Context , plan * models . ResourceRecordGroupModel , c * decort. Decort Client) diag . Diagnostics {
func BServiceGroupResize ( ctx context . Context , plan * models . ResourceRecordGroupModel , c * client. Client) diag . Diagnostics {
tflog . Info ( ctx , "BServiceGroupResize: start." , map [ string ] any { "service_id" : plan . ServiceID . ValueInt64 ( ) , "compgroup_id" : plan . CompgroupID . ValueInt64 ( ) } )
diags := diag . Diagnostics { }
@ -135,7 +135,7 @@ func BServiceGroupResize(ctx context.Context, plan *models.ResourceRecordGroupMo
return diags
}
func BServiceGroupUpdate ( ctx context . Context , plan * models . ResourceRecordGroupModel , c * decort. Decort Client) diag . Diagnostics {
func BServiceGroupUpdate ( ctx context . Context , plan * models . ResourceRecordGroupModel , c * client. Client) diag . Diagnostics {
tflog . Info ( ctx , "BServiceGroupUpdate: start." , map [ string ] any { "service_id" : plan . ServiceID . ValueInt64 ( ) , "compgroup_id" : plan . CompgroupID . ValueInt64 ( ) } )
diags := diag . Diagnostics { }
@ -161,7 +161,7 @@ func BServiceGroupUpdate(ctx context.Context, plan *models.ResourceRecordGroupMo
return diags
}
func BServiceGroupReadStatus ( ctx context . Context , plan * models . ResourceRecordGroupModel , c * decort. Decort Client) diag . Diagnostics {
func BServiceGroupReadStatus ( ctx context . Context , plan * models . ResourceRecordGroupModel , c * client. Client) diag . Diagnostics {
tflog . Info ( ctx , "Read status BServiceGroupReadStatus with ID" , map [ string ] any { "service_id" : plan . ServiceID . ValueInt64 ( ) } )
diags := diag . Diagnostics { }
@ -200,7 +200,7 @@ func BServiceGroupReadStatus(ctx context.Context, plan *models.ResourceRecordGro
return diags
}
func BServiceGroupStartStop ( ctx context . Context , plan * models . ResourceRecordGroupModel , c * decort. Decort Client) diag . Diagnostics {
func BServiceGroupStartStop ( ctx context . Context , plan * models . ResourceRecordGroupModel , c * client. Client) diag . Diagnostics {
tflog . Info ( ctx , "Start/Stop bservice group" , map [ string ] any { "service_id" : plan . ServiceID . ValueInt64 ( ) , "compgroup_id" : plan . CompgroupID . ValueInt64 ( ) } )
diags := diag . Diagnostics { }
@ -233,7 +233,7 @@ func BServiceGroupStartStop(ctx context.Context, plan *models.ResourceRecordGrou
return diags
}
func BServiceGroupExtNet ( ctx context . Context , plan * models . ResourceRecordGroupModel , c * decort. Decort Client) diag . Diagnostics {
func BServiceGroupExtNet ( ctx context . Context , plan * models . ResourceRecordGroupModel , c * client. Client) diag . Diagnostics {
tflog . Info ( ctx , "update ExtNets" , map [ string ] any { "service_id" : plan . ServiceID . ValueInt64 ( ) , "compgroup_id" : plan . CompgroupID . ValueInt64 ( ) } )
diags := diag . Diagnostics { }
@ -262,7 +262,7 @@ func BServiceGroupExtNet(ctx context.Context, plan *models.ResourceRecordGroupMo
return diags
}
func BServiceGroupVinses ( ctx context . Context , plan * models . ResourceRecordGroupModel , c * decort. Decort Client) diag . Diagnostics {
func BServiceGroupVinses ( ctx context . Context , plan * models . ResourceRecordGroupModel , c * client. Client) diag . Diagnostics {
tflog . Info ( ctx , "update Vinses" , map [ string ] any { "service_id" : plan . ServiceID . ValueInt64 ( ) , "compgroup_id" : plan . CompgroupID . ValueInt64 ( ) } )
diags := diag . Diagnostics { }
@ -291,7 +291,7 @@ func BServiceGroupVinses(ctx context.Context, plan *models.ResourceRecordGroupMo
return diags
}
func BServiceGroupParents ( ctx context . Context , newParents basetypes . ListValue , oldParents basetypes . ListValue , plan * models . ResourceRecordGroupModel , c * decort. Decort Client) diag . Diagnostics {
func BServiceGroupParents ( ctx context . Context , newParents basetypes . ListValue , oldParents basetypes . ListValue , plan * models . ResourceRecordGroupModel , c * client. Client) diag . Diagnostics {
diags := diag . Diagnostics { }
tflog . Info ( ctx , "Start BServiceGroupParents" , map [ string ] any { "service_id" : plan . ServiceID . ValueInt64 ( ) , "compgroup_id" : plan . CompgroupID . ValueInt64 ( ) } )
@ -364,7 +364,7 @@ func BServiceGroupParents(ctx context.Context, newParents basetypes.ListValue, o
return diags
}
func BServiceGroupRemoveComputes ( ctx context . Context , plan * models . ResourceRecordGroupModel , c * decort. Decort Client) diag . Diagnostics {
func BServiceGroupRemoveComputes ( ctx context . Context , plan * models . ResourceRecordGroupModel , c * client. Client) diag . Diagnostics {
diags := diag . Diagnostics { }
rcs := plan . RemoveComputes