Namespaces
- Last UpdatedOct 14, 2024
- 6 minute read
A namespace is a logical unit of organization for data within a tenant. It is a collection of SDS types, streams, and stream views. Each tenant may contain more than one namespace. Before you can put any data into the system for a given tenant, a namespace must be created within the scope of that tenant. Namespace identifiers are unique within a tenant. Requirements for namespace Ids are the following:
- Must contain 100 characters or fewer
- Must only contain alphanumeric characters, underscores, dashes, spaces, and periods
- Must not contain two consecutive periods
- Must not start or end with a period
- Must not start with two consecutive underscores
- Must not contain leading or trailing whitespace
In practice, namespaces may correspond to a specific set of infrastructure assets, but more commonly correspond to virtual partitions within a single set of assets. You can create one or more namespaces within a tenant. Each namespace is effectively an instance of SDS, within which you create types and streams, stream views, data views, and metadata. Creating and deleting namespaces must be done within CONNECT. See Create a folder and enable CONNECT data services.
List All
Returns all Namespaces owned by the specified Tenant to which the caller has access.
Request
GET /api/v1/Tenants/{tenantId}/Namespaces
?region={region}
Parameters
string tenantId
The identifier of the Tenant.
[optional] string region
The identifier for the RegionWithEntitlement.
Response
| Status Code | Body Type | Description |
|---|---|---|
| 200 | Namespace[] | An array of Namespace objects for the namespaces that belong to a tenant with tenantId. |
| 400 | None | Could not return the namespaces due to missing or invalid input. |
| 403 | None | Forbidden. |
Example response body
200 Response
[
{
"Id": "Namespace1",
"Region": "WestUS",
"Self": "https://uswe.datahub.connect.aveva.com/api/v1/tenants/00c97c8b-8f60-4f29-af71-3178c414e7a0/namespaces/Namespace1",
"Description": "Namespace Description 1",
"RegionId": "WestUS",
"InstanceId": "00f602d6-0999-42e8-9ae6-e06854fdcf31",
"Name": "Namespace1",
"AllowCrossRegionProcessing": true
},
{
"Id": "Namespace2",
"Region": "WestUS",
"Self": "https://uswe.datahub.connect.aveva.com/api/v1/tenants/tenantId/namespaces/Namespace2",
"Description": "Namespace Description 2",
"State": 1,
"RegionId": "WestUS",
"InstanceId": "007df91e-b838-4c55-b43f-17560cf4ab87",
"Name": "Namespace2",
"AllowCrossRegionProcessing": true
}
]
Authorization
Allowed for these roles:
- Tenant Member
Get Namespace By Id
Returns a Namespace with the specified identifier.
Request
GET /api/v1/Tenants/{tenantId}/Namespaces/{namespaceId}
Parameters
string tenantId
The identifier of the Tenant.string namespaceId
The identifier of the Namespace.
Response
| Status Code | Body Type | Description |
|---|---|---|
| 200 | Namespace | The Namespace with identifier namespaceId. |
| 400 | None | Could not return the namespace due to missing or invalid input. |
| 403 | None | Forbidden. |
| 404 | None | Namespace not found in the specified tenant. |
Example response body
200 Response
{
"Id": "Namespace1",
"Region": "WestUS",
"Self": "https://uswe.datahub.connect.aveva.com/api/v1/tenants/tenantId/namespaces/namespaceId",
"Description": "Namespace Description 1",
"State": 1,
"RegionId": "WestUS",
"InstanceId": "8e997ea5-4b69-4486-b38c-22c73e8acfc7",
"Name": "NamespaceName",
"AllowCrossRegionProcessing": true
}
Authorization
Allowed for these roles:
- Tenant Member
Update
Updates the Namespace information for an active namespace: name, description, and cross-region processing opt-in; the AccessControlList and owner's Trustee can only be updated through their own routes.
Request
PUT /api/v1/Tenants/{tenantId}/Namespaces/{namespaceId}
Parameters
string tenantId
The identifier of the Tenant.string namespaceId
The identifier of the Namespace.
Request Body
The new details to store for the Namespace.
{
"Id": "string",
"Region": "string",
"Self": "string",
"Description": "string",
"State": 0,
"Owner": {
"Type": 1,
"ObjectId": "string",
"TenantId": "string"
},
"AccessControl": {
"RoleTrusteeAccessControlEntries": [
{
"Trustee": {
"Type": 1,
"ObjectId": "string",
"TenantId": "string"
},
"AccessType": 0,
"AccessRights": 0
}
]
},
"RegionId": "string",
"InstanceId": "string",
"Name": "string",
"AllowCrossRegionProcessing": true
}
Response
| Status Code | Body Type | Description |
|---|---|---|
| 200 | Namespace | The updated Namespace with identifier namespaceId. |
| 400 | None | Could not update the namespace due to missing or invalid input. |
| 403 | None | Forbidden. |
| 405 | None | Method not allowed at this base URL. Try the request again at the Global base URL. |
Example response body
200 Response
{
"Id": "NamespaceId",
"Region": "WestUS",
"Self": "https://uswe.datahub.connect.aveva.com/api/v1/tenants/tenantId/namespaces/namespaceId",
"Description": "New Namespace 1",
"State": 1,
"Owner": {
"Type": 1,
"ObjectId": "4f9f79e2-e4e3-4cef-b302-6c4713baed5c",
"TenantId": "7fc97c8b-8f60-4f29-af71-3178c414e7a0"
},
"AccessControl": {
"RoleTrusteeAccessControlEntries": [
{
"Trustee": {
"Type": 3,
"ObjectId": "a4e06a18-9a0e-4721-9772-524c937bdb5c"
},
"AccessRights": 1
},
{
"Trustee": {
"Type": 3,
"ObjectId": "a9a3b01b-e0d3-49c9-b931-72433152c192"
},
"AccessRights": 3
},
{
"Trustee": {
"Type": 3,
"ObjectId": "e1aaf6ac-3416-4db2-bd5d-d62b13340f4d"
},
"AccessRights": 31
}
]
},
"RegionId": "WestUS",
"InstanceId": "8e997ea5-4b69-4486-b38c-22c73e8acfc7",
"Name": "NamespaceName",
"AllowCrossRegionProcessing": true
}
Authorization
Allowed for these roles:
- Tenant Member
Get Access Control
Returns the AccessControlList that is used to authorize access to a Namespace.
Request
GET /api/v1/Tenants/{tenantId}/Namespaces/{namespaceId}/accesscontrol
Parameters
string tenantId
The identifier of the Tenant.string namespaceId
The identifier of the Namespace.
Response
| Status Code | Body Type | Description |
|---|---|---|
| 200 | AccessControlList | The AccessControlList for the namespace with identifier namespaceId. |
| 400 | None | Could not return the access control list due to missing or invalid input. |
| 403 | None | Forbidden. |
Example response body
200 Response
{
"RoleTrusteeAccessControlEntries": [
{
"Trustee": {
"Type": 3,
"ObjectId": "a4e06a18-9a0e-4721-9772-524c937bdb5c"
},
"AccessRights": 1
},
{
"Trustee": {
"Type": 3,
"ObjectId": "a9a3b01b-e0d3-49c9-b931-72433152c192"
},
"AccessRights": 3
},
{
"Trustee": {
"Type": 3,
"ObjectId": "e1aaf6ac-3416-4db2-bd5d-d62b13340f4d"
},
"AccessRights": 31
}
]
}
Authorization
Allowed for these roles:
- Tenant Member
Set Access Control
Updates the AccessControlList that is used to authorize access to a Namespace.
Request
PUT /api/v1/Tenants/{tenantId}/Namespaces/{namespaceId}/accesscontrol
Parameters
string tenantId
The identifier of the Tenant.string namespaceId
The identifier of the Namespace.
Request Body
The updated AccessControlList for the Namespace.
{
"RoleTrusteeAccessControlEntries": [
{
"Trustee": {
"Type": 1,
"ObjectId": "string",
"TenantId": "string"
},
"AccessType": 0,
"AccessRights": 0
}
]
}
Response
| Status Code | Body Type | Description |
|---|---|---|
| 200 | AccessControlList | The updated AccessControlList for the namespace with identifier namespaceId. |
| 400 | None | Could not update the access control list due to missing or invalid input. |
| 403 | None | Forbidden. |
| 405 | None | Method not allowed at this base URL. Try the request again at the Global base URL. |
Example response body
200 Response
{
"RoleTrusteeAccessControlEntries": [
{
"Trustee": {
"Type": 3,
"ObjectId": "a4e06a18-9a0e-4721-9772-524c937bdb5c"
},
"AccessRights": 1
},
{
"Trustee": {
"Type": 3,
"ObjectId": "a9a3b01b-e0d3-49c9-b931-72433152c192"
},
"AccessRights": 3
},
{
"Trustee": {
"Type": 3,
"ObjectId": "e1aaf6ac-3416-4db2-bd5d-d62b13340f4d"
},
"AccessRights": 31
}
]
}
Authorization
Allowed for these roles:
- Tenant Member
Get Owner
Returns the owner's Trustee for a given Namespace.
Request
GET /api/v1/Tenants/{tenantId}/Namespaces/{namespaceId}/owner
Parameters
string tenantId
The identifier of the Tenant.string namespaceId
The identifier of the Namespace.
Response
| Status Code | Body Type | Description |
|---|---|---|
| 200 | Trustee | The Trustee for the namespace with identifier namespaceId. |
| 400 | None | Could not return the namespace owner due to missing or invalid input. |
| 403 | None | Forbidden. |
Example response body
200 Response
{
"Type": 1,
"ObjectId": "4f9f79e2-e4e3-4cef-b302-6c4713baed5c",
"TenantId": "tenantId"
}
Authorization
Allowed for these roles:
- Tenant Member
Set Owner
Changes the owner's Trustee for a given Namespace.
Request
PUT /api/v1/Tenants/{tenantId}/Namespaces/{namespaceId}/owner
Parameters
string tenantId
The identifier of the Tenant.string namespaceId
The identifier of the Namespace.
Request Body
The new owner's Trustee of the Namespace.
{
"Type": 1,
"ObjectId": "string",
"TenantId": "string"
}
Response
| Status Code | Body Type | Description |
|---|---|---|
| 200 | Trustee | The updated Trustee for the namespace with identifier namespaceId. |
| 400 | None | Could not update the namespace owner due to missing or invalid input. |
| 403 | None | Forbidden. |
| 405 | None | Method not allowed at this base URL. Try the request again at the Global base URL. |
Example response body
200 Response
{
"Type": 1,
"ObjectId": "4f9f79e2-e4e3-4cef-b302-6c4713baed5c",
"TenantId": "tenantId"
}
Authorization
Allowed for these roles:
- Tenant Member
Definitions
Namespace
Representation of a server-side database interpretation of a namespace.
Properties
| Property Name | Data Type | Required | Nullable | Description |
|---|---|---|---|---|
| Id | string | false | true | Gets or sets identifier for this namespace; unique within a tenant's namespaces. |
| Region | string | false | true | Gets or sets the region. |
| Self | string | false | true | Gets or sets a string that represents a link to the object that implements this interface. |
| Description | string | false | true | Gets or sets the description. |
| State | NamespaceProvisioningState | false | false | Gets or sets the state. |
| Owner | Trustee | false | true | Gets the Trustee that will receive Allowed for all AccessChecks to this ISecurable. |
| AccessControl | AccessControlList | false | true | Gets the AccessControlList that defines Access Control for this ISecurable. |
| RegionId | string | false | true | Gets or sets the region identifier. |
| InstanceId | string | false | true | Gets or sets the instance identifier. |
| Name | string | false | true | Gets or sets the name. |
| AllowCrossRegionProcessing | boolean | false | true | Gets or sets the allow cross region processing. |
{
"Id": "string",
"Region": "string",
"Self": "string",
"Description": "string",
"State": 0,
"Owner": {
"Type": 1,
"ObjectId": "string",
"TenantId": "string"
},
"AccessControl": {
"RoleTrusteeAccessControlEntries": [
{
"Trustee": {
"Type": 1,
"ObjectId": "string",
"TenantId": "string"
},
"AccessType": 0,
"AccessRights": 0
}
]
},
"RegionId": "string",
"InstanceId": "string",
"Name": "string",
"AllowCrossRegionProcessing": true
}
NamespaceProvisioningState
Status codes describing a namespace's current provisioning state.
Enumerated Values
| Property | Value |
|---|---|
| Creating | 0 |
| Active | 1 |
| Deleting | 2 |
| Deleted | 3 |
| Suspended | 4 |
| Deactivated | 4 |
| Deactivating | 5 |
| Reactivating | 6 |
| Locking | 7 |
| Locked | 8 |
| Unlocking | 9 |
Trustee
Properties
| Property Name | Data Type | Required | Nullable | Description |
|---|---|---|---|---|
| Type | TrusteeType | false | false | None |
| ObjectId | string | false | true | None |
| TenantId | string | false | true | None |
{
"Type": 1,
"ObjectId": "string",
"TenantId": "string"
}
TrusteeType
Enumerated Values
| Property | Value |
|---|---|
| User | 1 |
| Client | 2 |
| Role | 3 |
AccessControlList
Properties
| Property Name | Data Type | Required | Nullable | Description |
|---|---|---|---|---|
| RoleTrusteeAccessControlEntries | [AccessControlEntry] | false | true | None |
{
"RoleTrusteeAccessControlEntries": [
{
"Trustee": {
"Type": 1,
"ObjectId": "string",
"TenantId": "string"
},
"AccessType": 0,
"AccessRights": 0
}
]
}
AccessControlEntry
Properties
| Property Name | Data Type | Required | Nullable | Description |
|---|---|---|---|---|
| Trustee | Trustee | false | true | None |
| AccessType | AccessType | false | false | None |
| AccessRights | int64 | false | false | None |
{
"Trustee": {
"Type": 1,
"ObjectId": "string",
"TenantId": "string"
},
"AccessType": 0,
"AccessRights": 0
}
AccessType
Enumerated Values
| Property | Value |
|---|---|
| Allowed | 0 |
| Denied | 1 |