本文整理了Java中org.jclouds.openstack.v2_0.services.Extension
类的一些代码示例,展示了Extension
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Extension
类的具体详情如下:
包路径:org.jclouds.openstack.v2_0.services.Extension
类名称:Extension
暂无
代码示例来源:origin: io.cloudsoft.jclouds.api/openstack-nova
/**
* @author Inbar Stolberg
*/
@Beta
@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.ADMIN_ACTIONS)
public interface AvailabilityZoneAPI {
/**
* @return all availability zones
*/
FluentIterable<? extends AvailabilityZone> list();
}
代码示例来源:origin: com.amysta.jclouds.api/openstack-keystone
@Override
public Optional<Object> apply(InvocationSuccess input) {
Class<?> target = unwrapIfOptional(input.getInvocation().getInvokable().getReturnType());
Optional<org.jclouds.openstack.v2_0.services.Extension> ext = Optional.fromNullable(target
.getAnnotation(org.jclouds.openstack.v2_0.services.Extension.class));
if (ext.isPresent()) {
URI namespace = URI.create(ext.get().namespace());
List<Object> args = input.getInvocation().getArgs();
Set<URI> aliasesForNamespace = aliases.containsKey(namespace) ? aliases.get(namespace) : Sets.<URI> newHashSet();
String name = ext.get().name();
String alias = ext.get().alias();
if (args.isEmpty()) {
if (checkExtension("", namespace, aliasesForNamespace, alias, name)) {
return input.getResult();
}
} else if (args.size() == 1) {
String arg0 = checkNotNull(args.get(0), "arg[0] in %s", input).toString();
if (checkExtension(arg0, namespace, aliasesForNamespace, alias, name)) {
return input.getResult();
}
} else {
throw new RuntimeException(String.format("expecting zero or one args %s", input));
}
return Optional.absent();
} else {
// No extension annotation, should check whether to return absent
return input.getResult();
}
}
代码示例来源:origin: jclouds/legacy-jclouds
@Override
public Optional<Object> apply(InvocationSuccess input) {
Class<?> target = unwrapIfOptional(input.getInvocation().getInvokable().getReturnType());
Optional<org.jclouds.openstack.v2_0.services.Extension> ext = Optional.fromNullable(target
.getAnnotation(org.jclouds.openstack.v2_0.services.Extension.class));
if (ext.isPresent()) {
URI namespace = URI.create(ext.get().namespace());
List<Object> args = input.getInvocation().getArgs();
if (args.isEmpty()) {
if (any(extensions.getUnchecked(""), namespaceOrAliasEquals(namespace, aliases.get(namespace))))
return input.getResult();
} else if (args.size() == 1) {
String arg0 = checkNotNull(args.get(0), "arg[0] in %s", input).toString();
if (any(extensions.getUnchecked(arg0), namespaceOrAliasEquals(namespace, aliases.get(namespace))))
return input.getResult();
} else {
throw new RuntimeException(String.format("expecting zero or one args %s", input));
}
return Optional.absent();
} else {
// No extension annotation, should check whether to return absent
return input.getResult();
}
}
代码示例来源:origin: org.apache.jclouds.api/openstack-keystone
@Override
public Optional<Object> apply(InvocationSuccess input) {
Class<?> target = unwrapIfOptional(input.getInvocation().getInvokable().getReturnType());
Optional<org.jclouds.openstack.v2_0.services.Extension> ext = Optional.fromNullable(target
.getAnnotation(org.jclouds.openstack.v2_0.services.Extension.class));
if (ext.isPresent()) {
URI namespace = URI.create(ext.get().namespace());
List<Object> args = input.getInvocation().getArgs();
Set<URI> aliasesForNamespace = aliases.containsKey(namespace) ? aliases.get(namespace) : Sets.<URI> newHashSet();
String name = ext.get().name();
String alias = ext.get().alias();
if (args.isEmpty()) {
if (checkExtension("", namespace, aliasesForNamespace, alias, name)) {
return input.getResult();
}
} else if (args.size() == 1) {
String arg0 = checkNotNull(args.get(0), "arg[0] in %s", input).toString();
if (checkExtension(arg0, namespace, aliasesForNamespace, alias, name)) {
return input.getResult();
}
} else {
throw new RuntimeException(String.format("expecting zero or one args %s", input));
}
return Optional.absent();
} else {
// No extension annotation, should check whether to return absent
return input.getResult();
}
}
代码示例来源:origin: io.cloudsoft.jclouds.api/openstack-keystone
@Override
public Optional<Object> apply(InvocationSuccess input) {
Class<?> target = unwrapIfOptional(input.getInvocation().getInvokable().getReturnType());
Optional<org.jclouds.openstack.v2_0.services.Extension> ext = Optional.fromNullable(target
.getAnnotation(org.jclouds.openstack.v2_0.services.Extension.class));
if (ext.isPresent()) {
URI namespace = URI.create(ext.get().namespace());
List<Object> args = input.getInvocation().getArgs();
if (args.isEmpty()) {
if (any(extensions.getUnchecked(""), namespaceOrAliasEquals(namespace, aliases.get(namespace))))
return input.getResult();
} else if (args.size() == 1) {
String arg0 = checkNotNull(args.get(0), "arg[0] in %s", input).toString();
if (any(extensions.getUnchecked(arg0), namespaceOrAliasEquals(namespace, aliases.get(namespace))))
return input.getResult();
} else {
throw new RuntimeException(String.format("expecting zero or one args %s", input));
}
return Optional.absent();
} else {
// No extension annotation, should check whether to return absent
return input.getResult();
}
}
代码示例来源:origin: jclouds/legacy-jclouds
/**
* Provides synchronous access to Virtual Interface features (VIFs).
*
* @see VirtualInterfaceAsyncApi
* @author Adam Lowe
*/
@Beta
@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.VIRTUAL_INTERFACES)
public interface VirtualInterfaceApi {
/**
* Returns the list of Virtual Interfaces for a given instance.
*
* @return the list of snapshots
*/
FluentIterable<? extends VirtualInterface> listOnServer(String serverId);
}
代码示例来源:origin: Nextdoor/bender
@Override
public Optional<Object> apply(InvocationSuccess input) {
Class<?> target = unwrapIfOptional(input.getInvocation().getInvokable().getReturnType());
Optional<org.jclouds.openstack.v2_0.services.Extension> ext = Optional.fromNullable(target
.getAnnotation(org.jclouds.openstack.v2_0.services.Extension.class));
if (ext.isPresent()) {
URI namespace = URI.create(ext.get().namespace());
List<Object> args = input.getInvocation().getArgs();
Set<URI> aliasesForNamespace = aliases.containsKey(namespace) ? aliases.get(namespace) : Sets.<URI> newHashSet();
String name = ext.get().name();
String alias = ext.get().alias();
if (args.isEmpty()) {
if (checkExtension("", namespace, aliasesForNamespace, alias, name)) {
return input.getResult();
}
} else if (args.size() == 1) {
String arg0 = checkNotNull(args.get(0), "arg[0] in %s", input).toString();
if (checkExtension(arg0, namespace, aliasesForNamespace, alias, name)) {
return input.getResult();
}
} else {
throw new RuntimeException(String.format("expecting zero or one args %s", input));
}
return Optional.absent();
} else {
// No extension annotation, should check whether to return absent
return input.getResult();
}
}
代码示例来源:origin: org.jclouds.api/openstack-keystone
@Override
public Optional<Object> apply(InvocationSuccess input) {
Class<?> target = unwrapIfOptional(input.getInvocation().getInvokable().getReturnType());
Optional<org.jclouds.openstack.v2_0.services.Extension> ext = Optional.fromNullable(target
.getAnnotation(org.jclouds.openstack.v2_0.services.Extension.class));
if (ext.isPresent()) {
URI namespace = URI.create(ext.get().namespace());
List<Object> args = input.getInvocation().getArgs();
if (args.isEmpty()) {
if (any(extensions.getUnchecked(""), namespaceOrAliasEquals(namespace, aliases.get(namespace))))
return input.getResult();
} else if (args.size() == 1) {
String arg0 = checkNotNull(args.get(0), "arg[0] in %s", input).toString();
if (any(extensions.getUnchecked(arg0), namespaceOrAliasEquals(namespace, aliases.get(namespace))))
return input.getResult();
} else {
throw new RuntimeException(String.format("expecting zero or one args %s", input));
}
return Optional.absent();
} else {
// No extension annotation, should check whether to return absent
return input.getResult();
}
}
代码示例来源:origin: org.jclouds.api/openstack-nova
/**
* Provides synchronous access to Virtual Interface features (VIFs).
*
* @see VirtualInterfaceAsyncApi
* @author Adam Lowe
*/
@Beta
@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.VIRTUAL_INTERFACES)
public interface VirtualInterfaceApi {
/**
* Returns the list of Virtual Interfaces for a given instance.
*
* @return the list of snapshots
*/
FluentIterable<? extends VirtualInterface> listOnServer(String serverId);
}
代码示例来源:origin: apache/jclouds
@Override
public Optional<Object> apply(InvocationSuccess input) {
Class<?> target = unwrapIfOptional(input.getInvocation().getInvokable().getReturnType());
Optional<org.jclouds.openstack.v2_0.services.Extension> ext = Optional.fromNullable(target
.getAnnotation(org.jclouds.openstack.v2_0.services.Extension.class));
if (ext.isPresent()) {
URI namespace = URI.create(ext.get().namespace());
List<Object> args = input.getInvocation().getArgs();
Set<URI> aliasesForNamespace = aliases.containsKey(namespace) ? aliases.get(namespace) : Sets.<URI> newHashSet();
String name = ext.get().name();
String alias = ext.get().alias();
if (args.isEmpty()) {
if (checkExtension("", namespace, aliasesForNamespace, alias, name)) {
return input.getResult();
}
} else if (args.size() == 1) {
String arg0 = checkNotNull(args.get(0), "arg[0] in %s", input).toString();
if (checkExtension(arg0, namespace, aliasesForNamespace, alias, name)) {
return input.getResult();
}
} else {
throw new RuntimeException(String.format("expecting zero or one args %s", input));
}
return Optional.absent();
} else {
// No extension annotation, should check whether to return absent
return input.getResult();
}
}
代码示例来源:origin: io.cloudsoft.jclouds.api/openstack-nova
/**
* Provides synchronous access to Virtual Interface features (VIFs).
*
* @see VirtualInterfaceAsyncApi
* @author Adam Lowe
*/
@Beta
@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.VIRTUAL_INTERFACES)
public interface VirtualInterfaceApi {
/**
* Returns the list of Virtual Interfaces for a given instance.
*
* @return the list of snapshots
*/
FluentIterable<? extends VirtualInterface> listOnServer(String serverId);
}
代码示例来源:origin: jclouds/legacy-jclouds
/**
* Provides synchronous access to Server details including security group, referred to as the CREATESERVEREXT extension
* in the nova documentation
* <p/>
* NOTE: the equivalent to listServersInDetail() isn't available at the other end, so not extending ServerApi at this
* time.
*
* @author Adam Lowe
* @see org.jclouds.openstack.nova.v2_0.features.ServerApi
* @see ServerWithSecurityGroupsAsyncApi
* @see <a href="http://nova.openstack.org/api/nova.api.openstack.compute.contrib.createserverext.html"/>
*/
@Beta
@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.CREATESERVEREXT)
public interface ServerWithSecurityGroupsApi {
/**
* Retrieve details of the specified server, including security groups
*
* @param id id of the server
* @return server or null if not found
*/
ServerWithSecurityGroups get(String id);
}
代码示例来源:origin: jclouds/legacy-jclouds
/**
* Provides asynchronous access to Simple Tenant Usage via the REST API.
* <p/>
*
* @author Adam Lowe
* @see SimpleTenantUsageAsyncApi
*/
@Beta
@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.SIMPLE_TENANT_USAGE)
public interface SimpleTenantUsageApi {
/**
* Retrieve tenant_usage for all tenants
*
* @return the set of TenantUsage reports
*/
FluentIterable<? extends SimpleTenantUsage> list();
/**
* Retrieve tenant_usage for a specified tenant
*
* @return the requested tenant usage
*/
SimpleTenantUsage get(String tenantId);
}
代码示例来源:origin: jclouds/legacy-jclouds
/**
* Provides synchronous access to Quota Classes via the REST API.
* <p/>
* To use this extension, you need to have administrative rights to the tenants upon which you are placing quotas.
*
* @author Adam Lowe
* @see QuotaClassAsyncApi
* @see <a href="http://nova.openstack.org/api/nova.api.openstack.compute.contrib.quota_classes.html"/>
* @see <a href="http://wiki.openstack.org/QuotaClass"/>
*/
@Beta
@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.QUOTA_CLASSES)
public interface QuotaClassApi {
/**
* @return the quota settings for the tenant
*/
QuotaClass get(String id);
/**
* Update the quotas for a given tenant
*
* @return true if successful
*/
boolean update(String id, QuotaClass quotas);
}
代码示例来源:origin: io.cloudsoft.jclouds.api/openstack-nova
/**
* Provides asynchronous access to Simple Tenant Usage via the REST API.
* <p/>
*
* @author Adam Lowe
* @see SimpleTenantUsageAsyncApi
*/
@Beta
@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.SIMPLE_TENANT_USAGE)
public interface SimpleTenantUsageApi {
/**
* Retrieve tenant_usage for all tenants
*
* @return the set of TenantUsage reports
*/
FluentIterable<? extends SimpleTenantUsage> list();
/**
* Retrieve tenant_usage for a specified tenant
*
* @return the requested tenant usage
*/
SimpleTenantUsage get(String tenantId);
}
代码示例来源:origin: org.jclouds.api/openstack-nova
/**
* Provides synchronous access to Server details including security group, referred to as the CREATESERVEREXT extension
* in the nova documentation
* <p/>
* NOTE: the equivalent to listServersInDetail() isn't available at the other end, so not extending ServerApi at this
* time.
*
* @author Adam Lowe
* @see org.jclouds.openstack.nova.v2_0.features.ServerApi
* @see ServerWithSecurityGroupsAsyncApi
* @see <a href="http://nova.openstack.org/api/nova.api.openstack.compute.contrib.createserverext.html"/>
*/
@Beta
@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.CREATESERVEREXT)
public interface ServerWithSecurityGroupsApi {
/**
* Retrieve details of the specified server, including security groups
*
* @param id id of the server
* @return server or null if not found
*/
ServerWithSecurityGroups get(String id);
}
代码示例来源:origin: io.cloudsoft.jclouds.api/openstack-nova
/**
* Provides synchronous access to Server details including security group, referred to as the CREATESERVEREXT extension
* in the nova documentation
* <p/>
* NOTE: the equivalent to listServersInDetail() isn't available at the other end, so not extending ServerApi at this
* time.
*
* @author Adam Lowe
* @see org.jclouds.openstack.nova.v2_0.features.ServerApi
* @see ServerWithSecurityGroupsAsyncApi
* @see <a href="http://nova.openstack.org/api/nova.api.openstack.compute.contrib.createserverext.html"/>
*/
@Beta
@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.CREATESERVEREXT)
public interface ServerWithSecurityGroupsApi {
/**
* Retrieve details of the specified server, including security groups
*
* @param id id of the server
* @return server or null if not found
*/
ServerWithSecurityGroups get(String id);
}
代码示例来源:origin: io.cloudsoft.jclouds.api/openstack-nova
/**
* @author Inbar Stolberg
*/
@Beta
@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.ADMIN_ACTIONS)
@RequestFilters(AuthenticateRequest.class)
public interface AvailabilityZoneAsyncApi {
/**
* @return all availability zones
*/
@GET
@Path("/os-availability-zone")
@SelectJson("availabilityZoneInfo")
@Consumes(MediaType.APPLICATION_JSON)
@Fallback(Fallbacks.EmptyFluentIterableOnNotFoundOr404.class)
ListenableFuture<? extends FluentIterable<? extends AvailabilityZone>> list();
}
代码示例来源:origin: org.jclouds.api/openstack-nova
/**
* Provides asynchronous access to Simple Tenant Usage via the REST API.
* <p/>
*
* @author Adam Lowe
* @see SimpleTenantUsageAsyncApi
*/
@Beta
@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.SIMPLE_TENANT_USAGE)
public interface SimpleTenantUsageApi {
/**
* Retrieve tenant_usage for all tenants
*
* @return the set of TenantUsage reports
*/
FluentIterable<? extends SimpleTenantUsage> list();
/**
* Retrieve tenant_usage for a specified tenant
*
* @return the requested tenant usage
*/
SimpleTenantUsage get(String tenantId);
}
代码示例来源:origin: org.jclouds.api/openstack-nova
/**
* Provides synchronous access to Quota Classes via the REST API.
* <p/>
* To use this extension, you need to have administrative rights to the tenants upon which you are placing quotas.
*
* @author Adam Lowe
* @see QuotaClassAsyncApi
* @see <a href="http://nova.openstack.org/api/nova.api.openstack.compute.contrib.quota_classes.html"/>
* @see <a href="http://wiki.openstack.org/QuotaClass"/>
*/
@Beta
@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.QUOTA_CLASSES)
public interface QuotaClassApi {
/**
* @return the quota settings for the tenant
*/
QuotaClass get(String id);
/**
* Update the quotas for a given tenant
*
* @return true if successful
*/
boolean update(String id, QuotaClass quotas);
}
内容来源于网络,如有侵权,请联系作者删除!