-
Notifications
You must be signed in to change notification settings - Fork 163
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
feat(modelarts): add resource to operate devserver #6098
feat(modelarts): add resource to operate devserver #6098
Conversation
a3df1b1
to
908a457
Compare
908a457
to
1daed67
Compare
1daed67
to
4288b66
Compare
./scripts/coverage.sh -o modelarts -f TestAccDevServer_basic |
@@ -88,7 +106,7 @@ func TestAccDevServer_basic(t *testing.T) { | |||
}) | |||
} | |||
|
|||
func testDevServer_basic(name, password string, autoRenew bool) string { | |||
func testDevServer_basic_step1(name, password string, autoRenew bool) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename it as the testAccDevServer_basic
and using these references as follows:
// Rename the argument input 'autoRenew' as the 'isAutoRenew', and put it ahead of the other string arguments.
func testAccDevServer_basic(isAutoRenew bool, name, password string) string {
return testAccDevServer_base(isAutoRenew, name, password)
}
return testDevServer_basic_step1(name, password, autoRenew) | ||
} | ||
|
||
func testDevServer_basic_step3(name, password string, autoRenew bool) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
testAccDevServer_doAction(isAutoRenew bool, name, password string, actionType string, doRetryAction bool) string {
return fmt.Sprintf(`
%[1]s
resource "huaweicloud_modelarts_devserver_action" "test" {
devserver_id = huaweicloud_modelarts_devserver.test.id
action = "%[2]s"
}
variable "is_retry_devserver_action" {
type = bool
default = %[3]s
}
resource "huaweicloud_modelarts_devserver_action" "retry" {
count = var.is_retry_devserver_action ? 1 : 0
depends_on = [huaweicloud_modelarts_devserver_action.test]
devserver_id = huaweicloud_modelarts_devserver.test.id
action = "%[2]s"
}
`, testAccDevServer_basic(sAutoRenew, name, password), actionType, doRetryAction)
}
// step 3 to 6 are using it
+ **start**: The DevServer can be started only when the DevServers is stopped, fails to stop, or fails to start. | ||
+ **stop**: The DevServer can be stopped only when it is running or stop failure. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+ **start**: The DevServer can be started only when the DevServers is stopped, fails to stop, or fails to start. | |
+ **stop**: The DevServer can be stopped only when it is running or stop failure. | |
+ **start**: The DevServer can be started only when the DevServers is stopped, stop failure, or start failure. | |
+ **stop**: The DevServer can be stopped only when it is running or stop failure. |
4288b66
to
7e56435
Compare
./scripts/coverage.sh -o modelarts -f TestAccDevServer_basic |
7e56435
to
ccd318b
Compare
./scripts/coverage.sh -o modelarts -f TestAccDevServer_basic |
ccd318b
to
9df7ad5
Compare
/approve |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR has been approved by: @Lance52259
/approve
/lgtm
What this PR does / why we need it:
Add new resource to start or stop DevService.
Which issue this PR fixes:
(optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged)fixes #xxx
Special notes for your reviewer:
Release note:
PR Checklist
Documentation updated.
Schema updated.
CheckDeleted.
a. During query operation (Read Context)
aa. Resource not found
>>>>>> Paste the screenshot here <<<<<<
b. During delete/disassociate/unbind operation (Delete Context)
ba. Resource not found
>>>>>> Paste the screenshot here <<<<<<