Commit 8e028ffa authored by Michael Kozono's avatar Michael Kozono

Add Geo node name field to API

parent a58c009f
...@@ -19,6 +19,7 @@ Example response: ...@@ -19,6 +19,7 @@ Example response:
[ [
{ {
"id": 1, "id": 1,
"name": "us-node",
"url": "https://primary.example.com/", "url": "https://primary.example.com/",
"internal_url": "https://internal.example.com/", "internal_url": "https://internal.example.com/",
"primary": true, "primary": true,
...@@ -31,6 +32,7 @@ Example response: ...@@ -31,6 +32,7 @@ Example response:
}, },
{ {
"id": 2, "id": 2,
"name": "cn-node",
"url": "https://secondary.example.com/", "url": "https://secondary.example.com/",
"internal_url": "https://secondary.example.com/", "internal_url": "https://secondary.example.com/",
"primary": false, "primary": false,
...@@ -59,6 +61,7 @@ Example response: ...@@ -59,6 +61,7 @@ Example response:
```json ```json
{ {
"id": 1, "id": 1,
"name": "us-node",
"url": "https://primary.example.com/", "url": "https://primary.example.com/",
"internal_url": "https://primary.example.com/", "internal_url": "https://primary.example.com/",
"primary": true, "primary": true,
...@@ -85,7 +88,8 @@ PUT /geo_nodes/:id ...@@ -85,7 +88,8 @@ PUT /geo_nodes/:id
|----------------------|---------|-----------|---------------------------------------------------------------------------| |----------------------|---------|-----------|---------------------------------------------------------------------------|
| `id` | integer | yes | The ID of the Geo node. | | `id` | integer | yes | The ID of the Geo node. |
| `enabled` | boolean | no | Flag indicating if the Geo node is enabled. | | `enabled` | boolean | no | Flag indicating if the Geo node is enabled. |
| `url` | string | no | The URL to connect to the Geo node. | | `name` | string | yes | The unique identifier for the Geo node. Must match `geo_node_name` if it is set in gitlab.rb, otherwise it must match `external_url`. |
| `url` | string | yes | The user-facing URL of the Geo node. |
| `internal_url` | string | no | The URL defined on the primary node that secondary nodes should use to contact it. Returns `url` if not set.| | `internal_url` | string | no | The URL defined on the primary node that secondary nodes should use to contact it. Returns `url` if not set.|
| `files_max_capacity` | integer | no | Control the maximum concurrency of LFS/attachment backfill for this secondary node. | | `files_max_capacity` | integer | no | Control the maximum concurrency of LFS/attachment backfill for this secondary node. |
| `repos_max_capacity` | integer | no | Control the maximum concurrency of repository backfill for this secondary node. | | `repos_max_capacity` | integer | no | Control the maximum concurrency of repository backfill for this secondary node. |
...@@ -96,6 +100,7 @@ Example response: ...@@ -96,6 +100,7 @@ Example response:
```json ```json
{ {
"id": 1, "id": 1,
"name": "cn-node",
"url": "https://secondary.example.com/", "url": "https://secondary.example.com/",
"internal_url": "https://secondary.example.com/", "internal_url": "https://secondary.example.com/",
"primary": false, "primary": false,
...@@ -138,6 +143,7 @@ Example response: ...@@ -138,6 +143,7 @@ Example response:
```json ```json
{ {
"id": 1, "id": 1,
"name": "us-node",
"url": "https://primary.example.com/", "url": "https://primary.example.com/",
"internal_url": "https://primary.example.com/", "internal_url": "https://primary.example.com/",
"primary": true, "primary": true,
......
...@@ -143,7 +143,8 @@ module API ...@@ -143,7 +143,8 @@ module API
end end
params do params do
optional :enabled, type: Boolean, desc: 'Flag indicating if the Geo node is enabled' optional :enabled, type: Boolean, desc: 'Flag indicating if the Geo node is enabled'
optional :url, type: String, desc: 'The URL to connect to the Geo node' optional :name, type: String, desc: 'The unique identifier for the Geo node. Must match `geo_node_name` if it is set in gitlab.rb, otherwise it must match `external_url`'
optional :url, type: String, desc: 'The user-facing URL of the Geo node'
optional :internal_url, type: String, desc: 'The URL defined on the primary node that secondary nodes should use to contact it. Defaults to url' optional :internal_url, type: String, desc: 'The URL defined on the primary node that secondary nodes should use to contact it. Defaults to url'
optional :files_max_capacity, type: Integer, desc: 'Control the maximum concurrency of LFS/attachment backfill for this secondary node' optional :files_max_capacity, type: Integer, desc: 'Control the maximum concurrency of LFS/attachment backfill for this secondary node'
optional :repos_max_capacity, type: Integer, desc: 'Control the maximum concurrency of repository backfill for this secondary node' optional :repos_max_capacity, type: Integer, desc: 'Control the maximum concurrency of repository backfill for this secondary node'
......
...@@ -456,6 +456,7 @@ module EE ...@@ -456,6 +456,7 @@ module EE
include ::API::Helpers::RelatedResourcesHelpers include ::API::Helpers::RelatedResourcesHelpers
expose :id expose :id
expose :name
expose :url expose :url
expose :internal_url expose :internal_url
expose :primary?, as: :primary expose :primary?, as: :primary
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
"type": "object", "type": "object",
"required" : [ "required" : [
"id", "id",
"name",
"url", "url",
"primary", "primary",
"enabled", "enabled",
...@@ -14,6 +15,7 @@ ...@@ -14,6 +15,7 @@
], ],
"properties" : { "properties" : {
"id": { "type": "integer" }, "id": { "type": "integer" },
"name": { "type": ["string", "null"] },
"url": { "type": ["string", "null"] }, "url": { "type": ["string", "null"] },
"primary": { "type": "boolean" }, "primary": { "type": "boolean" },
"internal_url": { "type": ["string", "null"] }, "internal_url": { "type": ["string", "null"] },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment