Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Conversation

@Lance52259
Copy link
Contributor

@Lance52259 Lance52259 commented May 14, 2021

What this PR does / why we need it:
This sdk supports ECS instance to power on and power off.

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #

Special notes for your reviewer:

Release note:

1. remove invalid sdk and related functions (power on: Start(), power off: Stop()).
2. new functions of batch power on and off.

@Lance52259 Lance52259 changed the title New batch ecs power on/off supported New ECS batch power on/off sdk supported May 14, 2021
@coveralls
Copy link

coveralls commented May 14, 2021

Pull Request Test Coverage Report for Build 1333

  • 11 of 14 (78.57%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.01%) to 68.463%

Changes Missing Coverage Covered Lines Changed/Added Lines %
openstack/ecs/v1/powers/requests.go 8 11 72.73%
Totals Coverage Status
Change from base Build 1329: -0.01%
Covered Lines: 11907
Relevant Lines: 17392

💛 - Coveralls

Comment on lines 18 to 19
ToPowerOnMap() (map[string]interface{}, error)
ToPowerOffMap() (map[string]interface{}, error)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use ToPowerAction(action string) (map[string]interface{}, error) ?
then we can do more actions into one interface

Copy link
Contributor Author

@Lance52259 Lance52259 May 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

more actions can be supported with ToPowerActionMap (return one interface result).

return
}

func PowerOff(client *golangsdk.ServiceClient, opts PowerOptsBuilder) (r cloudservers.JobResult) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reboot action is missing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx, the function is supports power off/on and reboot now.

@Lance52259 Lance52259 changed the title New ECS batch power on/off sdk supported New ECS sdk supported and update ecs response of get function May 14, 2021
@Lance52259 Lance52259 force-pushed the br_ecs_power_active branch 4 times, most recently from 512157a to 8e4389f Compare May 15, 2021 01:28
@Lance52259 Lance52259 changed the title New ECS sdk supported and update ecs response of get function New ECS powers sdk supported May 15, 2021
ToPowerActionMap(option string) (map[string]interface{}, error)
}

func (opts PowerOpts) ToPowerActionMap(option string) (map[string]interface{}, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggest to add more comments about the valid vaules of option

@Lance52259 Lance52259 force-pushed the br_ecs_power_active branch 2 times, most recently from 7149a03 to 7419d19 Compare May 15, 2021 06:40
- remove invalid sdk and related functions
- new functions of batch power on and off
@Lance52259 Lance52259 force-pushed the br_ecs_power_active branch from 7419d19 to e580287 Compare May 15, 2021 06:54
@ShiChangkuo ShiChangkuo merged commit 6068580 into huaweicloud:master May 15, 2021
ShiChangkuo added a commit that referenced this pull request May 17, 2021
ShiChangkuo pushed a commit that referenced this pull request May 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants