コード例 #1
0
  @Before
  public void setUp() {
    Properties prop = new Properties();
    prop.put(Constants.PROPERTY_ENDPOINT, TestConstants.ENDPOINT);

    ContextBuilder builder =
        ContextBuilder.newBuilder(TestConstants.PROVIDER)
            .credentials(TestConstants.API_KEY, TestConstants.SECRET_KEY)
            //              .modules(modules)
            .overrides(prop);

    CloudStackContext context = builder.buildView(CloudStackContext.class);

    RestContext<CloudStackClient, CloudStackAsyncClient> providerContext =
        context.getProviderSpecificContext();
    client = providerContext.getApi();
  }
コード例 #2
0
 @Override
 protected GlobalPodClient clientFrom(CloudStackContext context) {
   return context.getGlobalContext().getApi().getPodClient();
 }
コード例 #3
0
 @Override
 protected GlobalZoneApi clientFrom(CloudStackContext context) {
   return context.getGlobalApi().getZoneApi();
 }