-
Notifications
You must be signed in to change notification settings - Fork 4
4.1 Spring adapter
Sergey Fedosenko edited this page Feb 16, 2016
·
6 revisions
If you use Maven or Gradle, you can simply add the CLC SDK as a dependency.
Maven:
<dependencies>
<dependency>
<groupId>com.centurylink.cloud</groupId>
<artifactId>spring-clc-sdk</artifactId>
<version>1.2.2</version>
</dependency>
</dependencies>
Gradle:
compile 'com.centurylink.cloud:spring-clc-sdk:1.2.2'
To use spring adapter you need:
Import sdk-spring-adapter.jar in your project
Provide Spring configuration using @EnableClcSdk annotation
@Configuration
@EnableClcSdk
class MyConfig {
@Bean
public CredentialsProvider clcCredentialsProvider() {
return new StaticCredentialsProvider("john.doe", "strong_password");
}
@Bean
public SdkConfiguration clcSdkConfig() {
return new SdkConfigurationBuilder().build();
}
}
To see all available credentials providers and configuration properties, please see SDK configuration section.
Then you can autowire necessary sdk services
@Autowired
ServerService clcServerService;
@Autowired
GroupService clcGroupService;
Or get them from spring context directly
- [Getting Started] (./1.-Getting-started)
- User Guide - Basic Functions
- Server management
- Server actions
- Managing groups
- Group actions
- Searching templates
- Searching data centers
- Invoice statistics
- SDK configuration
- User Guide - Advanced Functions
- Configuring remote servers over SSH
- Defining a group hierarchy
- Billing statistics
- Server monitoring statistics
- Policies management
- Shared load balancers management
- User Guide - Framework adapters