feat: add datalab integration#3841
Open
sbx0r wants to merge 13 commits intoscaleway:mainfrom
Open
Conversation
ab0ce3f to
15964bd
Compare
remyleone
reviewed
Mar 30, 2026
|
|
||
| func (d *DatalabDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) { | ||
| resp.Schema = schema.Schema{ | ||
| MarkdownDescription: "", |
Member
There was a problem hiding this comment.
Could you add a description here?
|
|
||
| func (d *DatalabsDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) { | ||
| resp.Schema = schema.Schema{ | ||
| MarkdownDescription: "", |
Member
There was a problem hiding this comment.
Could you add a description here?
| listReq.Page = &page | ||
| listReq.PageSize = &pageSize | ||
|
|
||
| listResp, listErr := d.api.ListDatalabs(listReq, scw.WithContext(ctx)) |
Member
There was a problem hiding this comment.
you have a scw.WithAllPages(ctx) to use.
|
|
||
| func (r *DatalabResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { | ||
| resp.Schema = schema.Schema{ | ||
| MarkdownDescription: "", |
Member
There was a problem hiding this comment.
Could you add a description here?
| "description": schema.StringAttribute{ | ||
| Optional: true, | ||
| Computed: true, | ||
| Default: stringdefault.StaticString(""), |
| resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("id"), regional.NewIDString(region, id))...) | ||
| } | ||
|
|
||
| func (r *DatalabResource) resolveRegion(regionAttr types.String) (scw.Region, error) { |
Member
There was a problem hiding this comment.
Could this be extracted in a dedicated function for all resources? I would not like to have to repeat this function for each resource.
| return "", errors.New("region is required; set it on the resource or configure a default region on the provider") | ||
| } | ||
|
|
||
| func (r *DatalabResource) resolveProjectID(projectIDAttr types.String) (string, error) { |
Member
There was a problem hiding this comment.
Could this be extracted in a dedicated function for all resources? I would not like to have to repeat this function for each resource.
Signed-off-by: sbx0r <67150725+sbx0r@users.noreply.github.com>
…ion refactor Signed-off-by: sbx0r <67150725+sbx0r@users.noreply.github.com>
c8de803 to
5113f70
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's inside:
scaleway_datalabresource - create, read, update, and deleteDatalabinstancesscaleway_datalabdata source - look up a single Datalab by ID or namescaleway_datalabsdata source - list and filter Datalabs by name or tagsFlattenFrameworkStringValueandFlattenFrameworkStringListhelpers for null-safe state handlingFrameworkValidateEnumhelper for Plugin Framework schema validationCaution
blocked by scaleway/scaleway-sdk-go#3002.