Skip to content
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

Ali-cloud compute, storage, DNS, loadbalancer module completed #85

Closed
wants to merge 41 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
a70e8d9
implemented ali cloude start node & fixed bug
OddCN Mar 25, 2018
18d8374
little work
OddCN Mar 25, 2018
77945be
resolve conflicts
OddCN Mar 25, 2018
5cfc275
add test for ali start node
OddCN Mar 25, 2018
a55a89c
add test and examples to startnode() stopnode() rebootnode() deleteno…
OddCN Mar 25, 2018
f113325
improve code suggessted by codacy
OddCN Mar 25, 2018
a82339e
updated examples of ali ecs, updated README
OddCN Mar 26, 2018
b3fcf35
improve examples of Ali ECS
OddCN Mar 26, 2018
359a404
Solved a problem by me: mistakenly correcting letter cases
OddCN Mar 27, 2018
685c8e7
Ali compute ECS: Supports less commonly used parameters
OddCN Mar 29, 2018
86aa451
Ali compute ECS test case: Added less commonly used parameters for cr…
OddCN Mar 29, 2018
5b3082a
Ali compute: put duplicated codes into aliauth.PutStructToMap(), maki…
OddCN Mar 29, 2018
d51ff40
Ali storage: implemented create disk
OddCN Mar 29, 2018
b8e66fd
Merge branch 'ali' into ali-storage
OddCN Mar 29, 2018
eb741ba
Ali storage: added test case for create disk
OddCN Mar 29, 2018
8a69352
Ali storage: delete disk, attach disk, detach disk. test cases
OddCN Apr 1, 2018
7dc3de7
Ali storage: improve code suggested by codacy
OddCN Apr 1, 2018
95740c5
Ali storage: improve code suggested by codacy
OddCN Apr 1, 2018
177b5ea
Ali storage: improve code suggested by codacy
OddCN Apr 1, 2018
eb905cd
Ali storage: improve code suggested by codacy
OddCN Apr 1, 2018
bde7be5
builder pattern: ali cloud create node
OddCN May 2, 2018
8716c1b
added ali ecs and storage APIdocs
OddCN May 5, 2018
92eba13
added ali ecs and storage APIdocs
OddCN May 5, 2018
b6fe4f0
added ali ecs and storage APIdocs
OddCN May 5, 2018
25e36bf
added ali ecs and storage APIdocs
OddCN May 5, 2018
2cc61f5
added ali ecs and storage APIdocs
OddCN May 5, 2018
676dd0d
little change in ali compute unit test
OddCN May 8, 2018
792b4ba
implement createsnapshot deletesnapshot
OddCN May 8, 2018
8f2d2bc
Merge branch 'ali-storage' into ali-builder
OddCN May 8, 2018
c1057c4
update apidocs 's ali storage
OddCN May 8, 2018
25b4fb3
Added examples of ali storage
OddCN May 9, 2018
75ec14f
implemented ali dns module
OddCN May 11, 2018
d693743
ali auth sign ECS DNS
OddCN May 13, 2018
69c949c
APIDocs and examples
OddCN May 13, 2018
707d128
updated README.md
OddCN May 16, 2018
df22026
ali load balancer 's create delete list
OddCN May 16, 2018
ff78755
ali load balancer all functions, unit tests, examples
OddCN May 16, 2018
2ec8b17
APIDocs for ali loadbalancer
OddCN May 16, 2018
55994a4
implement list node types, ecs region
OddCN May 18, 2018
15f5a45
implement loadbalancer region
OddCN May 18, 2018
b5ef1c2
ali ecs and slb 's endpoint
OddCN May 20, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions APIDocs/ali.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
```
package ali
import "/home/oddcn/Code/go/src/github.com/cloudlibz/gocloud/ali"
```

### TYPES

```
type Ali struct {
ecs.ECS
alistorage.Alistorage
aliloadbalancer.Aliloadbalancer
alicontainer.Alicontainer
alidns.Alidns
}
```

