Create schemas

POST /api/meta/entity/bulk#createSchemas

Create one or more schemas.

Note that the creation relies on no matches being found for the provided qualifiedNames. If any of the qualifiedNames match any existing schema, those schemas will be updated rather than created. Also be aware that the qualifiedName is case-sensitive.

For more details on the semantics and other attributes available through this interface, see the Upsert entities operation.

Body Required

List of schemas to create.

  • entities array[object] Required

    Instance of a schema in Atlan, with its detailed information.

    • typeName string Required

      Should always be Schema.

    • attributes object Required

      Attributes that can exist in schema assets in Atlan.

      • qualifiedName string Required

        Unique name for this schema. This should be a concatenation of the parent database's qualifiedName with the name of the schema, separated by /.

      • name string Required

        Human-readable name of the schema.

      • databaseName string | null Required

        Name of the database in which this schema exists.

      • databaseQualifiedName string | null Required

        Unique name of the database in which this schema exists.

      • tableCount integer | null

        Number of tables in this schema.

      • viewsCount integer | null

        Number of views in this schema.

    • relationshipAttributes object | null Required

      Map of the relationships to this schema.

      • database object Required

        Details to use within an asset when referring to a database.

        • typeName string

          Should always be Database.

        • guid string | null

          Unique identifier of the related database. If the uniqueAttributes are not provided, this must be provided.

        • uniqueAttributes object | null

          Attribute(s) that uniquely identify the related database. If the guid is not provided, these must be provided.

Responses

  • 200 object

    Schemas that were successfully created or updated. Note from the example that even though we are creating a schema the response includes both an update to its parent database and the creation of the schema within that database.

    • mutatedEntities object | null

      Schemas that were changed.

      • CREATE array[object]

        Instance of a schema in Atlan, with its detailed response-specific information.

        • typeName string

          Should always be Schema.

        • attributes object | null

          Attributes that can exist in schema assets in Atlan.

        • classifications array[object] | null

          Instance of a classification in Atlan, with its detailed information.

          • typeName string

            Name of the classification. Note that this is the static-hashed unique name of the classification, not the human-readable displayName.

          • Unique identifier of the entity to which this classification is attached.

          • propagate boolean | null

            Whether to propagate this classification to other entities related to the entity to which the classification is attached.

          • Whether to remove this classification from other entities to which it has been propagated when the classification is removed from this entity.

          • entityStatus string | null

            Status of the entity to which this classification is attached.

            Values are ACTIVE or DELETED.

        • displayText string | null

          Human-readable name of the entity.

        • guid string

          Unique identifier of the entity instance.

        • isIncomplete boolean | null

          Default value is false.

        • createdBy string | null

          Username of the user who created the object.

        • updatedBy string | null

          Username of the user who last updated the object.

        • createTime integer | null

          Time (epoch) at which this object was created, in milliseconds.

        • updateTime integer | null

          Time (epoch) at which this object was last updated, in milliseconds.

        • version integer | null

          Version of this object.

        • classificationNames array[string] | null

          List of classifications for this entity. Note that these are the internal hashed names used in Atlan, not the displayText of the classification.

        • labels array[string] | null

          Internal use only.

        • status string

          Status of the entity, either ACTIVE or DELETED.

          Values are ACTIVE or DELETED.

        • Map of the relationships to this schema.

          • readme object

            Details to use within an asset when referring to a readme.

            • typeName string

              Should always be Readme.

            • guid string | null

              Unique identifier of the related readme. If the uniqueAttributes are not provided, this must be provided.

            • uniqueAttributes object | null

              Attribute(s) that uniquely identify the related readme. If the guid is not provided, these must be provided.

          • meanings array[object] | null

            Details to use within an asset when referring to a term.

            • typeName string

              Should always be AtlasnGlossaryTerm.

            • guid string | null

              Unique identifier of the related term. If the uniqueAttributes are not provided, this must be provided.

            • uniqueAttributes object | null

              Attribute(s) that uniquely identify the related term. If the guid is not provided, these must be provided.

              • Unique name of the related term. Note that in Atlan this unique name is a hashed value, not the name you see in the UI.

          • inputToProcesses array[object] | null

            Details to use within an asset when referring to a process.

            • typeName string

              Should either be Process or a subtype of Process.

              Values are Process, ColumnProcess, or BIProcess.

            • guid string | null

              Unique identifier of the related process. If the uniqueAttributes are not provided, this must be provided.

            • uniqueAttributes object | null

              Attribute(s) that uniquely identify the related process. If the guid is not provided, these must be provided.

          • outputFromProcesses array[object] | null

            Details to use within an asset when referring to a process.

            • typeName string

              Should either be Process or a subtype of Process.

              Values are Process, ColumnProcess, or BIProcess.

            • guid string | null

              Unique identifier of the related process. If the uniqueAttributes are not provided, this must be provided.

            • uniqueAttributes object | null

              Attribute(s) that uniquely identify the related process. If the guid is not provided, these must be provided.

          • database object

            Details to use within an asset when referring to a database.

            • typeName string

              Should always be Database.

            • guid string | null

              Unique identifier of the related database. If the uniqueAttributes are not provided, this must be provided.

            • uniqueAttributes object | null

              Attribute(s) that uniquely identify the related database. If the guid is not provided, these must be provided.

          • materialisedViews array[object] | null

            Details to use within an asset when referring to a materialized view.

            • typeName string

              Should always be MaterialisedView.

            • guid string | null

              Unique identifier of the related materialized view. If the uniqueAttributes are not provided, this must be provided.

            • uniqueAttributes object | null

              Attribute(s) that uniquely identify the related materialized view. If the guid is not provided, these must be provided.

          • tables array[object] | null

            Details to use within an asset when referring to a table.

            • typeName string

              Should always be Table.

            • guid string | null

              Unique identifier of the related table. If the uniqueAttributes are not provided, this must be provided.

            • uniqueAttributes object | null

              Attribute(s) that uniquely identify the related table. If the guid is not provided, these must be provided.

          • procedures array[object] | null

            Details to use within an asset when referring to a stored procedure.

            • typeName string

              Should always be Procedure.

            • guid string | null

              Unique identifier of the related stored procedure. If the uniqueAttributes are not provided, this must be provided.

            • uniqueAttributes object | null

              Attribute(s) that uniquely identify the related stored procedure. If the guid is not provided, these must be provided.

          • views array[object] | null

            Details to use within an asset when referring to a view.

            • typeName string

              Should always be View.

            • guid string | null

              Unique identifier of the related view. If the uniqueAttributes are not provided, this must be provided.

            • uniqueAttributes object | null

              Attribute(s) that uniquely identify the related view. If the guid is not provided, these must be provided.

      • UPDATE array[object]
        Any of:
    • Map of assigned unique identifiers for the changed schemas.

