當前位置: 首頁>>代碼示例>>Java>>正文


Java Services類代碼示例

本文整理匯總了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());
}
 
開發者ID:CIETstudents,項目名稱:openstack-maven-CIET-students,代碼行數:30,代碼來源:KeystoneServiceList.java

示例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());
}
  }
 
開發者ID:jdutton,項目名稱:java-openstack-sdk-cli-example,代碼行數:35,代碼來源:Cli.java

示例3: List

import com.woorea.openstack.keystone.model.Services; //導入依賴的package包/類
public List() {
	super(client, HttpMethod.GET, "/OS-KSADM/services", null, Services.class);
}
 
開發者ID:CIETstudents,項目名稱:openstack-maven-CIET-students,代碼行數:4,代碼來源:ServicesResource.java

示例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);
}
 
開發者ID:CIETstudents,項目名稱:openstack-maven-CIET-students,代碼行數:4,代碼來源:UsersResource.java

示例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);
}
 
開發者ID:CIETstudents,項目名稱:openstack-maven-CIET-students,代碼行數:4,代碼來源:UsersResource.java

示例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);
}
 
開發者ID:CIETstudents,項目名稱:openstack-maven-CIET-students,代碼行數:4,代碼來源:UsersResource.java

示例7: ServicesResource

import com.woorea.openstack.keystone.model.Services; //導入依賴的package包/類
public ServicesResource(OpenStackClient client) {
	super(client, "/services", Service.class, Services.class);
}
 
開發者ID:CIETstudents,項目名稱:openstack-maven-CIET-students,代碼行數:4,代碼來源:ServicesResource.java


注:本文中的com.woorea.openstack.keystone.model.Services類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。