Skip to content

Commit

Permalink
api: show cluster version (#1319)
Browse files Browse the repository at this point in the history
* fix some badly named API endpoints

# Conflicts:
#	pkg/instance/api_instance.go
#	schema.yml
#	web/src/pages/overview/cards/VersionCard.ts

* update go api
  • Loading branch information
BeryJu authored Nov 25, 2024
1 parent 6272435 commit 04f114e
Show file tree
Hide file tree
Showing 21 changed files with 765 additions and 388 deletions.
17 changes: 5 additions & 12 deletions api/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
.travis.yml
README.md
api/openapi.yaml
api_cluster.go
api_cluster_instances.go
api_roles_api.go
api_roles_backup.go
Expand Down Expand Up @@ -52,6 +53,7 @@ docs/BackupAPIRoleConfigInput.md
docs/BackupAPIRoleConfigOutput.md
docs/BackupBackupStatus.md
docs/BackupRoleConfig.md
docs/ClusterApi.md
docs/ClusterInstancesApi.md
docs/DhcpAPILease.md
docs/DhcpAPILeaseInfo.md
Expand Down Expand Up @@ -84,8 +86,8 @@ docs/DnsAPIZonesGetOutput.md
docs/DnsAPIZonesPutInput.md
docs/DnsRoleConfig.md
docs/ExtconfigExtConfigDirs.md
docs/InstanceAPIClusterInfoOutput.md
docs/InstanceAPIInstanceInfo.md
docs/InstanceAPIInstancesOutput.md
docs/InstanceAPIRoleRestartInput.md
docs/InstanceInstanceInfo.md
docs/MonitoringAPIRoleConfigInput.md
Expand Down Expand Up @@ -188,8 +190,8 @@ model_dns_api_zones_get_output.go
model_dns_api_zones_put_input.go
model_dns_role_config.go
model_extconfig_ext_config_dirs.go
model_instance_api_cluster_info_output.go
model_instance_api_instance_info.go
model_instance_api_instances_output.go
model_instance_api_role_restart_input.go
model_instance_instance_info.go
model_monitoring_api_role_config_input.go
Expand All @@ -212,14 +214,5 @@ model_types_api_metrics_role.go
model_types_dhcp_option.go
model_types_oidc_config.go
response.go
test/api_cluster_instances_test.go
test/api_roles_api_test.go
test/api_roles_backup_test.go
test/api_roles_dhcp_test.go
test/api_roles_discovery_test.go
test/api_roles_dns_test.go
test/api_roles_etcd_test.go
test/api_roles_monitoring_test.go
test/api_roles_tftp_test.go
test/api_roles_tsdb_test.go
test/api_cluster_test.go
utils.go
6 changes: 3 additions & 3 deletions api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ All URIs are relative to *http://localhost*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*ClusterInstancesApi* | [**ClusterGetInfo**](docs/ClusterInstancesApi.md#clustergetinfo) | **Get** /api/v1/cluster/info | Instance
*ClusterInstancesApi* | [**ClusterGetInstances**](docs/ClusterInstancesApi.md#clustergetinstances) | **Get** /api/v1/cluster/instances | Instances
*ClusterApi* | [**ClusterGetClusterInfo**](docs/ClusterApi.md#clustergetclusterinfo) | **Get** /api/v1/cluster | Cluster
*ClusterInstancesApi* | [**ClusterGetInstanceInfo**](docs/ClusterInstancesApi.md#clustergetinstanceinfo) | **Get** /api/v1/cluster/instance | Instance
*ClusterInstancesApi* | [**ClusterInstanceRoleRestart**](docs/ClusterInstancesApi.md#clusterinstancerolerestart) | **Post** /api/v1/cluster/roles/restart | Instance roles
*RolesApiApi* | [**ApiAuthConfig**](docs/RolesApiApi.md#apiauthconfig) | **Get** /api/v1/auth/config | API Users
*RolesApiApi* | [**ApiDeleteTokens**](docs/RolesApiApi.md#apideletetokens) | **Delete** /api/v1/auth/tokens | Tokens
Expand Down Expand Up @@ -213,8 +213,8 @@ Class | Method | HTTP request | Description
- [DnsAPIZonesPutInput](docs/DnsAPIZonesPutInput.md)
- [DnsRoleConfig](docs/DnsRoleConfig.md)
- [ExtconfigExtConfigDirs](docs/ExtconfigExtConfigDirs.md)
- [InstanceAPIClusterInfoOutput](docs/InstanceAPIClusterInfoOutput.md)
- [InstanceAPIInstanceInfo](docs/InstanceAPIInstanceInfo.md)
- [InstanceAPIInstancesOutput](docs/InstanceAPIInstancesOutput.md)
- [InstanceAPIRoleRestartInput](docs/InstanceAPIRoleRestartInput.md)
- [InstanceInstanceInfo](docs/InstanceInstanceInfo.md)
- [MonitoringAPIRoleConfigInput](docs/MonitoringAPIRoleConfigInput.md)
Expand Down
110 changes: 59 additions & 51 deletions api/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,25 @@ paths:
summary: Backup status
tags:
- roles/backup
/api/v1/cluster:
get:
operationId: cluster.get_cluster_info
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/InstanceAPIClusterInfoOutput'
description: OK
"500":
content:
application/json:
schema:
$ref: '#/components/schemas/RestErrResponse'
description: Internal Server Error
summary: Cluster
tags:
- cluster
/api/v1/cluster/export:
post:
operationId: api.export
Expand Down Expand Up @@ -302,9 +321,9 @@ paths:
summary: Import Cluster
tags:
- roles/api
/api/v1/cluster/info:
/api/v1/cluster/instance:
get:
operationId: cluster.get_info
operationId: cluster.get_instance_info
responses:
"200":
content:
Expand All @@ -321,25 +340,6 @@ paths:
summary: Instance
tags:
- cluster/instances
/api/v1/cluster/instances:
get:
operationId: cluster.get_instances
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/InstanceAPIInstancesOutput'
description: OK
"500":
content:
application/json:
schema:
$ref: '#/components/schemas/RestErrResponse'
description: Internal Server Error
summary: Instances
tags:
- cluster/instances
/api/v1/cluster/node/logs:
get:
operationId: api.get_log_messages
Expand Down Expand Up @@ -3053,37 +3053,9 @@ components:
tftpLocalDir:
type: string
type: object
InstanceAPIInstanceInfo:
example:
currentInstanceIdentifier: currentInstanceIdentifier
currentInstanceIP: currentInstanceIP
buildHash: buildHash
dirs:
backupDir: backupDir
etcdDir: etcdDir
certDir: certDir
tftpLocalDir: tftpLocalDir
version: version
properties:
buildHash:
type: string
currentInstanceIP:
type: string
currentInstanceIdentifier:
type: string
dirs:
$ref: '#/components/schemas/ExtconfigExtConfigDirs'
version:
type: string
required:
- buildHash
- currentInstanceIP
- currentInstanceIdentifier
- dirs
- version
type: object
InstanceAPIInstancesOutput:
InstanceAPIClusterInfoOutput:
example:
clusterVersionShort: clusterVersionShort
instances:
- identifier: identifier
ip: ip
Expand All @@ -3097,15 +3069,51 @@ components:
- roles
- roles
version: version
clusterVersion: clusterVersion
properties:
clusterVersion:
type: string
clusterVersionShort:
type: string
instances:
items:
$ref: '#/components/schemas/InstanceInstanceInfo'
nullable: true
type: array
required:
- clusterVersion
- clusterVersionShort
- instances
type: object
InstanceAPIInstanceInfo:
example:
buildHash: buildHash
dirs:
backupDir: backupDir
etcdDir: etcdDir
certDir: certDir
tftpLocalDir: tftpLocalDir
instanceIdentifier: instanceIdentifier
version: version
instanceIP: instanceIP
properties:
buildHash:
type: string
dirs:
$ref: '#/components/schemas/ExtconfigExtConfigDirs'
instanceIP:
type: string
instanceIdentifier:
type: string
version:
type: string
required:
- buildHash
- dirs
- instanceIP
- instanceIdentifier
- version
type: object
InstanceAPIRoleRestartInput:
example:
roleId: roleId
Expand Down
130 changes: 130 additions & 0 deletions api/api_cluster.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 04f114e

Please sign in to comment.