1 /**
2 *
3 * Copyright (C) 2011 Cloud Conscious, LLC. <info@cloudconscious.com>
4 *
5 * ====================================================================
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 * ====================================================================
18 */
19 package org.jclouds.vcloud;
20
21 import java.net.URI;
22 import java.util.NoSuchElementException;
23 import java.util.concurrent.TimeUnit;
24
25 import javax.annotation.Nullable;
26
27 import org.jclouds.concurrent.Timeout;
28 import org.jclouds.vcloud.domain.Task;
29 import org.jclouds.vcloud.domain.VCloudExpressVApp;
30 import org.jclouds.vcloud.domain.VCloudExpressVAppTemplate;
31 import org.jclouds.vcloud.options.CloneVAppOptions;
32 import org.jclouds.vcloud.options.InstantiateVAppTemplateOptions;
33
34 /**
35 * Provides access to VCloud resources via their REST API.
36 * <p/>
37 *
38 * @see <a href="https://community.vcloudexpress.terremark.com/en-us/discussion_forums/f/60.aspx" />
39 * @author Adrian Cole
40 */
41 @Timeout(duration = 300, timeUnit = TimeUnit.SECONDS)
42 public interface VCloudExpressClient extends CommonVCloudClient {
43
44 VCloudExpressVApp instantiateVAppTemplateInVDC(URI vDC, URI template, String appName,
45 InstantiateVAppTemplateOptions... options);
46
47 Task cloneVAppInVDC(URI vDC, URI toClone, String newName, CloneVAppOptions... options);
48
49 VCloudExpressVAppTemplate getVAppTemplate(URI vAppTemplate);
50
51 /**
52 * returns the vapp template corresponding to a catalog item in the catalog associated with the
53 * specified name. Note that the org and catalog parameters can be null to choose default.
54 *
55 * @param orgName
56 * organization name, or null for the default
57 * @param catalogName
58 * catalog name, or null for the default
59 * @param itemName
60 * item you wish to lookup
61 *
62 * @throws NoSuchElementException
63 * if you specified an org, catalog, or catalog item name that isn't present
64 */
65 VCloudExpressVAppTemplate findVAppTemplateInOrgCatalogNamed(@Nullable String orgName, @Nullable String catalogName,
66 String itemName);
67
68 VCloudExpressVApp findVAppInOrgVDCNamed(@Nullable String orgName, @Nullable String catalogName, String vAppName);
69
70 VCloudExpressVApp getVApp(URI vApp);
71
72 Task deployVApp(URI vAppId);
73
74 /**
75 *
76 */
77 Task undeployVApp(URI vAppId);
78
79 /**
80 * This call powers on the vApp, as specified in the vApp's ovf:Startup element.
81 */
82 Task powerOnVApp(URI vAppId);
83
84 /**
85 * This call powers off the vApp, as specified in the vApp's ovf:Startup element.
86 */
87 Task powerOffVApp(URI vAppId);
88
89 /**
90 * This call shuts down the vApp.
91 */
92 void shutdownVApp(URI vAppId);
93
94 /**
95 * This call resets the vApp.
96 */
97 Task resetVApp(URI vAppId);
98
99 /**
100 * This call suspends the vApp.
101 */
102 Task suspendVApp(URI vAppId);
103
104 Task deleteVApp(URI vAppId);
105
106 }