本文整理匯總了Java中com.woorea.openstack.keystone.model.Services類的典型用法代碼示例。如果您正苦於以下問題:Java Services類的具體用法?Java Services怎麽用?Java Services使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Services類屬於com.woorea.openstack.keystone.model包,在下文中一共展示了Services類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: execute
import com.woorea.openstack.keystone.model.Services; //導入依賴的package包/類
@Override
public void execute(Keystone keystone, CommandLine cmd) {
final Services services = keystone.services().list().execute();
Table t = new Table(new TableModel<Service>(services.getList()) {
@Override
public Column[] getHeaders() {
return new Column[]{
new Column("id", 32, Column.ALIGN_LEFT),
new Column("type", 10, Column.ALIGN_LEFT),
new Column("name", 10, Column.ALIGN_LEFT),
new Column("description", 32, Column.ALIGN_LEFT)
};
}
@Override
public String[] getRow(Service service) {
return new String[]{
service.getId(),
service.getType(),
service.getName(),
service.getDescription()
};
}
});
System.out.println(t.render());
}
示例2: init
import com.woorea.openstack.keystone.model.Services; //導入依賴的package包/類
private void init() {
// Create the REST Client Connector, which also handles the JSON API serialization
Logger logger = null;
if (debug)
logger = Logger.getLogger("os");
connector = new JerseyConnector(logger);
// Create the Keystone Client Resource
keystone = new Keystone(apiEndpoint, connector);
UsernamePassword authentication = new UsernamePassword(username, password);
// Authenticate with Keystone Admin API and get access credentials (especially token)
access = keystone.tokens()
.authenticate(authentication)
.withTenantName(tenantName)
.execute();
// Set the Keystone Client Resource to use token when communicating with keystone
keystone.setTokenProvider(new OpenStackSimpleTokenProvider(access.getToken().getId()));
// List services
System.out.println("\n\nServices:");
Services services = keystone.services().list().execute();
for (Service service : services) {
System.out.println(" " + service.getId() + ", " + service.getName() + ", " + service.getDescription());
}
// List endpoints, which map to services by the service ID
System.out.println("\n\nEndpoints:");
Endpoints endpoints = keystone.endpoints().list().execute();
for (Endpoint endpoint : endpoints) {
System.out.println(" " + endpoint.getServiceId() + ", " + endpoint.getAdminURL() + ", " + endpoint.getPublicURL());
}
}
示例3: List
import com.woorea.openstack.keystone.model.Services; //導入依賴的package包/類
public List() {
super(client, HttpMethod.GET, "/OS-KSADM/services", null, Services.class);
}
示例4: groups
import com.woorea.openstack.keystone.model.Services; //導入依賴的package包/類
public OpenStackRequest<Services> groups(String userId) {
return CLIENT.get(new StringBuilder(path).append("/").append(userId).append("/groups").toString(), Services.class);
}
示例5: projects
import com.woorea.openstack.keystone.model.Services; //導入依賴的package包/類
public OpenStackRequest<Services> projects(String userId) {
return CLIENT.get(new StringBuilder(path).append("/").append(userId).append("/projects").toString(), Services.class);
}
示例6: roles
import com.woorea.openstack.keystone.model.Services; //導入依賴的package包/類
public OpenStackRequest<Services> roles(String userId) {
return CLIENT.get(new StringBuilder(path).append("/").append(userId).append("/roles").toString(), Services.class);
}
示例7: ServicesResource
import com.woorea.openstack.keystone.model.Services; //導入依賴的package包/類
public ServicesResource(OpenStackClient client) {
super(client, "/services", Service.class, Services.class);
}