-
Notifications
You must be signed in to change notification settings - Fork 399
upcoming: [M3-7213] - DC Get Well endpoints, queries, and mock data #9860
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
8390521
endpoints and endpoint types for dc get well
coliu-akamai 8441b4a
dc get well react query
coliu-akamai 437c79f
mock data
coliu-akamai 3af8960
update endpoint oops
coliu-akamai 2f45bff
changesets
coliu-akamai b79a37c
fix mock data
coliu-akamai 04811a9
update to region capabilities
coliu-akamai 717f8b8
Update packages/manager/.changeset/pr-9860-upcoming-features-16988525β¦
coliu-akamai 5649f45
Update packages/api-v4/.changeset/pr-9860-upcoming-features-169885246β¦
coliu-akamai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
packages/api-v4/.changeset/pr-9860-upcoming-features-1698852464578.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@linode/api-v4": Upcoming Features | ||
| --- | ||
|
|
||
| Add `getAccountAvailabilities` and `getAccountAvailability` methods for DC Get Well initiative ([#9860](https://github.com/linode/manager/pull/9860)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
packages/manager/.changeset/pr-9860-upcoming-features-1698852576816.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@linode/manager": Upcoming Features | ||
| --- | ||
|
|
||
| Add RQ queries and mock data for DC Get Well ([#9860](https://github.com/linode/manager/pull/9860)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| import { AccountAvailability } from '@linode/api-v4'; | ||
| import * as Factory from 'factory.ts'; | ||
|
|
||
| import { pickRandom } from 'src/utilities/random'; | ||
|
|
||
| export const accountAvailabilityFactory = Factory.Sync.makeFactory<AccountAvailability>( | ||
| { | ||
| id: pickRandom(['us-mia', 'ap-south', 'ap-northeast']), | ||
| unavailable: pickRandom([ | ||
| ['Block Storage'], | ||
| ['Linodes', 'Block Storage', 'Kubernetes', 'NodeBalancers'], | ||
| ]), | ||
| } | ||
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| import { | ||
| AccountAvailability, | ||
| getAccountAvailabilities, | ||
| getAccountAvailability, | ||
| } from '@linode/api-v4/lib/account'; | ||
| import { | ||
| APIError, | ||
| Filter, | ||
| Params, | ||
| ResourcePage, | ||
| } from '@linode/api-v4/lib/types'; | ||
| import { useQuery } from 'react-query'; | ||
|
|
||
| const queryKey = 'account-availability'; | ||
|
|
||
| export const useAccountAvailabilitiesQuery = ( | ||
| params: Params, | ||
| filter: Filter, | ||
| enabled: boolean = true | ||
| ) => { | ||
| return useQuery<ResourcePage<AccountAvailability>, APIError[]>( | ||
| [queryKey, 'paginated', params, filter], | ||
| () => getAccountAvailabilities(params, filter), | ||
| { | ||
| enabled, | ||
| keepPreviousData: true, | ||
| } | ||
| ); | ||
| }; | ||
|
|
||
| export const useAccountAvailabilityQuery = ( | ||
| id: string, | ||
| enabled: boolean = true | ||
| ) => { | ||
| return useQuery<AccountAvailability, APIError[]>( | ||
| [queryKey, 'accountAvailability', id], | ||
| () => getAccountAvailability(id), | ||
| { | ||
| enabled, | ||
| } | ||
| ); | ||
| }; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.