This commit is contained in:
asteam
2024-12-04 13:18:58 +03:00
parent 003e4d656e
commit 76ea459b3d
417 changed files with 30051 additions and 975 deletions

View File

@@ -37,6 +37,7 @@ func AccountFlipgroupsListDataSource(ctx context.Context, state *models.DataSour
ExtNetID: state.ExtNetID,
ByIP: state.ByIP,
FLIPGroupID: state.FLIPGroupID,
SortBy: state.SortBy,
Page: state.Page,
Size: state.Size,
Timeouts: state.Timeouts,

View File

@@ -14,6 +14,7 @@ type DataSourceAccountFlipgroupsListModel struct {
ExtNetID types.Int64 `tfsdk:"extnet_id"`
ByIP types.String `tfsdk:"by_ip"`
FLIPGroupID types.Int64 `tfsdk:"flipgroup_id"`
SortBy types.String `tfsdk:"sort_by"`
Page types.Int64 `tfsdk:"page"`
Size types.Int64 `tfsdk:"size"`
Timeouts timeouts.Value `tfsdk:"timeouts"`

View File

@@ -50,9 +50,8 @@ type ResourceAccountModel struct {
}
type UsersModel struct {
UserID types.String `tfsdk:"user_id"`
AccessType types.String `tfsdk:"access_type"`
RecursiveDelete types.Bool `tfsdk:"recursive_delete"`
UserID types.String `tfsdk:"user_id"`
AccessType types.String `tfsdk:"access_type"`
}
type ResourceLimitsInAccountResourceModel struct {

View File

@@ -37,6 +37,10 @@ func MakeSchemaDataSourceAccountFlipgroupsList() map[string]schema.Attribute {
Optional: true,
Description: "find by flipgroup id",
},
"sort_by": schema.StringAttribute{
Optional: true,
Description: "sort by one of supported fields, format +|-(field)",
},
"page": schema.Int64Attribute{
Optional: true,
Description: "page number",

View File

@@ -38,10 +38,6 @@ func MakeSchemaResourceAccount() map[string]schema.Attribute {
"access_type": schema.StringAttribute{
Required: true,
},
"recursive_delete": schema.BoolAttribute{
Optional: true,
// default is false
},
},
},
},

View File

@@ -33,6 +33,9 @@ func AccountFlipgroupsListCheckPresence(ctx context.Context, plan *models.DataSo
if !plan.FLIPGroupID.IsNull() {
flipgroupsListReq.FLIPGroupID = uint64(plan.FLIPGroupID.ValueInt64())
}
if !plan.SortBy.IsNull() {
flipgroupsListReq.SortBy = plan.SortBy.ValueString()
}
if !plan.Page.IsNull() {
flipgroupsListReq.Page = uint64(plan.Page.ValueInt64())
}

View File

@@ -298,9 +298,8 @@ func AddDeleteUsersAccount(ctx context.Context, accountId uint64, plan, state *m
for _, user := range deletedUsers {
delUserReq := account.DeleteUserRequest{
AccountID: accountId,
UserID: user.UserID.ValueString(),
RecursiveDelete: user.RecursiveDelete.ValueBool(), // default false
AccountID: accountId,
UserID: user.UserID.ValueString(),
}
tflog.Info(ctx, "AddDeleteUsersAccount: before calling CloudAPI().Account().DeleteUser", map[string]any{"account_id": accountId, "req": delUserReq})