Database Schema

This contains APIs for performing CRUD operations on Database Schema Entity

List database schemas

List database Schemas

Securityx-api-key
Request
path Parameters
org
required
string

Organization identifier

project
required
string

Project identifier

query Parameters
page
integer <int64>
Default: 0

Pagination page number strategy: Specify the page number within the paginated collection related to the number of items on each page.

limit
integer <= 100
Default: 10

Pagination: Number of items to return.

search_term
string

This would be used to filter resources having attributes matching the search term.

sort
string
Default: "created"

Parameter on the basis of which sorting is done.

Enum: "name" "updated" "created"
order
string
Default: "DESC"

Order on the basis of which sorting is done.

Enum: "ASC" "DESC"
header Parameters
Harness-Account
string

Identifier field of the account the resource is scoped to. This is required for Authorization methods other than the x-api-key header. If you are using the x-api-key header, this can be skipped.

Responses
200

Response body for List Database Schema

400

Error Response body

403

Error Response body

500

Error Response body

get/v1/orgs/{org}/projects/{project}/dbschema
Request samples
Response samples
application/json
[
  • {
    }
]

Create a database schema

Create a database schema

Securityx-api-key
Request
path Parameters
org
required
string

Organization identifier

project
required
string

Project identifier

header Parameters
Harness-Account
string

Identifier field of the account the resource is scoped to. This is required for Authorization methods other than the x-api-key header. If you are using the x-api-key header, this can be skipped.

Request Body schema: application/json
required
object (changeLog script)

if schemaType is Script location of the changelog file after using a custom script to download

object (Changelog)

if schemaType is Repository location of the changelog file containing schema changes in a git repository

identifier
required
string^[a-zA-Z_][0-9a-zA-Z_$]{0,127}$

identifier of the database schema

name
required
string

name of the database schema

service
string non-empty

harness service corresponding to database schema

object <= 128 properties

tags attached to the database schema

type
string (DBSchemaType)

db schema type

Enum: "Repository" "Script"
Responses
201

Response body for Database Schema

400

Error Response body

403

Error Response body

404

Error Response body

500

Error Response body

post/v1/orgs/{org}/projects/{project}/dbschema
Request samples
application/json
{
  • "changeLogScript": {
    },
  • "changelog": {
    },
  • "identifier": "string",
  • "name": "string",
  • "service": "harness_service",
  • "tags": {
    },
  • "type": "Repository"
}
Response samples
application/json
{
  • "changeLogScript": {
    },
  • "changelog": {
    },
  • "created": 0,
  • "identifier": "string",
  • "instanceCount": 0,
  • "name": "string",
  • "schemaSourceType": "Git",
  • "service": "string",
  • "tags": {
    },
  • "type": "Repository",
  • "updated": 0
}

Delete a database schema

Delete a database schema

Securityx-api-key
Request
path Parameters
org
required
string

Organization identifier

project
required
string

Project identifier

dbschema
required
string <= 128 characters

Identifier of the database schema

header Parameters
Harness-Account
string

Identifier field of the account the resource is scoped to. This is required for Authorization methods other than the x-api-key header. If you are using the x-api-key header, this can be skipped.

Responses
204

The database schema was deleted successfully

400

Error Response body

403

Error Response body

404

Error Response body

500

Error Response body

delete/v1/orgs/{org}/projects/{project}/dbschema/{dbschema}
Request samples
Response samples
application/json
{
  • "message": "string"
}

Get a database schema

Retrieves the specified database schema

Securityx-api-key
Request
path Parameters
org
required
string

Organization identifier

project
required
string

Project identifier

dbschema
required
string <= 128 characters

Identifier of the database schema

header Parameters
Harness-Account
string

Identifier field of the account the resource is scoped to. This is required for Authorization methods other than the x-api-key header. If you are using the x-api-key header, this can be skipped.

Responses
200

Response body for Database Schema

400

Error Response body

403

Error Response body

404

Error Response body

500

Error Response body

get/v1/orgs/{org}/projects/{project}/dbschema/{dbschema}
Request samples
Response samples
application/json
{
  • "changeLogScript": {
    },
  • "changelog": {
    },
  • "created": 0,
  • "identifier": "string",
  • "instanceCount": 0,
  • "name": "string",
  • "schemaSourceType": "Git",
  • "service": "string",
  • "tags": {
    },
  • "type": "Repository",
  • "updated": 0
}

Update a database schema

Update a database schema

Securityx-api-key
Request
path Parameters
org
required
string

Organization identifier

project
required
string

Project identifier

dbschema
required
string <= 128 characters

Identifier of the database schema

header Parameters
Harness-Account
string

Identifier field of the account the resource is scoped to. This is required for Authorization methods other than the x-api-key header. If you are using the x-api-key header, this can be skipped.

Request Body schema: application/json
required

Database schema update request

object

if schemaType is Script location of the changelog file after using a custom script to download

object

location of the changelog file containing schema changes in a git repository

name
string <= 128 characters

name of the database schema

service
string

harness service corresponding to database schema

object <= 128 properties

Database Schema tags

type
string (DBSchemaType)

db schema type

Enum: "Repository" "Script"
Responses
200

Response body for Database Schema

400

Error Response body

403

Error Response body

404

Error Response body

500

Error Response body

put/v1/orgs/{org}/projects/{project}/dbschema/{dbschema}
Request samples
application/json
{
  • "changeLogScript": {
    },
  • "changelog": {
    },
  • "name": "string",
  • "service": "harness_service",
  • "tags": {
    },
  • "type": "Repository"
}
Response samples
application/json
{
  • "changeLogScript": {
    },
  • "changelog": {
    },
  • "created": 0,
  • "identifier": "string",
  • "instanceCount": 0,
  • "name": "string",
  • "schemaSourceType": "Git",
  • "service": "string",
  • "tags": {
    },
  • "type": "Repository",
  • "updated": 0
}

Update a database instance

Update a database instance

Securityx-api-key
Request
path Parameters
org
required
string

Organization identifier

project
required
string

Project identifier

dbschema
required
string <= 128 characters

Identifier of the database schema

dbinstance
required
string

database instance unique id

header Parameters
Harness-Account
string

Identifier field of the account the resource is scoped to. This is required for Authorization methods other than the x-api-key header. If you are using the x-api-key header, this can be skipped.

Request Body schema: application/json
required

Database instance update request

branch
string

branch where the instance is stored

connector
string

DB Connector

context
string

Liquibase context

object

properties to substitute in liquibase changelog

name
string <= 128 characters

name of the database instance

object <= 128 properties

Database instance tags

version
string

version of the changelog applied to the database

Responses
200

Response body for Database Instance

400

Error Response body

403

Error Response body

404

Error Response body

500

Error Response body

put/v1/orgs/{org}/projects/{project}/dbschema/{dbschema}/instance/{dbinstance}
Request samples
application/json
{
  • "branch": "string",
  • "connector": "string",
  • "context": "string",
  • "name": "string",
  • "tags": {
    }
}
Response samples
application/json
{
  • "branch": "string",
  • "connector": "string",
  • "context": "string",
  • "created": 0,
  • "identifier": "string",
  • "lastAppliedTag": "string",
  • "lastDeployedChangeSetTag": "string",
  • "liquibaseSubstituteProperties": {
    },
  • "name": "string",
  • "schemaId": "string",
  • "schemaIdentifier": "string",
  • "tags": {
    },
  • "toOnboard": true,
  • "updated": 0
}