-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WOR-1781][WOR-1782] APIs to manage workspace settings #2983
Changes from all commits
097daee
1c2287a
a4536df
01e0d27
e541f61
3dc24ec
bbde9b5
03d7e31
6259e9a
75301c5
460df06
39342b5
029d41d
73a61e3
5178b1e
2c30dba
5dde8bb
b6e416a
7b538be
7686821
13c934d
c5232c2
118f779
45ab826
90b7f6b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<databaseChangeLog logicalFilePath="dummy" xmlns="http://www.liquibase.org/xml/ns/dbchangelog" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.4.xsd"> | ||
<changeSet logicalFilePath="dummy" author="mtalbott" id="create_WORKSPACE_SETTINGS"> | ||
<createTable tableName="WORKSPACE_SETTINGS"> | ||
<column name="id" type="BIGINT" autoIncrement="true"> | ||
<constraints primaryKey="true"/> | ||
</column> | ||
<column name="WORKSPACE_ID" type="BINARY(16)"> | ||
<constraints nullable="false" referencedTableName="WORKSPACE" referencedColumnNames="id" foreignKeyName="FK_WSETTINGS_WORKSPACE_ID" deleteCascade="true"/> | ||
</column> | ||
<column name="SETTING_TYPE" type="VARCHAR(254)"> | ||
<constraints nullable="false"/> | ||
</column> | ||
<column name="CONFIG" type="JSON"> | ||
<constraints nullable="false"/> | ||
</column> | ||
<column name="CREATED_TIME" type="DATETIME(6)" defaultValueComputed="NOW(6)"> | ||
<constraints nullable="false"/> | ||
</column> | ||
<column name="LAST_UPDATED" type="DATETIME(6)" defaultValueComputed="NOW(6)"> | ||
<constraints nullable="false"/> | ||
</column> | ||
<column name="STATUS" type="VARCHAR(254)"> | ||
<constraints nullable="false"/> | ||
</column> | ||
<column name="USER_ID" type="varchar(254)"> | ||
<constraints nullable="false"/> | ||
</column> | ||
</createTable> | ||
</changeSet> | ||
</databaseChangeLog> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4423,6 +4423,84 @@ paths: | |
$ref: '#/components/schemas/ErrorReport' | ||
500: | ||
$ref: '#/components/responses/RawlsInternalError' | ||
/api/workspaces/v2/{workspaceNamespace}/{workspaceName}/settings: | ||
get: | ||
tags: | ||
- workspaces_v2 | ||
summary: Get workspace settings | ||
description: Get the settings for a workspace | ||
operationId: getWorkspaceSettings | ||
parameters: | ||
- $ref: '#/components/parameters/workspaceNamespacePathParam' | ||
- $ref: '#/components/parameters/workspaceNamePathParam' | ||
responses: | ||
200: | ||
description: Success | ||
content: | ||
'application/json': | ||
schema: | ||
type: array | ||
items: | ||
$ref: '#/components/schemas/WorkspaceSetting' | ||
403: | ||
description: User does not have access to requested workspace | ||
content: | ||
'application/json': | ||
schema: | ||
$ref: '#/components/schemas/ErrorReport' | ||
404: | ||
description: Workspace not found | ||
content: | ||
'application/json': | ||
schema: | ||
$ref: '#/components/schemas/ErrorReport' | ||
500: | ||
$ref: '#/components/responses/RawlsInternalError' | ||
put: | ||
tags: | ||
- workspaces_v2 | ||
summary: Update workspace settings | ||
description: Update the settings for a workspace. Unspecified setting types will be left unchanged. | ||
operationId: updateWorkspaceSettings | ||
parameters: | ||
- $ref: '#/components/parameters/workspaceNamespacePathParam' | ||
- $ref: '#/components/parameters/workspaceNamePathParam' | ||
requestBody: | ||
description: New settings for the workspace | ||
content: | ||
'application/json': | ||
schema: | ||
type: array | ||
items: | ||
$ref: '#/components/schemas/WorkspaceSetting' | ||
required: true | ||
responses: | ||
200: | ||
description: Success | ||
content: | ||
'application/json': | ||
schema: | ||
$ref: '#/components/schemas/WorkspaceSettingsResponse' | ||
400: | ||
description: Invalid settings | ||
content: | ||
'application/json': | ||
schema: | ||
$ref: '#/components/schemas/ErrorReport' | ||
403: | ||
description: User must be an owner of the workspace to overwrite settings | ||
content: | ||
'application/json': | ||
schema: | ||
$ref: '#/components/schemas/ErrorReport' | ||
404: | ||
description: Workspace not found | ||
content: | ||
'application/json': | ||
schema: | ||
$ref: '#/components/schemas/ErrorReport' | ||
500: | ||
$ref: '#/components/responses/RawlsInternalError' | ||
components: | ||
schemas: | ||
BillingAccount: | ||
|
@@ -5818,6 +5896,81 @@ components: | |
- Deleting | ||
- DeleteFailed | ||
description: "" | ||
WorkspaceSettingsResponse: | ||
required: | ||
- successes | ||
- failures | ||
type: object | ||
properties: | ||
successes: | ||
type: array | ||
description: The settings that were successfully applied | ||
items: | ||
$ref: '#/components/schemas/WorkspaceSetting' | ||
failures: | ||
$ref: '#/components/schemas/FailedWorkspaceSettingsResponse' | ||
FailedWorkspaceSettingsResponse: | ||
type: object | ||
description: The settings that failed to apply. The key is the setting type that failed. | ||
additionalProperties: | ||
$ref: '#/components/schemas/ErrorReport' | ||
WorkspaceSetting: | ||
required: | ||
- settingType | ||
- config | ||
type: object | ||
properties: | ||
settingType: | ||
type: string | ||
description: The type of the workspace setting | ||
enum: | ||
- GcpBucketLifecycle | ||
config: | ||
description: The configuration of the workspace setting | ||
oneOf: | ||
- $ref: '#/components/schemas/WorkspaceSettingGcpBucketLifecycleConfig' | ||
WorkspaceSettingGcpBucketLifecycleConfig: | ||
required: | ||
- rules | ||
type: object | ||
properties: | ||
rules: | ||
type: array | ||
description: The lifecycle rules for the workspace bucket | ||
items: | ||
$ref: '#/components/schemas/GcpBucketLifecycleRule' | ||
GcpBucketLifecycleRule: | ||
required: | ||
- action | ||
- conditions | ||
type: object | ||
properties: | ||
action: | ||
$ref: '#/components/schemas/GcpBucketLifecycleAction' | ||
conditions: | ||
$ref: '#/components/schemas/GcpBucketLifecycleCondition' | ||
GcpBucketLifecycleAction: | ||
required: | ||
- actionType | ||
type: object | ||
properties: | ||
actionType: | ||
type: string | ||
description: The type of the lifecycle action | ||
enum: | ||
- Delete | ||
GcpBucketLifecycleCondition: | ||
type: object | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are any of these properties required? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Either can be omitted, but we do need at least one now that I think about it which isn't accounted for. I'll change that. |
||
minProperties: 1 | ||
properties: | ||
age: | ||
type: integer | ||
description: The age of the object in days | ||
matchesPrefix: | ||
type: array | ||
description: Object name prefixes that this rule applies to | ||
items: | ||
type: string | ||
WorkspaceSubmissionStats: | ||
required: | ||
- runningSubmissionsCount | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should also capture who initiated the change, ideally the sam/terra UID and not an email.