-
Notifications
You must be signed in to change notification settings - Fork 9
Migrate Aliyun Database Resources (RDS & ES Serverless) to state-based management engine #146
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 6 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
6894cab
Initial plan
Copilot 31740a2
Add Aliyun database resource types, operations, and state management …
Copilot 72fa483
Fix linting issues and add SDK dependencies for RDS and ES
Copilot c3f6057
Add unit tests for RDS and ES Serverless types
Copilot 6fbe8d7
Fix linting in rdsTypes test
Copilot 90efc76
Merge branch 'master' into copilot/migrate-aliyun-database-resources
Blankll b8ff83d
Replace ES SDK with es-serverless20230627 and add missing ES fields
Copilot a8fab9f
Refactor Aliyun database operations to follow existing patterns
Copilot 72ddd6f
Update tests to use camelCase properties for RDS and ES types
Copilot bf2373c
fix: tests
Blankll 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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,89 @@ | ||
| import EsClient from '@alicloud/elasticsearch20170613'; | ||
| import { Context } from '../../types'; | ||
|
|
||
| export type EsConfig = { | ||
| AppName: string; | ||
| AppVersion: string; | ||
| Authentication?: { | ||
| BasicAuth?: Array<{ | ||
| Password: string; | ||
| }>; | ||
| }; | ||
| QuotaInfo: { | ||
| AppType: string; | ||
| MinCu: number; | ||
| }; | ||
| Description?: string; | ||
| Network?: Array<{ | ||
| Type: string; | ||
| Enabled: boolean; | ||
| WhiteIpGroup?: Array<{ | ||
| GroupName: string; | ||
| Ips: string[]; | ||
| }>; | ||
| }>; | ||
| ChargeType?: string; | ||
| RegionId?: string; | ||
| }; | ||
|
|
||
| export type EsInfo = { | ||
| AppId?: string; | ||
| AppName?: string; | ||
| AppVersion?: string; | ||
| Status?: string; | ||
| Description?: string; | ||
| CreateTime?: number; | ||
| ModifiedTime?: number; | ||
| RegionId?: string; | ||
| QuotaInfo?: { | ||
| AppType?: string; | ||
| MinCu?: number; | ||
| }; | ||
| Network?: Array<{ | ||
| Type?: string; | ||
| Enabled?: boolean; | ||
| WhiteIpGroup?: Array<{ | ||
| GroupName?: string; | ||
| Ips?: string[]; | ||
| }>; | ||
| Endpoint?: string; | ||
| }>; | ||
| }; | ||
|
|
||
| export const createEsOperations = (_esClient: EsClient, _context: Context) => { | ||
| const operations = { | ||
| createApp: async (_config: EsConfig): Promise<string> => { | ||
| // Note: Elasticsearch Serverless API support is limited. | ||
| // This implementation uses the regular Elasticsearch instance API as a workaround. | ||
| // For production use, consider using ROS API or wait for dedicated serverless SDK. | ||
|
|
||
| throw new Error( | ||
| 'Elasticsearch Serverless direct API is not yet supported. ' + | ||
| 'Please use ROS-based deployment or wait for dedicated SDK support.', | ||
| ); | ||
| }, | ||
|
|
||
| getApp: async (_appId: string): Promise<EsInfo | null> => { | ||
| throw new Error( | ||
| 'Elasticsearch Serverless direct API is not yet supported. ' + | ||
| 'Please use ROS-based deployment or wait for dedicated SDK support.', | ||
| ); | ||
| }, | ||
|
|
||
| updateApp: async (_appId: string, _config: EsConfig): Promise<void> => { | ||
| throw new Error( | ||
| 'Elasticsearch Serverless direct API is not yet supported. ' + | ||
| 'Please use ROS-based deployment or wait for dedicated SDK support.', | ||
| ); | ||
| }, | ||
|
|
||
| deleteApp: async (_appId: string): Promise<void> => { | ||
| throw new Error( | ||
| 'Elasticsearch Serverless direct API is not yet supported. ' + | ||
| 'Please use ROS-based deployment or wait for dedicated SDK support.', | ||
| ); | ||
| }, | ||
| }; | ||
|
|
||
| return operations; | ||
| }; |
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
Oops, something went wrong.
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.