chore: adjust pagination for postgres database and flavor listing (#20)
* feat: implement pagination for database listing * fix: change database_id attribute type from string to int64 * refactor: rename getDatabase to getDatabaseById for clarity * fix: improve error handling for database not found scenario * feat: add validation for database_id and name attributes; implement separate functions for fetching databases by ID and name * feat: implement database client interface and update database fetching functions * refactor: rename matcher to filter for clarity and update pagination logic * feat: implement flavors retrieval with pagination and filtering support * refactor: rename flavor import for consistency and clarity * feat: add support for InstanceStatePending in wait handler logic * refactor: simplify GetFlavorsRequest and GetFlavorsRequestExecute by removing pagination parameters * refactor: improve readability of test cases by formatting function signatures and restructuring test runs * refactor: remove pagination parameters from GetFlavorsRequest in test case * refactor: simplify function signatures and improve readability in datasource and resource files * refactor: add descriptions for user-related attributes in datasource schema * refactor: enhance user resource schema with additional attributes and improve logging * refactor: delete unused file * refactor: standardize formatting and improve function naming for user resource management * refactor: remove skip from TestMapFields and update roles initialization in resource tests * fix: golangci lint issues * fix: golangci lint issues again * fix: golangci lint issues again
This commit is contained in:
parent
0150fea302
commit
979220be66
26 changed files with 3630 additions and 2759 deletions
|
|
@ -89,6 +89,10 @@ func (r *userDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, r
|
|||
"user_id": "User ID.",
|
||||
"instance_id": "ID of the PostgresFlex instance.",
|
||||
"project_id": "STACKIT project ID to which the instance is associated.",
|
||||
"username": "The name of the user.",
|
||||
"roles": "The roles assigned to the user.",
|
||||
"host": "The host address for the user to connect to the instance.",
|
||||
"port": "The port number for the user to connect to the instance.",
|
||||
"region": "The resource region. If not defined, the provider region is used.",
|
||||
"status": "The current status of the user.",
|
||||
"connection_string": "The connection string for the user to the instance.",
|
||||
|
|
@ -125,17 +129,21 @@ func (r *userDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, r
|
|||
},
|
||||
},
|
||||
"username": schema.StringAttribute{
|
||||
Computed: true,
|
||||
Description: descriptions["username"],
|
||||
Computed: true,
|
||||
},
|
||||
"roles": schema.SetAttribute{
|
||||
Description: descriptions["roles"],
|
||||
ElementType: types.StringType,
|
||||
Computed: true,
|
||||
},
|
||||
"host": schema.StringAttribute{
|
||||
Computed: true,
|
||||
Description: descriptions["host"],
|
||||
Computed: true,
|
||||
},
|
||||
"port": schema.Int64Attribute{
|
||||
Computed: true,
|
||||
Description: descriptions["port"],
|
||||
Computed: true,
|
||||
},
|
||||
"region": schema.StringAttribute{
|
||||
// the region cannot be found automatically, so it has to be passed
|
||||
|
|
@ -143,10 +151,12 @@ func (r *userDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, r
|
|||
Description: descriptions["region"],
|
||||
},
|
||||
"status": schema.StringAttribute{
|
||||
Computed: true,
|
||||
Description: descriptions["status"],
|
||||
Computed: true,
|
||||
},
|
||||
"connection_string": schema.StringAttribute{
|
||||
Computed: true,
|
||||
Description: descriptions["connection_string"],
|
||||
Computed: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue