> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/api-reference/software-delivery-agent-apis/database-devops/harness-nextgen-software-delivery-platform-api-reference.md).

# Harness NextGen Software Delivery Platform API Reference

## DB Metadata Snapshot File Upload

> Sending DB snapshot file from plugin to harness for capturing current state

```json
{"openapi":"3.0.0","info":{"title":"Harness NextGen Software Delivery Platform API Reference","version":"1.0"},"paths":{"/v1/dbops/metadata-snapshot/{snapshotId}":{"post":{"description":"Sending DB snapshot file from plugin to harness for capturing current state","operationId":"PostV1DbopsMetadataSnapshot","parameters":[{"$ref":"#/components/parameters/AccountHeader"},{"$ref":"#/components/parameters/HarnessCommand"},{"$ref":"#/components/parameters/PipelineExecutionId"},{"$ref":"#/components/parameters/StageExecutionId"},{"$ref":"#/components/parameters/PipelineIdentifierQuery"},{"$ref":"#/components/parameters/DbInstanceQuery"},{"$ref":"#/components/parameters/DbSchemaQuery"},{"description":"Sha256 of the content to validate on server if provided (hex-encoded)","in":"header","name":"X-Checksum-Sha256","schema":{"type":"string"}},{"description":"Harness parentUnique Id for schema","in":"query","name":"parentId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/octet-stream":{"schema":{"format":"binary","type":"string"}}}},"responses":{"201":{"description":"Created"},"400":{"$ref":"#/components/responses/ErrorResponse"},"403":{"$ref":"#/components/responses/ErrorResponse"},"500":{"$ref":"#/components/responses/ErrorResponse"}},"summary":"DB Metadata Snapshot File Upload"}}},"components":{"parameters":{"AccountHeader":{"description":"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.","in":"header","name":"Harness-Account","schema":{"type":"string"}},"HarnessCommand":{"description":"Harness command  Example : Update, Rollback","in":"query","name":"harnessCommand","required":true,"schema":{"enum":["Update","Rollback","DBOPSUpdateSQL","DBOPSRollbackSQL","DBOPSRollbackCountSQL","DBOPSSnapshot","RollbackOneChangesetSQL"],"type":"string"}},"PipelineExecutionId":{"description":"plan execution Id of the pipeline execution","in":"query","name":"pipelineExecutionId","required":true,"schema":{"type":"string"}},"StageExecutionId":{"description":"stage execution id of the pipeline execution","in":"query","name":"stageExecutionId","required":true,"schema":{"type":"string"}},"PipelineIdentifierQuery":{"description":"Identifier for the Pipeline","in":"query","name":"pipelineIdentifier","required":true,"schema":{"type":"string"}},"DbInstanceQuery":{"description":"Identifier for the DBInstance","in":"query","name":"dbInstance","required":true,"schema":{"type":"string"}},"DbSchemaQuery":{"description":"DB Schema identifier","in":"query","name":"dbSchema","required":true,"schema":{"type":"string"}}},"responses":{"ErrorResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error Response body"}},"schemas":{"Error":{"description":"Error Response","properties":{"message":{"description":"error message detail","type":"string"}},"required":["message"],"title":"Error Response","type":"object"}}}}
```

## List database instances

> List database instances

