Skip to content

Commit

Permalink
feat: Add cluster admin cli
Browse files Browse the repository at this point in the history
  • Loading branch information
AngelOnFira committed Apr 21, 2024
1 parent 1f4b169 commit 2002c43
Show file tree
Hide file tree
Showing 136 changed files with 7,666 additions and 884 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/devcontainers/base:bullseye
FROM mcr.microsoft.com/devcontainers/base:bookworm

RUN apt-get update \
&& export DEBIAN_FRONTEND=noninteractive \
Expand Down
23 changes: 0 additions & 23 deletions fern/definition/admin/cluster/__package__.yml

This file was deleted.

59 changes: 59 additions & 0 deletions fern/definition/admin/clusters/__package__.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json

imports:
localCommons: ../common.yml

service:
auth: true
base-path: /admin/clusters
endpoints:
getServerIps:
path: /server_ips
method: GET
request:
name: GetServerIpsRequest
query-parameters:
server_id: optional<uuid>
pool: optional<localCommons.PoolType>
response: GetServerIpsResponse
get:
path: ""
method: GET
docs: Get clusters from ids
request:
name: GetRequest
query-parameters:
datacenter_ids:
type: uuid
allow-multiple: true
response: GetResponse
list:
path: /list
method: GET
docs: List all cluster ids
response: ListResponse
create:
path: ""
method: POST
docs: Create a new cluster
request:
body: CreateRequest
response: CreateResponse

types:
GetServerIpsResponse:
properties:
ips: list<string>
GetResponse:
properties:
clusters: list<localCommons.Cluster>
ListResponse:
properties:
cluster_ids: list<uuid>
CreateRequest:
properties:
name_id: string
owner_team_id: optional<uuid>
CreateResponse:
properties:
cluster_id: uuid
58 changes: 58 additions & 0 deletions fern/definition/admin/clusters/datacenters/__package__.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json

imports:
localCommons: ../../common.yml

service:
auth: true
base-path: /admin/clusters/{cluster_id}/datacenters
path-parameters:
cluster_id:
type: uuid
endpoints:
get:
path: ""
method: GET
docs: Get datacenters from ids
request:
name: GetRequest
query-parameters:
datacenter_ids:
type: uuid
allow-multiple: true
response: GetResponse
list:
path: /list
method: GET
docs: List all datacenter ids
response: ListResponse
create:
path: ""
method: POST
request:
body: CreateRequest
response: CreateResponse
taint:
path: /{datacenter_id}/taint
path-parameters:
datacenter_id:
type: string
method: POST

types:
GetResponse:
properties:
datacenters: list<localCommons.Datacenter>
ListResponse:
properties:
datacenter_ids: list<uuid>
CreateRequest:
properties:
display_name: string
name_id: string
provider: localCommons.Provider
provider_datacenter_id: string
build_delivery_method: localCommons.BuildDeliveryMethod
CreateResponse:
properties:
datacenter_id: uuid
34 changes: 34 additions & 0 deletions fern/definition/admin/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,37 @@ types:
- job
- gg
- ats
Provider:
enum:
- linode
BuildDeliveryMethod:
enum:
- traffic_server
- s3_direct
Pool:
properties:
pool_type: PoolType
hardware: list<Hardware>
desired_count: integer
max_count: integer
Hardware:
properties:
provider_hardware: string
Cluster:
properties:
cluster_id: uuid
name_id: string
create_ts: long
owner_team_id: optional<uuid>
Datacenter:
properties:
datacenter_id: optional<uuid>
cluster_id: optional<uuid>
name_id: string
display_name: string
provider: Provider
provider_datacenter_id: string
provider_api_token: optional<string>
pools: list<Pool>
build_delivery_method: BuildDeliveryMethod
drain_timeout: long
1 change: 1 addition & 0 deletions infra/nix/bolt/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ let
"lib/bolt"
"lib/s3-util"
"proto"
"sdks/full/rust"
];

includeFilter = path: type: let
Expand Down
Loading

0 comments on commit 2002c43

Please sign in to comment.