|
| 1 | +--- |
| 2 | +Title: Job scheduler requests |
| 3 | +alwaysopen: false |
| 4 | +categories: |
| 5 | +- docs |
| 6 | +- operate |
| 7 | +- rs |
| 8 | +description: REST API requests for the job scheduler |
| 9 | +headerRange: '[1-2]' |
| 10 | +hideListLinks: true |
| 11 | +linkTitle: job_scheduler |
| 12 | +weight: $weight |
| 13 | +--- |
| 14 | + |
| 15 | +| Method | Path | Description | |
| 16 | +|--------|------|-------------| |
| 17 | +| [GET](#get-job-scheduler) | `/v1/job_scheduler` | Get job scheduler settings | |
| 18 | +| [PUT](#put-job-scheduler) | `/v1/job_scheduler` | Update job scheduler settings | |
| 19 | + |
| 20 | +## Get job scheduler settings {#get-job-scheduler} |
| 21 | + |
| 22 | +```sh |
| 23 | +GET /v1/job_scheduler |
| 24 | +``` |
| 25 | + |
| 26 | +Get job scheduler information. |
| 27 | + |
| 28 | +### Permissions |
| 29 | + |
| 30 | +| Permission name | Roles | |
| 31 | +|-----------------|-------| |
| 32 | +| [view_cluster_info]({{< relref "/operate/rs/references/rest-api/permissions#view_cluster_info" >}}) | admin<br />cluster_member<br />cluster_viewer<br />db_member<br />db_viewer<br />user_manager | |
| 33 | + |
| 34 | +### Request {#get-request} |
| 35 | + |
| 36 | +#### Example HTTP request |
| 37 | + |
| 38 | +```sh |
| 39 | +GET /v1/job_scheduler |
| 40 | +``` |
| 41 | + |
| 42 | +#### Headers |
| 43 | + |
| 44 | +| Key | Value | Description | |
| 45 | +|-----|-------|-------------| |
| 46 | +| Host | cnm.cluster.fqdn | Domain name | |
| 47 | +| Accept | application/json | Accepted media type | |
| 48 | + |
| 49 | +### Response {#get-response} |
| 50 | + |
| 51 | +Returns a [job_scheduler object]({{<relref "/operate/rs/references/rest-api/objects/job_scheduler">}}). |
| 52 | + |
| 53 | +#### Example JSON body |
| 54 | + |
| 55 | +```json |
| 56 | +{ |
| 57 | + "backup_job_settings": { |
| 58 | + "cron_expression": "*/5 * * * *", |
| 59 | + "enabled": true |
| 60 | + }, |
| 61 | + "bdb_usage_report_job_settings": { |
| 62 | + "cron_expression": "0 */1 * * *", |
| 63 | + "enabled": false, |
| 64 | + "file_retention_days": 365 |
| 65 | + }, |
| 66 | + "cert_rotation_job_settings": { |
| 67 | + "cron_expression": "0 * * * *", |
| 68 | + "enabled": true, |
| 69 | + "expiry_days_before_rotation": 60 |
| 70 | + }, |
| 71 | + "log_rotation_job_settings": { |
| 72 | + "cron_expression": "*/5 * * * *", |
| 73 | + "enabled": true |
| 74 | + }, |
| 75 | + "node_checks_job_settings": { |
| 76 | + "cron_expression": "0 * * * *", |
| 77 | + "enabled": true |
| 78 | + }, |
| 79 | + "redis_cleanup_job_settings": { |
| 80 | + "cron_expression": "0 * * * *" |
| 81 | + }, |
| 82 | + "rotate_ccs_job_settings": { |
| 83 | + "cron_expression": "*/5 * * * *", |
| 84 | + "enabled": true, |
| 85 | + "file_suffix": "5min", |
| 86 | + "rotate_max_num": 24 |
| 87 | + } |
| 88 | +} |
| 89 | +``` |
| 90 | + |
| 91 | +#### Status codes {#get-status-codes} |
| 92 | + |
| 93 | +| Code | Description | |
| 94 | +|------|-------------| |
| 95 | +| [200 OK](https://www.rfc-editor.org/rfc/rfc9110.html#name-200-ok) | No error. | |
| 96 | + |
| 97 | +## Update job scheduler settings {#put-job-scheduler} |
| 98 | + |
| 99 | +```sh |
| 100 | +PUT /v1/job_scheduler |
| 101 | +``` |
| 102 | + |
| 103 | +Update job scheduler settings. |
| 104 | + |
| 105 | +### Permissions |
| 106 | + |
| 107 | +| Permission name | Roles | |
| 108 | +|-----------------|-------| |
| 109 | +| [update_cluster]({{< relref "/operate/rs/references/rest-api/permissions#update_cluster" >}}) | admin | |
| 110 | + |
| 111 | +### Request {#put-request} |
| 112 | + |
| 113 | +#### Example HTTP request |
| 114 | + |
| 115 | +```sh |
| 116 | +PUT /v1/job_scheduler |
| 117 | +``` |
| 118 | + |
| 119 | +#### Example JSON body |
| 120 | + |
| 121 | +```json |
| 122 | +{ |
| 123 | + "backup_job_settings": { |
| 124 | + "cron_expression": "*/10 * * * *" |
| 125 | + } |
| 126 | +} |
| 127 | +``` |
| 128 | + |
| 129 | +#### Headers |
| 130 | + |
| 131 | +| Key | Value | Description | |
| 132 | +|-----|-------|-------------| |
| 133 | +| Host | cnm.cluster.fqdn | Domain name | |
| 134 | +| Accept | application/json | Accepted media type | |
| 135 | + |
| 136 | + |
| 137 | +#### Body |
| 138 | + |
| 139 | +Include a [job_scheduler object]({{<relref "/operate/rs/references/rest-api/objects/job_scheduler">}}) with updated fields in the request body. |
| 140 | + |
| 141 | +### Response {#put-response} |
| 142 | + |
| 143 | +Returns a [job_scheduler object]({{<relref "/operate/rs/references/rest-api/objects/job_scheduler">}}) with the updated fields. |
| 144 | + |
| 145 | +#### Example JSON body |
| 146 | + |
| 147 | +```json |
| 148 | +{ |
| 149 | + "backup_job_settings": { |
| 150 | + "cron_expression": "*/10 * * * *", |
| 151 | + "enabled": true |
| 152 | + }, |
| 153 | + "bdb_usage_report_job_settings": { |
| 154 | + "cron_expression": "0 */1 * * *", |
| 155 | + "enabled": false, |
| 156 | + "file_retention_days": 365 |
| 157 | + }, |
| 158 | + "cert_rotation_job_settings": { |
| 159 | + "cron_expression": "0 * * * *", |
| 160 | + "enabled": true, |
| 161 | + "expiry_days_before_rotation": 60 |
| 162 | + }, |
| 163 | + "log_rotation_job_settings": { |
| 164 | + "cron_expression": "*/5 * * * *", |
| 165 | + "enabled": true |
| 166 | + }, |
| 167 | + "node_checks_job_settings": { |
| 168 | + "cron_expression": "0 * * * *", |
| 169 | + "enabled": true |
| 170 | + }, |
| 171 | + "rotate_ccs_job_settings": { |
| 172 | + "cron_expression": "*/5 * * * *", |
| 173 | + "enabled": true, |
| 174 | + "file_suffix": "5min", |
| 175 | + "rotate_max_num": 24 |
| 176 | + } |
| 177 | +} |
| 178 | +``` |
| 179 | + |
| 180 | +#### Status codes {#put-status-codes} |
| 181 | + |
| 182 | +| Code | Description | |
| 183 | +|------|-------------| |
| 184 | +| [200 OK](https://www.rfc-editor.org/rfc/rfc9110.html#name-200-ok) | No error. | |
| 185 | +| [400 Bad Request](https://www.rfc-editor.org/rfc/rfc9110.html#name-400-bad-request) | Bad content provided. | |
| 186 | +| [409 Conflict](https://www.rfc-editor.org/rfc/rfc9110.html#name-409-conflict) | Attempting to configure the job_scheduler while it is busy with another configuration change. In this context, this is a temporary condition and the request should be re-attempted later. | |
0 commit comments