Skip to content

Improve locality type of an API #1226

Open
@Vinzius

Description

@Vinzius

Context

At the moment, the locality object of an API (example with Instance) is only providing part of the information.

What information would be useful:

  • API is zonal
  • API is regional
  • API is global (missing)
  • API is missing its locality definition (missing)

Proposition

We could upgrade the object to this:

type ApiLocality = {
  type: 'zone'
  zones: Zone[]
} | {
  type: 'region'
  regions: Region[]
} | {
  type: 'global'
}

Which could lead to this object:

export class API extends ParentAPI {
  // Case 1: zone
  public static readonly LOCALITY: ApiLocality = { type: 'zone', zones: ['fr-par-1', 'fr-par-2'] }

  // Case 2: region
  public static readonly LOCALITY: ApiLocality = { type: 'region', regions: ['fr-par'] }

  // Case 3: global
  public static readonly LOCALITY: ApiLocality = { type: 'global' }

  // Case 4: not defined
}

Migration

Both objects would be supported for a period of time (the former one with a @deprecated).

Metadata

Metadata

Assignees

Labels

priority:mediumImprovements that are not the main priority

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions