Create a new app
POST /accounts/{account_id}/k8s/v2/apps
Indicates the desired values for the App API resource to be created.
Parameters
Name | Type | In | Required | Description |
---|---|---|---|---|
account_id |
string |
path |
True |
ID of the containing account resource
|
Request Body
Indicates the desired values for the App API resource to be created.
Name | Type | Required | Description |
---|---|---|---|
type |
string |
True |
Media type of the resource. Defined values are:
|
version |
string |
True |
Version of the resource. Defined values are:
|
name |
string |
True |
JSON string containing a name for the application. Defined values are:
|
clusterScopedResources |
array[clusterScopedResources] |
False |
JSON array of JSON objects describing the cluster-scoped resources that are part of this app |
namespaceScopedResources |
array[namespaceScopedResources] |
False |
JSON array of JSON objects describing the resources that are part of this app |
namespaceMapping |
array[namespaceMapping] |
False |
JSON array of JSON objects, each mapping a source namespace to a destination namespace for a clone operation. Defined values are:
|
clusterID |
string |
False |
JSON string containing the ID of the cluster that the application is running on. Not returned if the application is not currently running. When specified on create, clusterID indicates which cluster the application must be cloned into. If the specified cluster does not exist, or if the cluster specified does not match the clusterID specified in the request URI, the clone will fail. Defined values are:
|
sourceAppID |
string |
False |
JSON string containing the ID of a source application. Only returned if the application was cloned from another application, or was restored from a backup or snapshot. When specified on create, the sourceAppID is used in conjunction with the sourceClusterID and indicates which running application will be cloned. If the specified application does not exist on the specified source cluster, the clone will fail. Only one of sourceAppID, backupID, or snapshotID can be specified when creating an application. Defined values are:
|
sourceClusterID |
string |
False |
JSON string containing the ID of the cluster the application was previously running on. Only returned if the application was cloned from another cluster. When specified on create, the sourceClusterID is used in conjunction with the sourceAppID and indicates the source cluster of the application to be cloned. If the specified source cluster does not exist, the clone will fail. Defined values are:
|
backupID |
string |
False |
JSON string containing the ID of the backup that the application was restored from. Only returned if the application was restored from a backup. When specified on create, backupID indicates that an application will be cloned from an existing backup. If the specified backup does not exist, the clone will fail. Only one of sourceAppID, backupID, or snapshotID can be specified when creating an application. When specified on a replace, backupID indicates the application backup from which the application will be in-place restored. If the specified backup does not exist, the restore will fail. Only one of backupID or snapshotID can be specified when updating an application Defined values are:
|
snapshotID |
string |
False |
JSON string containing the ID of the snapshot that the application was restored from. Only returned if the application was restored from a snapshot. When specified on create, snapshotID indicates that an application will be cloned from an existing snapshot. If the specified snapshot does not exist, the clone will fail. Only one of sourceAppID, backupID, or snapshotID can be specified when creating an application. When specified on a replace, snapshotID indicates the application snapshot from which the application will be in-place restored. If the specified snapshot does not exist, the restore will fail. Only one of backupID or snapshotID can be specified when updating an application. Defined values are:
|
metadata |
False |
Client and service-specified metadata associated with the resource. Defined values are:
|
Example request
{
"type": "application/astra-app",
"version": "2.1",
"name": "jenkins",
"clusterID": "0f284377-e5dc-4dcd-bacd-3197f2b8a347",
"namespaceScopedResources": [
{
"namespace": "production"
}
]
}
Response
Status: 201, Returns the newly created app resource in the JSON response body.
Name | Type | Required | Description |
---|---|---|---|
type |
string |
True |
Media type of the resource. Defined values are:
|
version |
string |
True |
Version of the resource. Defined values are:
|
id |
string |
True |
Globally unique identifier of the resource. Defined values are:
|
name |
string |
True |
JSON string containing a name for the application. Defined values are:
|
clusterScopedResources |
array[clusterScopedResources] |
False |
JSON array of JSON objects describing the cluster-scoped resources that are part of this app |
namespaceScopedResources |
array[namespaceScopedResources] |
True |
JSON array of JSON objects describing the resources that are part of this app |
lastResourceCollectionTimestamp |
string |
False |
JSON string containing the timestamp when the last resource collection was performed. This field is unset if no resource collection has been performed for this application yet. Defined values are:
|
state |
string |
True |
JSON string containing a value indicating the operational state of the application. Defined values are:
|
stateTransitions |
array[type_astra_stateTransitions] |
False |
JSON array of JSON objects, each representing the set of permitted state transitions from a given defined state. Each JSON object contains the fields "from" and "to", where the "from" value is the name of a state, and the "to" value is an array of permitted destination states. |
stateDetails |
array[type_astra_stateDetails] |
True |
JSON array of JSON objects which lists additional details about the current state, including why the current state was reached. If no details are available, this array will be empty. Defined values are:
|
protectionState |
string |
True |
JSON string containing a value indicating the protection state of the application. Defined values are:
|
protectionStateDetails |
array[type_astra_stateDetails] |
True |
JSON array of JSON objects which lists additional details about the current protection state, including why the current state was reached. If no details are available, this array will be empty. Defined values are:
|
appDetectedType |
string |
False |
JSON string that uniquely represents the specific type of application that is detected. Defined values are:
|
namespaces |
array[string] |
True |
JSON array of JSON strings containing the names of the namespaces in which the application is running. Defined values are:
|
namespaceMapping |
array[namespaceMapping] |
False |
JSON array of JSON objects, each mapping a source namespace to a destination namespace for a clone operation. Defined values are:
|
clusterName |
string |
False |
JSON string containing the name of the cluster that the application is running on. Not returned if the application is not currently running. |
clusterID |
string |
False |
JSON string containing the ID of the cluster that the application is running on. Not returned if the application is not currently running. When specified on create, clusterID indicates which cluster the application must be cloned into. If the specified cluster does not exist, or if the cluster specified does not match the clusterID specified in the request URI, the clone will fail. Defined values are:
|
clusterType |
string |
False |
JSON string containing a value indicating the type of cluster. Defined values are:
|
sourceAppID |
string |
False |
JSON string containing the ID of a source application. Only returned if the application was cloned from another application, or was restored from a backup or snapshot. When specified on create, the sourceAppID is used in conjunction with the sourceClusterID and indicates which running application will be cloned. If the specified application does not exist on the specified source cluster, the clone will fail. Only one of sourceAppID, backupID, or snapshotID can be specified when creating an application. Defined values are:
|
sourceClusterName |
string |
False |
JSON string containing the name of the cluster the application was previously running on. Only returned if the application was cloned from another cluster. |
sourceClusterID |
string |
False |
JSON string containing the ID of the cluster the application was previously running on. Only returned if the application was cloned from another cluster. When specified on create, the sourceClusterID is used in conjunction with the sourceAppID and indicates the source cluster of the application to be cloned. If the specified source cluster does not exist, the clone will fail. Defined values are:
|
backupID |
string |
False |
JSON string containing the ID of the backup that the application was restored from. Only returned if the application was restored from a backup. When specified on create, backupID indicates that an application will be cloned from an existing backup. If the specified backup does not exist, the clone will fail. Only one of sourceAppID, backupID, or snapshotID can be specified when creating an application. When specified on a replace, backupID indicates the application backup from which the application will be in-place restored. If the specified backup does not exist, the restore will fail. Only one of backupID or snapshotID can be specified when updating an application Defined values are:
|
snapshotID |
string |
False |
JSON string containing the ID of the snapshot that the application was restored from. Only returned if the application was restored from a snapshot. When specified on create, snapshotID indicates that an application will be cloned from an existing snapshot. If the specified snapshot does not exist, the clone will fail. Only one of sourceAppID, backupID, or snapshotID can be specified when creating an application. When specified on a replace, snapshotID indicates the application snapshot from which the application will be in-place restored. If the specified snapshot does not exist, the restore will fail. Only one of backupID or snapshotID can be specified when updating an application. Defined values are:
|
replicationSourceAppID |
string |
False |
JSON string containing the ID of the application that is being replicated to this application. Only returned if the application is currently the destination in an AppMirror relationship, and the relationship is not in the failedOver state. When the relationship is in failedOver state, this field is not returned. Defined values are:
|
metadata |
True |
Client and service-specified metadata associated with the resource. Defined values are:
|
Example response
{
"type": "application/astra-app",
"version": "2.1",
"id": "9703bbe7-def0-5b08-a40b-1edef8c47f7c",
"name": "jenkins",
"namespaceScopedResources": [
{
"namespace": "production",
"labelSelectors": []
}
],
"state": "pending",
"stateDetails": [],
"protectionState": "none",
"protectionStateDetails": [],
"namespaces": [
"production"
],
"clusterName": "GKE-22",
"clusterID": "0f284377-e5dc-4dcd-bacd-3197f2b8a347",
"clusterType": "kubernetes",
"metadata": {
"labels": [],
"creationTimestamp": "2022-10-06T20:58:16.305662Z",
"modificationTimestamp": "2022-10-06T20:58:16.305662Z",
"createdBy": "8f84cf09-8036-51e4-b579-bd30cb07b269"
}
}
Response
Status: 401, Unauthorized
Name | Type | Required | Description |
---|---|---|---|
type |
string |
True |
|
title |
string |
True |
|
detail |
string |
False |
|
status |
string |
True |
|
correlationID |
string |
False |
Example response
{
"type": "https://astra.netapp.io/problems/3",
"title": "Missing bearer token",
"detail": "The request is missing the required bearer token.",
"status": "401"
}
Response
Status: 400, Bad request
Name | Type | Required | Description |
---|---|---|---|
type |
string |
True |
|
title |
string |
True |
|
detail |
string |
False |
|
status |
string |
True |
|
correlationID |
string |
False |
|
invalidFields |
array[invalidFields] |
False |
List of invalid request body fields |
Example response
{
"type": "https://astra.netapp.io/problems/5",
"title": "Invalid query parameters",
"detail": "The supplied query parameters are invalid.",
"status": "400"
}
Response
Status: 409, Conflict
Name | Type | Required | Description |
---|---|---|---|
type |
string |
True |
|
title |
string |
True |
|
detail |
string |
False |
|
status |
string |
True |
|
correlationID |
string |
False |
|
invalidFields |
array[invalidFields] |
False |
List of invalid request body fields |
Example response
{
"type": "https://astra.netapp.io/problems/10",
"title": "JSON resource conflict",
"detail": "The request body JSON contains a field that conflicts with an idempotent value.",
"status": "409"
}
Response
Status: 403, Forbidden
Name | Type | Required | Description |
---|---|---|---|
type |
string |
True |
|
title |
string |
True |
|
detail |
string |
False |
|
status |
string |
True |
|
correlationID |
string |
False |
Example response
{
"type": "https://astra.netapp.io/problems/11",
"title": "Operation not permitted",
"detail": "The requested operation isn't permitted.",
"status": "403"
}
Error
Status: 404, Not found
Name | Type | Required | Description |
---|---|---|---|
type |
string |
True |
|
title |
string |
True |
|
detail |
string |
False |
|
status |
string |
True |
|
correlationID |
string |
False |
Example error response
{
"type": "https://astra.netapp.io/problems/2",
"title": "Collection not found",
"detail": "The collection specified in the request URI wasn't found.",
"status": "404"
}
Definitions
See Definitions
GVK
JSON object containing a Kubernetes group/version/kind.
-
This object is internally validated against Astra /apiResources.
Name | Type | Required | Description |
---|---|---|---|
group |
string |
True |
JSON string containing a group identifier assigned by Kubernetes.
|
kind |
string |
True |
JSON string containing a kind identifier assigned by Kubernetes.
|
version |
string |
True |
JSON string containing a version identifier assigned by Kubernetes.
|
clusterScopedResources
Name | Type | Required | Description |
---|---|---|---|
GVK |
True |
JSON object containing a Kubernetes group/version/kind.
|
|
labelSelectors |
array[string] |
False |
JSON array of JSON strings representing a label selector for the cluster-scoped GroupVersionKinds (GVKs) within the cluster. If this is empty, then all GVK instances on the cluster are included. Each element in this array is a Kubernetes label selector string and follows the same grammar for those values. Examples:
|
namespaceScopedResources
Name | Type | Required | Description |
---|---|---|---|
namespace |
string |
True |
JSON string containing the name of a namespace in which the application is defined. Defined values are:
|
labelSelectors |
array[string] |
False |
JSON array of JSON strings representing a label selector within the namespace. If this is empty, then all resources in the namespace are included. Each element in this array is a Kubernetes label selector string and follows the grammar for those values. Examples:
|
namespaceMapping
Name | Type | Required | Description |
---|---|---|---|
source |
string |
True |
JSON string containing the name of the namespace on the source cluster. Defined values are:
|
destination |
string |
True |
JSON string containing the name of the namespace on the destination cluster. Defined values are:
|
type_astra_label
Name | Type | Required | Description |
---|---|---|---|
name |
string |
True |
|
value |
string |
True |
type_astra_metadata_update
Client and service-specified metadata associated with the resource. Defined values are:
-
Conforms to the Astra Metadata Schema If not specified on create, a metadata object will be created with no labels. If not specified on update, the metadata object's labels, creationTimestamp and createdBy, will be preserved without modification.
Name | Type | Required | Description |
---|---|---|---|
labels |
array[type_astra_label] |
False |
|
creationTimestamp |
string |
False |
|
modificationTimestamp |
string |
False |
|
createdBy |
string |
False |
|
modifiedBy |
string |
False |
namespaceScopedResources
Name | Type | Required | Description |
---|---|---|---|
namespace |
string |
True |
JSON string containing the name of a namespace in which the application is defined. Defined values are:
|
labelSelectors |
array[string] |
True |
JSON array of JSON strings representing a label selector within the namespace. If this is empty, then all resources in the namespace are included. Each element in this array is a Kubernetes label selector string and follows the grammar for those values. Examples:
|
type_astra_stateTransitions
Name | Type | Required | Description |
---|---|---|---|
from |
string |
True |
|
to |
array[string] |
True |
type_astra_stateDetails
Name | Type | Required | Description |
---|---|---|---|
type |
string |
True |
|
title |
string |
True |
|
detail |
string |
True |
invalidParams
Name | Type | Required | Description |
---|---|---|---|
name |
string |
True |
Name of the invalid query parameter |
reason |
string |
True |
Reason why the query parameter is invalid |
invalidFields
Name | Type | Required | Description |
---|---|---|---|
name |
string |
True |
Name of the invalid request body field |
reason |
string |
True |
Reason why the request body field is invalid |