|
| 1 | +# DatabasesApi |
| 2 | + |
| 3 | +All URIs are relative to *https://api.ionos.com/databases/postgresql* |
| 4 | + |
| 5 | +| Method | HTTP request | Description | |
| 6 | +| ------ | ------------ | ----------- | |
| 7 | +| [**databasesDelete**](DatabasesApi.md#databasesdelete) | **DELETE** /clusters/{clusterId}/databases/{databasename} | Delete database | |
| 8 | +| [**databasesGet**](DatabasesApi.md#databasesget) | **GET** /clusters/{clusterId}/databases/{databasename} | Get database | |
| 9 | +| [**databasesList**](DatabasesApi.md#databaseslist) | **GET** /clusters/{clusterId}/databases | List databases | |
| 10 | +| [**databasesPost**](DatabasesApi.md#databasespost) | **POST** /clusters/{clusterId}/databases | Create a database | |
| 11 | + |
| 12 | + |
| 13 | +## databasesDelete |
| 14 | + |
| 15 | +> databasesDelete(clusterId, databasename) |
| 16 | +
|
| 17 | +Delete database |
| 18 | + |
| 19 | +Deletes a single database |
| 20 | + |
| 21 | +### Examples |
| 22 | + |
| 23 | +```javascript |
| 24 | +const ionoscloud = require('@ionos-cloud/sdk-nodejs-dbaas-postgres'); |
| 25 | +// setup authorization |
| 26 | +const config = new ionoscloud.Configuration({ |
| 27 | + username: 'YOUR_USERNAME', |
| 28 | + password: 'YOUR_PASSWORD', |
| 29 | + apiKey: 'YOUR_API_KEY' |
| 30 | +}); |
| 31 | +const api_instance = new ionoscloud.DatabasesApi(config); |
| 32 | +// Delete database |
| 33 | +api_instance |
| 34 | + .databasesDelete({ |
| 35 | + clusterId: 498ae72f-411f-11eb-9d07-046c59cc737e, |
| 36 | + databasename: benjamindb |
| 37 | + }) |
| 38 | + .then((response) => console.log(response.data)) |
| 39 | + .catch((error) => console.log(error.response.data)); |
| 40 | +``` |
| 41 | + |
| 42 | +### Parameters |
| 43 | + |
| 44 | +| Name | Type | Description | Notes | |
| 45 | +| ---- | ---- | ----------- | ----- | |
| 46 | +| **clusterId** | **string** | The unique ID of the cluster. | [default to undefined] | |
| 47 | +| **databasename** | **string** | The database name. | [default to undefined] | |
| 48 | + |
| 49 | +### Return type |
| 50 | + |
| 51 | +nil (empty response body) |
| 52 | + |
| 53 | +### Authorization |
| 54 | + |
| 55 | +basicAuth, tokenAuth |
| 56 | + |
| 57 | +### HTTP request headers |
| 58 | + |
| 59 | +- **Content-Type**: Not defined |
| 60 | +- **Accept**: application/json |
| 61 | + |
| 62 | + |
| 63 | +## databasesGet |
| 64 | + |
| 65 | +> <DatabaseResource> databasesGet(clusterId, databasename) |
| 66 | +
|
| 67 | +Get database |
| 68 | + |
| 69 | +Retrieves a single database |
| 70 | + |
| 71 | +### Examples |
| 72 | + |
| 73 | +```javascript |
| 74 | +const ionoscloud = require('@ionos-cloud/sdk-nodejs-dbaas-postgres'); |
| 75 | +// setup authorization |
| 76 | +const config = new ionoscloud.Configuration({ |
| 77 | + username: 'YOUR_USERNAME', |
| 78 | + password: 'YOUR_PASSWORD', |
| 79 | + apiKey: 'YOUR_API_KEY' |
| 80 | +}); |
| 81 | +const api_instance = new ionoscloud.DatabasesApi(config); |
| 82 | +// Get database |
| 83 | +api_instance |
| 84 | + .databasesGet({ |
| 85 | + clusterId: 498ae72f-411f-11eb-9d07-046c59cc737e, |
| 86 | + databasename: benjamindb |
| 87 | + }) |
| 88 | + .then((response) => console.log(response.data)) |
| 89 | + .catch((error) => console.log(error.response.data)); |
| 90 | +``` |
| 91 | + |
| 92 | +### Parameters |
| 93 | + |
| 94 | +| Name | Type | Description | Notes | |
| 95 | +| ---- | ---- | ----------- | ----- | |
| 96 | +| **clusterId** | **string** | The unique ID of the cluster. | [default to undefined] | |
| 97 | +| **databasename** | **string** | The database name. | [default to undefined] | |
| 98 | + |
| 99 | +### Return type |
| 100 | + |
| 101 | +[**DatabaseResource**](../models/DatabaseResource.md) |
| 102 | + |
| 103 | +### Authorization |
| 104 | + |
| 105 | +basicAuth, tokenAuth |
| 106 | + |
| 107 | +### HTTP request headers |
| 108 | + |
| 109 | +- **Content-Type**: Not defined |
| 110 | +- **Accept**: application/json |
| 111 | + |
| 112 | + |
| 113 | +## databasesList |
| 114 | + |
| 115 | +> <DatabaseList> databasesList(clusterId, opts) |
| 116 | +
|
| 117 | +List databases |
| 118 | + |
| 119 | +Retrieves a list of databases |
| 120 | + |
| 121 | +### Examples |
| 122 | + |
| 123 | +```javascript |
| 124 | +const ionoscloud = require('@ionos-cloud/sdk-nodejs-dbaas-postgres'); |
| 125 | +// setup authorization |
| 126 | +const config = new ionoscloud.Configuration({ |
| 127 | + username: 'YOUR_USERNAME', |
| 128 | + password: 'YOUR_PASSWORD', |
| 129 | + apiKey: 'YOUR_API_KEY' |
| 130 | +}); |
| 131 | +const api_instance = new ionoscloud.DatabasesApi(config); |
| 132 | +// List databases |
| 133 | +api_instance |
| 134 | + .databasesList({ |
| 135 | + clusterId: 498ae72f-411f-11eb-9d07-046c59cc737e, |
| 136 | + limit: 100, |
| 137 | + offset: 200, |
| 138 | + options: {} |
| 139 | + }) |
| 140 | + .then((response) => console.log(response.data)) |
| 141 | + .catch((error) => console.log(error.response.data)); |
| 142 | +``` |
| 143 | + |
| 144 | +### Parameters |
| 145 | + |
| 146 | +| Name | Type | Description | Notes | |
| 147 | +| ---- | ---- | ----------- | ----- | |
| 148 | +| **clusterId** | **string** | The unique ID of the cluster. | [default to undefined] | |
| 149 | +| **limit** | **number** | The maximum number of elements to return. Use together with \'offset\' for pagination. | [optional][default to 100] | |
| 150 | +| **offset** | **number** | The first element to return. Use together with \'limit\' for pagination. | [optional][default to 0] | |
| 151 | + |
| 152 | +### Return type |
| 153 | + |
| 154 | +[**DatabaseList**](../models/DatabaseList.md) |
| 155 | + |
| 156 | +### Authorization |
| 157 | + |
| 158 | +basicAuth, tokenAuth |
| 159 | + |
| 160 | +### HTTP request headers |
| 161 | + |
| 162 | +- **Content-Type**: Not defined |
| 163 | +- **Accept**: application/json |
| 164 | + |
| 165 | + |
| 166 | +## databasesPost |
| 167 | + |
| 168 | +> <DatabaseResource> databasesPost(clusterId, database) |
| 169 | +
|
| 170 | +Create a database |
| 171 | + |
| 172 | +Create a new database |
| 173 | + |
| 174 | +### Examples |
| 175 | + |
| 176 | +```javascript |
| 177 | +const ionoscloud = require('@ionos-cloud/sdk-nodejs-dbaas-postgres'); |
| 178 | +// setup authorization |
| 179 | +const config = new ionoscloud.Configuration({ |
| 180 | + username: 'YOUR_USERNAME', |
| 181 | + password: 'YOUR_PASSWORD', |
| 182 | + apiKey: 'YOUR_API_KEY' |
| 183 | +}); |
| 184 | +const api_instance = new ionoscloud.DatabasesApi(config); |
| 185 | +// Create a database |
| 186 | +api_instance |
| 187 | + .databasesPost({ |
| 188 | + clusterId: 498ae72f-411f-11eb-9d07-046c59cc737e, |
| 189 | + database: database_example |
| 190 | + }) |
| 191 | + .then((response) => console.log(response.data)) |
| 192 | + .catch((error) => console.log(error.response.data)); |
| 193 | +``` |
| 194 | + |
| 195 | +### Parameters |
| 196 | + |
| 197 | +| Name | Type | Description | Notes | |
| 198 | +| ---- | ---- | ----------- | ----- | |
| 199 | +| **clusterId** | **string** | The unique ID of the cluster. | [default to undefined] | |
| 200 | +| **database** | [**Database**](../models/Database.md) | a database to create | | |
| 201 | + |
| 202 | +### Return type |
| 203 | + |
| 204 | +[**DatabaseResource**](../models/DatabaseResource.md) |
| 205 | + |
| 206 | +### Authorization |
| 207 | + |
| 208 | +basicAuth, tokenAuth |
| 209 | + |
| 210 | +### HTTP request headers |
| 211 | + |
| 212 | +- **Content-Type**: application/json |
| 213 | +- **Accept**: application/json |
| 214 | + |
0 commit comments