-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(alibabacloud): add alibaba cloud provider's model definition (#3852
- Loading branch information
1 parent
38da77c
commit fb21d90
Showing
19 changed files
with
1,096 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,5 @@ | ||
## Alibaba Cloud Clouddriver | ||
|
||
The clouddriver-alicloud module aims to deploy an application on Alibaba Cloud. | ||
|
||
It is a work in progress |
This file contains 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,28 @@ | ||
dependencies { | ||
implementation project(":cats:cats-core") | ||
implementation project(":clouddriver-core") | ||
implementation project(":clouddriver-eureka") | ||
implementation project(":clouddriver-security") | ||
|
||
compileOnly "org.projectlombok:lombok" | ||
annotationProcessor "org.projectlombok:lombok" | ||
testAnnotationProcessor "org.projectlombok:lombok" | ||
|
||
implementation "com.netflix.spinnaker.kork:kork-core" | ||
implementation "com.netflix.spinnaker.kork:kork-exceptions" | ||
implementation "com.netflix.spinnaker.kork:kork-security" | ||
implementation "com.netflix.frigga:frigga" | ||
implementation "org.apache.httpcomponents:httpclient" | ||
implementation "org.apache.httpcomponents:httpcore" | ||
implementation "com.github.ben-manes.caffeine:guava" | ||
implementation "com.netflix.spinnaker.moniker:moniker" | ||
|
||
implementation 'com.aestasit.infrastructure.sshoogr:sshoogr:0.9.25' | ||
implementation 'com.jcraft:jsch.agentproxy.jsch:0.0.9' | ||
implementation 'com.jcraft:jsch.agentproxy.connector-factory:0.0.9' | ||
implementation 'com.aliyun:aliyun-java-sdk-core:4.4.2' | ||
implementation 'com.aliyun:aliyun-java-sdk-slb:3.2.9' | ||
implementation 'com.aliyun:aliyun-java-sdk-vpc:3.0.6' | ||
implementation 'com.aliyun:aliyun-java-sdk-ecs:4.16.10' | ||
implementation 'com.aliyun:aliyun-java-sdk-ess:2.3.0' | ||
} |
23 changes: 23 additions & 0 deletions
23
...main/java/com/netflix/spinnaker/clouddriver/alicloud/AliCloudConfigurationProperties.java
This file contains 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,23 @@ | ||
/* | ||
* Copyright 2019 Alibaba Group. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.netflix.spinnaker.clouddriver.alicloud; | ||
|
||
/** | ||
* @author: luoguan | ||
* @create: 2019-05-16 09:49 | ||
*/ | ||
public class AliCloudConfigurationProperties {} |
28 changes: 28 additions & 0 deletions
28
...-alicloud/src/main/java/com/netflix/spinnaker/clouddriver/alicloud/AliCloudOperation.java
This file contains 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,28 @@ | ||
/* | ||
* Copyright 2019 Alibaba Group. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.netflix.spinnaker.clouddriver.alicloud; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
@Target(ElementType.TYPE) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
public @interface AliCloudOperation { | ||
String value(); | ||
} |
47 changes: 47 additions & 0 deletions
47
...r-alicloud/src/main/java/com/netflix/spinnaker/clouddriver/alicloud/AliCloudProvider.java
This file contains 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,47 @@ | ||
/* | ||
* Copyright 2019 Alibaba Group. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.netflix.spinnaker.clouddriver.alicloud; | ||
|
||
import com.netflix.spinnaker.clouddriver.core.CloudProvider; | ||
import java.lang.annotation.Annotation; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
public class AliCloudProvider implements CloudProvider { | ||
public static final String ID = "alicloud"; | ||
|
||
final String id = ID; | ||
|
||
final String displayName = "Alicloud"; | ||
|
||
final Class<? extends Annotation> operationAnnotationType = AliCloudOperation.class; | ||
|
||
@Override | ||
public String getId() { | ||
return id; | ||
} | ||
|
||
@Override | ||
public String getDisplayName() { | ||
return displayName; | ||
} | ||
|
||
@Override | ||
public Class<? extends Annotation> getOperationAnnotationType() { | ||
return operationAnnotationType; | ||
} | ||
} |
71 changes: 71 additions & 0 deletions
71
...cloud/src/main/java/com/netflix/spinnaker/clouddriver/alicloud/model/AliCloudCluster.java
This file contains 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,71 @@ | ||
/* | ||
* Copyright 2019 Alibaba Group. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.netflix.spinnaker.clouddriver.alicloud.model; | ||
|
||
import com.netflix.spinnaker.clouddriver.model.Cluster; | ||
import java.util.Set; | ||
|
||
/** | ||
* @author: luoguan | ||
* @create: 2019-06-18 16:35 | ||
*/ | ||
public class AliCloudCluster implements Cluster { | ||
|
||
private String name; | ||
private String type; | ||
private String accountName; | ||
private Set<AliCloudServerGroup> serverGroups; | ||
private Set<AliCloudLoadBalancer> loadBalancers; | ||
|
||
public AliCloudCluster( | ||
String name, | ||
String type, | ||
String accountName, | ||
Set<AliCloudServerGroup> serverGroups, | ||
Set<AliCloudLoadBalancer> loadBalancers) { | ||
this.name = name; | ||
this.type = type; | ||
this.accountName = accountName; | ||
this.serverGroups = serverGroups; | ||
this.loadBalancers = loadBalancers; | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return name; | ||
} | ||
|
||
@Override | ||
public String getType() { | ||
return type; | ||
} | ||
|
||
@Override | ||
public String getAccountName() { | ||
return accountName; | ||
} | ||
|
||
@Override | ||
public Set<AliCloudServerGroup> getServerGroups() { | ||
return serverGroups; | ||
} | ||
|
||
@Override | ||
public Set<AliCloudLoadBalancer> getLoadBalancers() { | ||
return loadBalancers; | ||
} | ||
} |
89 changes: 89 additions & 0 deletions
89
...loud/src/main/java/com/netflix/spinnaker/clouddriver/alicloud/model/AliCloudInstance.java
This file contains 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 @@ | ||
/* | ||
* Copyright 2019 Alibaba Group. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.netflix.spinnaker.clouddriver.alicloud.model; | ||
|
||
import com.netflix.spinnaker.clouddriver.model.HealthState; | ||
import com.netflix.spinnaker.clouddriver.model.Instance; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
/** | ||
* @author: luoguan | ||
* @create: 2019-06-18 16:51 | ||
*/ | ||
public class AliCloudInstance implements Instance { | ||
|
||
private String name; | ||
private Long launchTime; | ||
private String zone; | ||
private String providerType; | ||
private String cloudProvider; | ||
private HealthState healthState; | ||
private List<Map<String, Object>> health; | ||
|
||
public AliCloudInstance( | ||
String name, | ||
Long launchTime, | ||
String zone, | ||
String providerType, | ||
String cloudProvider, | ||
HealthState healthState, | ||
List<Map<String, Object>> health) { | ||
this.name = name; | ||
this.launchTime = launchTime; | ||
this.zone = zone; | ||
this.providerType = providerType; | ||
this.cloudProvider = cloudProvider; | ||
this.healthState = healthState; | ||
this.health = health; | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return name; | ||
} | ||
|
||
@Override | ||
public Long getLaunchTime() { | ||
return launchTime; | ||
} | ||
|
||
@Override | ||
public String getZone() { | ||
return zone; | ||
} | ||
|
||
@Override | ||
public String getProviderType() { | ||
return providerType; | ||
} | ||
|
||
@Override | ||
public String getCloudProvider() { | ||
return cloudProvider; | ||
} | ||
|
||
@Override | ||
public HealthState getHealthState() { | ||
return healthState; | ||
} | ||
|
||
@Override | ||
public List<Map<String, Object>> getHealth() { | ||
return health; | ||
} | ||
} |
62 changes: 62 additions & 0 deletions
62
...cloud/src/main/java/com/netflix/spinnaker/clouddriver/alicloud/model/AliCloudKeyPair.java
This file contains 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,62 @@ | ||
/* | ||
* Copyright 2019 Alibaba Group. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.netflix.spinnaker.clouddriver.alicloud.model; | ||
|
||
import com.netflix.spinnaker.clouddriver.alicloud.AliCloudProvider; | ||
import com.netflix.spinnaker.clouddriver.model.KeyPair; | ||
|
||
/** | ||
* @author: luoguan | ||
* @create: 2019-06-11 15:23 | ||
*/ | ||
public class AliCloudKeyPair implements KeyPair { | ||
|
||
String account; | ||
String region; | ||
String keyName; | ||
String keyFingerprint; | ||
String cloudProvider = AliCloudProvider.ID; | ||
|
||
public AliCloudKeyPair(String account, String region, String keyName, String keyFingerprint) { | ||
this.account = account; | ||
this.region = region; | ||
this.keyName = keyName; | ||
this.keyFingerprint = keyFingerprint; | ||
} | ||
|
||
@Override | ||
public String getKeyName() { | ||
return keyName; | ||
} | ||
|
||
@Override | ||
public String getKeyFingerprint() { | ||
return keyFingerprint; | ||
} | ||
|
||
public String getAccount() { | ||
return account; | ||
} | ||
|
||
public String getRegion() { | ||
return region; | ||
} | ||
|
||
public String getCloudProvider() { | ||
return cloudProvider; | ||
} | ||
} |
Oops, something went wrong.