Rename package "qingcloud" to "service"
Signed-off-by: Jingwen Peng <pengsrc@yunify.com>
This commit is contained in:
parent
499622a7ef
commit
bf66068a01
|
@ -15,7 +15,7 @@ import (
|
|||
Initialize the QingCloud service with a configuration
|
||||
|
||||
``` go
|
||||
qcService, _ := qingcloud.Init(configuration)
|
||||
qcService, _ := service.Init(configuration)
|
||||
```
|
||||
|
||||
Initialize the instance service in a zone
|
||||
|
@ -28,7 +28,7 @@ DescribeInstances
|
|||
|
||||
``` go
|
||||
iOutput, _ := pek3aInstance.DescribeInstances(
|
||||
&qingcloud.DescribeInstancesInput{
|
||||
&service.DescribeInstancesInput{
|
||||
Instances: []string{"i-xxxxxxxx"},
|
||||
},
|
||||
)
|
||||
|
@ -44,7 +44,7 @@ RunInstances
|
|||
|
||||
``` go
|
||||
iOutput, _ := pek3aInstance.RunInstances(
|
||||
&qingcloud.RunInstancesInput{
|
||||
&service.RunInstancesInput{
|
||||
ImageID: "centos7x64d",
|
||||
CPU: 1,
|
||||
Memory: 1024,
|
||||
|
@ -69,7 +69,7 @@ pek3aVolume, _ := qcService.Volume("pek3a")
|
|||
DescribeVolumes
|
||||
|
||||
``` go
|
||||
volOutput, _ := pek3aVolume.DescribeVolumes(&qingcloud.DescribeVolumesInput{
|
||||
volOutput, _ := pek3aVolume.DescribeVolumes(&service.DescribeVolumesInput{
|
||||
Volumes: []string{"vol-xxxxxxxx"},
|
||||
})
|
||||
|
||||
|
@ -84,7 +84,7 @@ CreateVolumes
|
|||
|
||||
``` go
|
||||
volOutput, _ := pek3aVolume.CreateVolumes(
|
||||
&qingcloud.CreateVolumesInput{
|
||||
&service.CreateVolumesInput{
|
||||
Size: 10,
|
||||
Count: 2,
|
||||
},
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
// | limitations under the License.
|
||||
// +-------------------------------------------------------------------------
|
||||
|
||||
package qingcloud
|
||||
package service
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
// | limitations under the License.
|
||||
// +-------------------------------------------------------------------------
|
||||
|
||||
package qingcloud
|
||||
package service
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
// | limitations under the License.
|
||||
// +-------------------------------------------------------------------------
|
||||
|
||||
package qingcloud
|
||||
package service
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
// | limitations under the License.
|
||||
// +-------------------------------------------------------------------------
|
||||
|
||||
package qingcloud
|
||||
package service
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
// | limitations under the License.
|
||||
// +-------------------------------------------------------------------------
|
||||
|
||||
package qingcloud
|
||||
package service
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
// | limitations under the License.
|
||||
// +-------------------------------------------------------------------------
|
||||
|
||||
package qingcloud
|
||||
package service
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
// | limitations under the License.
|
||||
// +-------------------------------------------------------------------------
|
||||
|
||||
package qingcloud
|
||||
package service
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
// | limitations under the License.
|
||||
// +-------------------------------------------------------------------------
|
||||
|
||||
package qingcloud
|
||||
package service
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
// | limitations under the License.
|
||||
// +-------------------------------------------------------------------------
|
||||
|
||||
package qingcloud
|
||||
package service
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
// +-------------------------------------------------------------------------
|
||||
|
||||
// Package qingcloud provides QingCloud Service API (API Version 2013-08-30)
|
||||
package qingcloud
|
||||
package service
|
||||
|
||||
import (
|
||||
"github.com/yunify/qingcloud-sdk-go/config"
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
// | limitations under the License.
|
||||
// +-------------------------------------------------------------------------
|
||||
|
||||
package qingcloud
|
||||
package service
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
// | limitations under the License.
|
||||
// +-------------------------------------------------------------------------
|
||||
|
||||
package qingcloud
|
||||
package service
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
// | limitations under the License.
|
||||
// +-------------------------------------------------------------------------
|
||||
|
||||
package qingcloud
|
||||
package service
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
// | limitations under the License.
|
||||
// +-------------------------------------------------------------------------
|
||||
|
||||
package qingcloud
|
||||
package service
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
// | limitations under the License.
|
||||
// +-------------------------------------------------------------------------
|
||||
|
||||
package qingcloud
|
||||
package service
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
// | limitations under the License.
|
||||
// +-------------------------------------------------------------------------
|
||||
|
||||
package qingcloud
|
||||
package service
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
// | limitations under the License.
|
||||
// +-------------------------------------------------------------------------
|
||||
|
||||
package qingcloud
|
||||
package service
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
// | limitations under the License.
|
||||
// +-------------------------------------------------------------------------
|
||||
|
||||
package qingcloud
|
||||
package service
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
// | limitations under the License.
|
||||
// +-------------------------------------------------------------------------
|
||||
|
||||
package qingcloud
|
||||
package service
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
// | limitations under the License.
|
||||
// +-------------------------------------------------------------------------
|
||||
|
||||
package qingcloud
|
||||
package service
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
{{$service := .Data.Service}}
|
||||
|
||||
// Package {{$service.Name | snakeCase}} provides {{$service.Name}} Service API (API Version {{$service.APIVersion}})
|
||||
package {{$service.Name | snakeCase}}
|
||||
package service
|
||||
|
||||
import (
|
||||
"github.com/yunify/qingcloud-sdk-go/config"
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
{{$service := .Data.Service}}
|
||||
{{$subService := index .Data.SubServices .CurrentSubServiceID}}
|
||||
|
||||
package {{$service.Name | snakeCase}}
|
||||
package service
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
{{$service := .Data.Service}}
|
||||
{{$customizedTypes := .Data.CustomizedTypes}}
|
||||
|
||||
package {{$service.Name | snakeCase}}
|
||||
package service
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
|
|
@ -52,7 +52,7 @@ func setUp() {
|
|||
var err error
|
||||
var tc *testConfig
|
||||
var c *config.Config
|
||||
var qingcloudService *qingcloud.QingCloudService
|
||||
var qingcloudService *service.QingCloudService
|
||||
|
||||
type testConfig struct {
|
||||
Zone string `json:"zone" yaml:"zone"`
|
||||
|
@ -84,7 +84,7 @@ func loadConfig() {
|
|||
|
||||
func initQingStorService() {
|
||||
if qingcloudService == nil {
|
||||
qingcloudService, err = qingcloud.Init(c)
|
||||
qingcloudService, err = service.Init(c)
|
||||
checkErrorForExit(err)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,8 +59,8 @@ func QingCloudServiceFeatureContext(s *godog.Suite) {
|
|||
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
var instanceService *qingcloud.InstanceService
|
||||
var jobService *qingcloud.JobService
|
||||
var instanceService *service.InstanceService
|
||||
var jobService *service.JobService
|
||||
|
||||
func initializeQingCloudService() error {
|
||||
return nil
|
||||
|
@ -99,7 +99,7 @@ func theJobServiceIsInitialized() error {
|
|||
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
var describeZonesOutput *qingcloud.DescribeZonesOutput
|
||||
var describeZonesOutput *service.DescribeZonesOutput
|
||||
|
||||
func describeZones() error {
|
||||
describeZonesOutput, err = qingcloudService.DescribeZones(nil)
|
||||
|
@ -125,8 +125,8 @@ func describeZonesShouldHaveTheZoneIamUsing() error {
|
|||
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
var runInstanceInput *qingcloud.RunInstancesInput
|
||||
var runInstanceOutput *qingcloud.RunInstancesOutput
|
||||
var runInstanceInput *service.RunInstancesInput
|
||||
var runInstanceOutput *service.RunInstancesOutput
|
||||
|
||||
func instanceConfiguration(configuration *gherkin.DataTable) error {
|
||||
count, err := strconv.Atoi(configuration.Rows[1].Cells[2].Value)
|
||||
|
@ -134,7 +134,7 @@ func instanceConfiguration(configuration *gherkin.DataTable) error {
|
|||
return err
|
||||
}
|
||||
|
||||
runInstanceInput = &qingcloud.RunInstancesInput{
|
||||
runInstanceInput = &service.RunInstancesInput{
|
||||
ImageID: configuration.Rows[1].Cells[0].Value,
|
||||
InstanceType: configuration.Rows[1].Cells[1].Value,
|
||||
Count: count,
|
||||
|
@ -160,7 +160,7 @@ func runInstancesWillBeFinished() error {
|
|||
retries := 0
|
||||
for retries < tc.MaxRetries {
|
||||
describeJobOutput, err := jobService.DescribeJobs(
|
||||
&qingcloud.DescribeJobsInput{
|
||||
&service.DescribeJobsInput{
|
||||
Jobs: []string{runInstanceOutput.JobID},
|
||||
},
|
||||
)
|
||||
|
@ -178,13 +178,13 @@ func runInstancesWillBeFinished() error {
|
|||
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
var terminateInstanceOutput *qingcloud.TerminateInstancesOutput
|
||||
var terminateInstanceOutput *service.TerminateInstancesOutput
|
||||
|
||||
func terminateInstances() error {
|
||||
retries := 0
|
||||
for retries < tc.MaxRetries {
|
||||
terminateInstanceOutput, err = instanceService.TerminateInstances(
|
||||
&qingcloud.TerminateInstancesInput{
|
||||
&service.TerminateInstancesInput{
|
||||
Instances: runInstanceOutput.Instances,
|
||||
},
|
||||
)
|
||||
|
@ -218,7 +218,7 @@ func terminateInstancesWillBeFinished() error {
|
|||
retries := 0
|
||||
for retries < tc.MaxRetries {
|
||||
describeJobOutput, err := jobService.DescribeJobs(
|
||||
&qingcloud.DescribeJobsInput{
|
||||
&service.DescribeJobsInput{
|
||||
Jobs: []string{terminateInstanceOutput.JobID},
|
||||
},
|
||||
)
|
||||
|
@ -236,7 +236,7 @@ func terminateInstancesWillBeFinished() error {
|
|||
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
var describeJobOutput *qingcloud.DescribeJobsOutput
|
||||
var describeJobOutput *service.DescribeJobsOutput
|
||||
|
||||
func describeJobs() error {
|
||||
describeJobOutput, err = jobService.DescribeJobs(nil)
|
||||
|
|
Loading…
Reference in New Issue