POST /api/meta/entity/bulk#createSchemas
curl \
 -X POST https://tenant.atlan.com/api/meta/entity/bulk#createSchemas \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"entities":[{"typeName":"Schema","attributes":{"name":"default","qualifiedName":"default/mongodb/mongodb.atlan.com/test_db/default","connectorName":"mongodb","databaseName":"test_db","databaseQualifiedName":"default/mongodb/mongodb.atlan.com/test_db","connectionQualifiedName":"default/mongodb/mongodb.atlan.com"},"relationshipAttributes":{"database":{"typeName":"Database","uniqueAttributes":{"qualifiedName":"default/mongodb/mongodb.atlan.com/test_db"}}}}]}'
Request example
{
  "entities": [
    {
      "typeName": "Schema",
      "attributes": {
        "name": "default",
        "qualifiedName": "default/mongodb/mongodb.atlan.com/test_db/default",
        "connectorName": "mongodb",
        "databaseName": "test_db",
        "databaseQualifiedName": "default/mongodb/mongodb.atlan.com/test_db",
        "connectionQualifiedName": "default/mongodb/mongodb.atlan.com"
      },
      "relationshipAttributes": {
        "database": {
          "typeName": "Database",
          "uniqueAttributes": {
            "qualifiedName": "default/mongodb/mongodb.atlan.com/test_db"
          }
        }
      }
    }
  ]
}
Response example (200)
{
  "mutatedEntities": {
    "UPDATE": [
      {
        "typeName": "Database",
        "attributes": {
          "qualifiedName": "default/mongodb/mongodb.atlan.com/test_db",
          "name": "test_db"
        },
        "guid": "f5740924-fe74-4462-96ff-5da0bc970cec",
        "status": "ACTIVE",
        "displayText": "test_db",
        "classificationNames": [],
        "meaningNames": [],
        "meanings": [],
        "isIncomplete": false,
        "labels": [],
        "createdBy": "service-account-apikey-bea1e1d1-e4e7-465e-8adf-7c61c227a59b",
        "updatedBy": "service-account-apikey-bea1e1d1-e4e7-465e-8adf-7c61c227a59b",
        "createTime": 1652796319437,
        "updateTime": 1652795647900
      }
    ],
    "CREATE": [
      {
        "typeName": "Schema",
        "attributes": {
          "popularityScore": 1.17549435e-38,
          "sourceCreatedAt": 0,
          "viewerUsers": [],
          "viewScore": 1.17549435e-38,
          "lastSyncRunAt": 0,
          "adminGroups": [],
          "qualifiedName": "default/mongodb/mongodb.atlan.com/test_db/default",
          "__hasLineage": false,
          "adminUsers": [],
          "ownerGroups\"": [],
          "isEditable": true,
          "sourceUpdatedAt": 0,
          "announcementUpdatedAt": 0,
          "name": "default",
          "certificateUpdatedAt": 0,
          "connectorName": "mongodb",
          "databaseName": "test_db",
          "databaseQualifiedName": "default/mongodb/mongodb.atlan.com/test_db",
          "connectionQualifiedName": "default/mongodb/mongodb.atlan.com",
          "isDiscoverable": true,
          "viewerGroups": [],
          "ownerUsers": []
        },
        "guid": "dc14ffca-bf43-4731-b641-51408c4d892c",
        "status": "ACTIVE",
        "displayText": "default",
        "classificationNames": [],
        "classifications": [],
        "meaningNames": [],
        "meanings": [],
        "isIncomplete": false,
        "labels": [],
        "createdBy": "service-account-apikey-bea1e1d1-e4e7-465e-8adf-7c61c227a59b",
        "updatedBy": "service-account-apikey-bea1e1d1-e4e7-465e-8adf-7c61c227a59b",
        "createTime": 1652795647900,
        "updateTime": 1652795647900
      }
    ]
  },
  "guidAssignments": {
    "-10887525374266606": "dc14ffca-bf43-4731-b641-51408c4d892c"
  }
}