Introduction
To get more information about workspaces, please refer to the general concepts here.
Operations
Create a workspace
To create a workspace, you need to have an account on OwlGrid. If you don't have one, please refer to the quickstart tutorial.
- Portal
- HTTP API
- Typescript
Start by logging in to the OwlGrid portal.
Then, on the workspaces section of the manager, click on the Create a workspace button.
To create a workspace, you need to provide the following information:
- Name: the name of the workspace. It must be unique in the organization;
- Description: a short description of the workspace (optional);
OwlGrid will generate automatically an identifier and redirect you to the workspace page.
After the workspace creation, you will need to connect a repository. The repository is used to store the code and the configuration of the workspace. OwlGrid supports only Github repositories for now.
On the first connection, you will need to authorize OwlGrid to access your Github account. Then, you will be able to select the repository you want to use. For more informations, please refer to the repository section.
Connect the workspace to a repository
Every workspace needs to be connected to a repository that stores the code and the configuration of the workspace and its resources.
OwlGrid supports only Github repositories for now.
To connect a workspace to a repository, this workspace need to have at least one branch. This branch will be used to create the main environment of your workspace. For more information about environments, please refer to the environments section.
- Portal
- HTTP API
- Typescript
Logging
Start by logging in to the OwlGrid portal.
Then, on the workspaces section of the manager, click on the workspace that you want to configure.
If a workspace is not connected to a repository, you will see a Connect to repository dialog everytime you access to the portal of this workspace.
Connect to Github
Once the workspace portal is opened, the dialog "Connect your workspace to a repository" will appear. Click on the Connect to Github button.
Make sure to connect to Github using an account that has access to the repository you want to use.
Grant access to repositories
Once you are connected, you will be able to select the repository you want to use. If no repository is displayed on the list, make sure that OwlGrid Github App is installed in the repository you want to connect. To install the Github App, click on the button "Grant access to repositories", choose the repository(ies) in which you need to install the app and click on the refresh button to make it appear in the list.
Choose the main branch
Once the repository is selected, you will be able to choose the main branch of the workspace. This branch will be used to create the main environment of your workspace. For more information about environments, please refer to the environments section.
Connect
Click on the button "Connect". The repository is now connected to the workspace and the main branch is created.
Get workspace information
- Portal
- HTTP API
- Typescript
To access to a workspace, you need to log in to the OwlGrid portal, select the workspace in the workspaces section and click on the Open button.
The workspace information are available on the Workspace section of the left menu.
GET /workspaces/{{workspace-id}}/environments/{{environment-name}}/{{service-id}}/workspaces/{{workspace-id}} HTTP/1.1
Authorization: Bearer {{access-token}}
Host: api.owlgrid.com
Note: the {{environment}}
parameter can be any environment. We recommend to use the main environment name.
import { OwlWorkspaceBetaClient } from '@owlgrid-dev/owl-workspace-client';
// Create the client with machine account credentials
const client = new OwlWorkspaceBetaClient({
auth: {
method: 'secret',
secret: 'secret',
accountId: 'accountId',
perimeters: ['owl.workspace.workspaceId'],
},
workspaceId: 'workspaceId'
});
// Connect the client (generate an access token)
await client.connect();
// Get the workspace
workspace = await client.getWorkspace();
Update workspace information
🚧 This operation is not available yet.
Delete a workspace
- Portal
- HTTP API
- Typescript
To delete a workspace, navigate to the Workspace -> Workspace settings -> Danger zone section of the workspace. Then, click on the Delete workspace button. Enter the workspace name to confirm the deletion.
Be careful, this operation is irreversible. All the resources of the workspace will be deleted.
DELETE /workspaces/{{workspace-id}}/environments/{{environment-name}}/{{service-id}}/workspaces/{{workspace-id}} HTTP/1.1
Authorization: Bearer {{access-token}}
Host: api.owlgrid.com
Notes:
- The
{{environment}}
parameter can be any environment. We recommend to use the main environment name. - The deletion will be done withtout asking for confirmation. Be careful when using this operation.
import { OwlWorkspaceBetaClient } from '@owlgrid-dev/owl-workspace-client';
// Create the client with machine account credentials
const client = new OwlWorkspaceBetaClient({
auth: {
method: 'secret',
secret: 'secret',
accountId: 'accountId',
perimeters: ['owl.workspace.workspaceId'],
},
workspaceId: 'workspaceId'
});
// Connect the client (generate an access token)
await client.connect();
// Delete the workspace
await client.deleteWorkspace();
Notes:
- The
{{environment}}
parameter can be any environment. We recommend to use the main environment name. - The deletion will be done withtout asking for confirmation. Be careful when using this operation.