Ali struct represents Ali-cloud provider.

46 changes: 46 additions & 0 deletions APIDocs/aliauth.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
```
package aliauth
import "/home/oddcn/Code/go/src/github.com/cloudlibz/gocloud/aliauth"
```

### FUNCTIONS

```
func LoadConfig()
```

LoadConfig represents Load Ali-cloud config from alicloudconfig.json or environment variables

```
func PutStructToMap(i interface{}) map[string]interface{}
```

PutStructToMap puts key and value of struct into map[string]interface{}

> if value is string and not empty -> put
> if value is bool -> put NOTE: the default value of origin Ali API 's parameter must be false, if not ,do not use this function
> if value is int and not 0 -> put NOTE: the optional values of origin Ali API 's parameter must dose not include 0, if not ,do not use this function

```
func SignAndDoRequest(action string, params map[string]interface{}, response map[string]interface{}) error
```

SignAndDoRequest sign and do request by action parameter and specific parameters

### TYPES

```
type Configuration struct {
AliAccessKeyID string
AliAccessKeySecret string
}
```

Configuration struct for representing Ali-cloud credentials

```
var Config Configuration
```

Config from alicloudconfig.json

74 changes: 74 additions & 0 deletions APIDocs/alidns.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
```
package alidns
import "github.com/cloudlibz/gocloud/dns/alidns"
```

### TYPES

```
type Alidns struct {
}
```
Alidns represents Alidns attribute and method associates with it.

```
func (alidns *Alidns) Createdns(request interface{}) (resp interface{}, err error)
```
Createdns add DNS record accept map[string]interface{}

```
func (alidns *Alidns) Deletedns(request interface{}) (resp interface{}, err error)
```
Deletedns delete DNS record accept map[string]interface{}

```
func (alidns *Alidns) ListResourcednsRecordSets(request interface{}) (resp interface{}, err error)
```
ListResourcednsRecordSets list resource DNS record sets accept map[string]interface{}

```
func (alidns *Alidns) Listdns(request interface{}) (resp interface{}, err error)
```
Listdns list DNS record accept map[string]interface{}

```
type CreateDNS struct {
DomainName string
RR string
Type string
Value string
TTL int
Priority int
Line string
}
```
CreateDNS to store all attribute to create Ali-cloud DNS

```
type DeleteDNS struct {
RecordId string
}
```
DeleteDNS to store all attribute to delete Ali-cloud DNS

```
type ListDNS struct {
PageNumber int
PageSize int
KeyWord string
GroupId string
}
```
ListDNS to store all attribute to list Ali-cloud DNS

```
type ListResourceDNSRecordSets struct {
DomainName string
PageNumber int
PageSize int
RRKeyWord string
TypeKeyWord string
ValueKeyWord string
}
```
ListResourceDNSRecordSets to store all attribute to list resource Ali-cloud DNS record sets
103 changes: 103 additions & 0 deletions APIDocs/aliloadbalancer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
```
package aliloadbalancer
import "github.com/cloudlibz/gocloud/loadbalancer/aliloadbalancer"
```

### TYPES

```
type Aliloadbalancer struct {
}
```
Aliloadbalancer represents Aliloadbalancer struct.

```
func (aliloadbalancer *Aliloadbalancer) Attachnodewithloadbalancer(request interface{}) (resp interface{}, err error)
```
Attachnodewithloadbalancer attach ali ecs instance to ali loadbalancer

```
func (aliloadbalancer *Aliloadbalancer) Creatloadbalancer(request interface{}) (resp interface{}, err error)
```
Creatloadbalancer creates ali loadbalancer

```
func (aliloadbalancer *Aliloadbalancer) Deleteloadbalancer(request interface{}) (resp interface{}, err error)
```
Deleteloadbalancer deletes ali loadbalancer

```
func (aliloadbalancer *Aliloadbalancer) Detachnodewithloadbalancer(request interface{}) (resp interface{}, err error)
```
Detachnodewithloadbalancer detach ali ecs instance from ali loadbalancer