```json
{"openapi":"3.0.0","info":{"title":"Harness NextGen Software Delivery Platform API Reference","version":"1.0"},"paths":{"/v1/orgs/{org}/projects/{project}/dbinstancelist":{"post":{"description":"List database instances","operationId":"V2ListProjDbInstances","parameters":[{"$ref":"#/components/parameters/PageIndex"},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/SearchTerm"},{"$ref":"#/components/parameters/Order"},{"$ref":"#/components/parameters/Sort"}],"requestBody":{"$ref":"#/components/requestBodies/DBInstanceListRequest"},"responses":{"201":{"$ref":"#/components/responses/DBInstanceListResponse"},"400":{"$ref":"#/components/responses/ErrorResponse"},"403":{"$ref":"#/components/responses/ErrorResponse"},"404":{"$ref":"#/components/responses/ErrorResponse"},"500":{"$ref":"#/components/responses/ErrorResponse"}},"summary":"List database instances"}}},"components":{"parameters":{"PageIndex":{"description":"Pagination page number strategy: Specify the page number within the paginated collection related to the number of items on each page.","in":"query","name":"page","schema":{"default":0,"format":"int64","type":"integer"}},"Limit":{"description":"Pagination: Number of items to return.","in":"query","name":"limit","schema":{"default":10,"maximum":100,"type":"integer"}},"SearchTerm":{"allowEmptyValue":true,"description":"This would be used to filter resources having attributes matching the search term.","in":"query","name":"search_term","schema":{"type":"string"}},"Order":{"description":"Order on the basis of which sorting is done.","in":"query","name":"order","schema":{"default":"DESC","enum":["ASC","DESC"],"type":"string"}},"Sort":{"description":"Parameter on the basis of which sorting is done.","in":"query","name":"sort","schema":{"default":"created","enum":["name","updated","created"],"type":"string"}}},"requestBodies":{"DBInstanceListRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DBInstanceListInput"}}},"description":"Request for listing instances where schema input is not a required property."}},"schemas":{"DBInstanceListInput":{"description":"Input for filtering instances in list API","properties":{"instanceFQNs":{"description":"list of '-' separated values of schema identifier and instance identifiers","items":{"type":"string"},"type":"array"},"schemaIdentifiers":{"description":"list of schema identifiers to filter instances","items":{"type":"string"},"type":"array"}},"title":"DBInstanceListInput","type":"object"},"DBInstanceOut":{"description":"Database Instance Response","properties":{"branch":{"description":"branch where the instance is stored","type":"string"},"commitSha":{"description":"commit SHA to pin the changelog to a specific revision","type":"string"},"connector":{"description":"DB Connector","type":"string"},"context":{"description":"Liquibase context","type":"string"},"created":{"description":"epoch seconds when the database instance was created","format":"int64","type":"integer"},"gitTag":{"description":"Git tag to pin the changelog to a specific tagged revision","type":"string"},"identifier":{"description":"identifier of the database instance","type":"string"},"lastAppliedTag":{"description":"Most recent tag applied to the database","type":"string"},"lastDeployedChangeSetTag":{"description":"Tag on last deployed changeSet","type":"string"},"name":{"description":"name of the database instance","type":"string"},"schemaId":{"type":"string"},"schemaIdentifier":{"type":"string"},"substituteProperties":{"additionalProperties":{"type":"string"},"description":"Placeholder replacement in migration scripts.","type":"object"},"tags":{"additionalProperties":{"type":"string"},"description":"tags attached to the database instance","type":"object"},"toOnboard":{"type":"boolean"},"updated":{"description":"epoch seconds when the database instance was last updated","format":"int64","type":"integer"}},"required":["identifier","name","created","connector","lastDeployedChangeSetTag"],"title":"Database Instance Response","type":"object"},"Error":{"description":"Error Response","properties":{"message":{"description":"error message detail","type":"string"}},"required":["message"],"title":"Error Response","type":"object"}},"responses":{"DBInstanceListResponse":{"content":{"application/json":{"schema":{"description":"Response body for List Schema","items":{"$ref":"#/components/schemas/DBInstanceOut"},"type":"array"}}},"description":"Response body for List Database Schema","headers":{"X-Page-Number":{"description":"Page number in Paginated response.","schema":{"type":"integer"}},"X-Page-Size":{"description":"Maximum page size in Paginated response.","schema":{"type":"integer"}},"X-Total-Elements":{"description":"Total number of elements returned in Paginated response.","schema":{"type":"integer"}}}},"ErrorResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error Response body"}}}}
```

## List database schemas

> List database schemas