```
func (aliloadbalancer *Aliloadbalancer) Listloadbalancer(request interface{}) (resp interface{}, err error)
```
Listloadbalancer lists ali loadbalancer

```
type AttachLoadBalancer struct {
LoadBalancerID string
BackendServers string
}
```
AttachLoadBalancer represents Attach node with loadbalancer attribute.

```
type CreateLoadBalancer struct {
RegionID string
MasterZoneID string
SlaveZoneID string
LoadBalancerSpec string
LoadBalancerName string
AddressType string
VSwitchID string
PayType string
PricingCycle string
Duration string
Autopay bool
InternetChargeType string
Bandwidth int
ClientToken string
ResourceGroupID string
}
```
CreateLoadBalancer struct represents attribute of create LoadBalancer.

```
type DeleteLoadBalancer struct {
RegionID string
LoadBalancerID string
}
```
DeleteLoadBalancer struct represents attribute of delete LoadBalancer.

```
type DetachLoadBalancer struct {
RegionID string
LoadBalancerID string
BackendServers string
}
```
DetachLoadBalancer represents Detach node with loadbalancer attribute.

```
type ListLoadBalancer struct {
RegionID string
LoadBalancerID string
LoadBalancerName string
AddressType string
NetworkType string
VpcID string
VswitchID string
Address string
ServerIntranetAddress int
InternetChargeType string
ServerID string
MasterZoneID string
SlaveZoneID string
}
```
ListLoadBalancer struct represents attribute of list LoadBalancer.

97 changes: 97 additions & 0 deletions APIDocs/alistorage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
```
package alistorage
import "/home/oddcn/Code/go/src/github.com/cloudlibz/gocloud/storage/alistorage/"
```

### TYPES

```
type Alistorage struct {
}
```
Alistorage struct represents Alistorage attribute and method associates with it.

```
func (aliStorage *Alistorage) Attachdisk(request interface{}) (resp interface{}, err error)
```
Attachdisk attach ECS-Disk to ECS, accept map[string]interface{}

```
func (aliStorage *Alistorage) Createdisk(request interface{}) (resp interface{}, err error)
```
Createdisk create ECS-Disk accept map[string]interface{}

```
func (aliStorage *Alistorage) Createsnapshot(request interface{}) (resp interface{}, err error)
```
Createsnapshot create snapshot accept map[string]interface{}

```
func (aliStorage *Alistorage) Deletedisk(request interface{}) (resp interface{}, err error)
```
Deletedisk delete ECS-Disk accept map[string]interface{}

```
func (aliStorage *Alistorage) Deletesnapshot(request interface{}) (resp interface{}, err error)
```
Deletesnapshot delete snapshot accept map[string]interface{}

```
func (aliStorage *Alistorage) Detachdisk(request interface{}) (resp interface{}, err error)
```
Detachdisk detach ECS-Disk from ECS, accept map[string]interface{}

```
type AttachDisk struct {
InstanceID string
DiskID string
DeleteWithInstance bool
}
```
AttachDisk to store all attribute of attach Ali-cloud ECS-Disk to ECS

```
type CreateDisk struct {
RegionID string
ZoneID string
DiskName string
Description string
Encrypted bool
DiskCategory string
Size int
SnapshotID string
ClientToken string
}
```
CreateDisk to store all attribute to create Ali-cloud ECS-Disk

```
type DeleteDisk struct {
DiskID string
}
```
DeleteDisk to store all attribute to delete Ali-cloud ECS-Disk

```
type DetachDisk struct {
InstanceID string
DiskID string
}
```
DetachDisk to store all attribute of detach Ali-cloud ECS-Disk from ECS

```
type DeleteSnapshot struct {
SnapshotID string
}
```
DeleteSnapshot to store all attribute of delete Ali-cloud ECS-Disk 's Snapshot

```
type DetachDisk struct {
InstanceID string
DiskID string
}
```
DetachDisk to store all attribute of detach Ali-cloud ECS-Disk from ECS

Loading