```json
{"openapi":"3.0.0","info":{"title":"Harness NextGen Software Delivery Platform API Reference","version":"1.0"},"paths":{"/v1/orgs/{org}/projects/{project}/dbschemalist":{"post":{"description":"List database schemas","operationId":"V2ListProjDbSchema","parameters":[{"$ref":"#/components/parameters/PageIndex"},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/SearchTerm"},{"$ref":"#/components/parameters/Order"},{"$ref":"#/components/parameters/Sort"}],"requestBody":{"$ref":"#/components/requestBodies/DBSchemaFilterRequest"},"responses":{"201":{"$ref":"#/components/responses/DBSchemaListResponse"},"400":{"$ref":"#/components/responses/ErrorResponse"},"403":{"$ref":"#/components/responses/ErrorResponse"},"404":{"$ref":"#/components/responses/ErrorResponse"},"500":{"$ref":"#/components/responses/ErrorResponse"}},"summary":"List database schemas"}}},"components":{"parameters":{"PageIndex":{"description":"Pagination page number strategy: Specify the page number within the paginated collection related to the number of items on each page.","in":"query","name":"page","schema":{"default":0,"format":"int64","type":"integer"}},"Limit":{"description":"Pagination: Number of items to return.","in":"query","name":"limit","schema":{"default":10,"maximum":100,"type":"integer"}},"SearchTerm":{"allowEmptyValue":true,"description":"This would be used to filter resources having attributes matching the search term.","in":"query","name":"search_term","schema":{"type":"string"}},"Order":{"description":"Order on the basis of which sorting is done.","in":"query","name":"order","schema":{"default":"DESC","enum":["ASC","DESC"],"type":"string"}},"Sort":{"description":"Parameter on the basis of which sorting is done.","in":"query","name":"sort","schema":{"default":"created","enum":["name","updated","created"],"type":"string"}}},"requestBodies":{"DBSchemaFilterRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DBSchemaFilterIn"}}}}},"schemas":{"DBSchemaFilterIn":{"description":"List schema body input","properties":{"identifiers":{"description":"list of schema identifiers","items":{"type":"string"},"type":"array"}},"title":"DBSchemaFilterIn","type":"object"},"DBSchemaOut":{"description":"Database Schema Response","properties":{"changeLogScript":{"$ref":"#/components/schemas/ChangeLogScript"},"changelog":{"$ref":"#/components/schemas/Changelog"},"cloneResources":{"$ref":"#/components/schemas/CloneResources"},"created":{"description":"epoch seconds when the database schema was created","format":"int64","type":"integer"},"identifier":{"description":"identifier of the database schema","type":"string"},"instanceCount":{"description":"number of database instances corresponding to database schema","format":"int64","type":"integer"},"migrationType":{"$ref":"#/components/schemas/MigrationType"},"name":{"description":"name of the database schema","type":"string"},"parentId":{"description":"parentUniqueId for scope schema belongs to","type":"string"},"primaryDbInstanceId":{"description":"Identifier for the primary dbInstance used for advanced feature like LLM Authoring etc.","type":"string"},"schemaSourceType":{"enum":["Git","Artifactory","Custom","HarnessCode"],"readOnly":true,"type":"string"},"service":{"description":"harness service corresponding to database schema","type":"string"},"tags":{"additionalProperties":{"type":"string"},"description":"tags attached to the database schema","type":"object"},"type":{"$ref":"#/components/schemas/DBSchemaType"},"updated":{"description":"epoch seconds when the database schema was last updated","format":"int64","type":"integer"},"usePercona":{"default":false,"description":"if percona-toolkit is enabled","type":"boolean"}},"required":["identifier","name","created","instanceCount","type","parentId","migrationType","usePercona"],"title":"Database Schema Response","type":"object"},"ChangeLogScript":{"additionalProperties":false,"description":"if schemaType is Script location of the changelog file after using a custom script to download","properties":{"command":{"description":"command script used to download the changelog file","minLength":1,"type":"string"},"image":{"description":"The fully-qualified name (FQN) of the image","minLength":1,"type":"string"},"location":{"description":"location of the changelog file","type":"string"},"shell":{"description":"shell type","type":"string"},"toml":{"description":"config file for Flyway migration type","type":"string"}},"required":["image","command","shell","location"],"title":"changeLog script","type":"object"},"Changelog":{"additionalProperties":false,"description":"if schemaType is Repository location of the changelog file containing schema changes in a git repository.\nProvide connector for third-party git connectors, or repo without connector to use Harness Code Repository.\n","properties":{"archivePath":{"description":"path excluding the repo till the archive file","minLength":1,"type":"string"},"connector":{"description":"identifier of the harness git connector. Optional when using Harness Code Repository. Omit or set to empty string to use Harness Code Repository (requires `repo` to be set).\n","type":"string"},"includeAllPath":{"description":"path, relative to the changelog file's own directory (changelog.location), to a directory of existing SQL scripts to seed the changelog with via Liquibase's includeAll directive\n","minLength":1,"type":"string"},"location":{"description":"path to the change log file","minLength":1,"type":"string"},"repo":{"description":"repo name of the git based connector when ConnectionType is Account","minLength":1,"type":"string"},"toml":{"description":"config file for Flyway migration type","type":"string"}},"required":["location"],"type":"object"},"CloneResources":{"additionalProperties":false,"description":"Optional CPU/memory limits applied to DBOPS clone sub-steps\n(Git clone, Artifactory download, or custom Script run).\nWhen unset, pipeline step resources are used.\n","properties":{"limits":{"$ref":"#/components/schemas/ContainerResourceLimits"}},"type":"object"},"ContainerResourceLimits":{"additionalProperties":false,"description":"CPU and memory quantity limits for clone containers.\nCPU accepts cores (e.g. \"0.5\", \"1\") or millicores (e.g. \"400m\").\nMemory accepts Mi, Gi, M, G suffixes (e.g. \"500Mi\", \".5Gi\", \"1G\") or a unitless number.\n","properties":{"cpu":{"description":"CPU limit (e.g. 400m, 0.5, 1)","minLength":1,"type":"string"},"memory":{"description":"Memory limit (e.g. 500Mi, .5Gi, 1G)","minLength":1,"type":"string"}},"type":"object"},"MigrationType":{"default":"Liquibase","description":"DB Migration tool type","enum":["Liquibase","Flyway"],"title":"MigrationType","type":"string"},"DBSchemaType":{"description":"db schema type","enum":["Repository","Script"],"title":"DBSchemaType","type":"string"},"Error":{"description":"Error Response","properties":{"message":{"description":"error message detail","type":"string"}},"required":["message"],"title":"Error Response","type":"object"}},"responses":{"DBSchemaListResponse":{"content":{"application/json":{"schema":{"description":"Response body for List Schema","items":{"$ref":"#/components/schemas/DBSchemaOut"},"type":"array"}}},"description":"Response body for List Database Schema","headers":{"X-Page-Number":{"description":"Page number in Paginated response.","schema":{"type":"integer"}},"X-Page-Size":{"description":"Maximum page size in Paginated response.","schema":{"type":"integer"}},"X-Total-Elements":{"description":"Total number of elements returned in Paginated response.","schema":{"type":"integer"}}}},"ErrorResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error Response body"}}}}
```
