View Javadoc

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.compute.domain;
20  
21  import java.util.Set;
22  
23  import javax.annotation.Nullable;
24  
25  import org.jclouds.compute.domain.internal.NodeMetadataImpl;
26  import org.jclouds.domain.Credentials;
27  
28  import com.google.inject.ImplementedBy;
29  
30  /**
31   * @author Adrian Cole
32   * @author Ivan Meredith
33   */
34  @ImplementedBy(NodeMetadataImpl.class)
35  public interface NodeMetadata extends ComputeMetadata {
36     /**
37      * <h4>note</h4> hostname is something that is set in the operating system
38      * image, so this value, if present, cannot be guaranteed on images not
39      * directly controlled by the cloud provider.
40      * 
41      * @return hostname of the node, or null if unknown
42      * 
43      */
44     @Nullable
45     String getHostname();
46     
47     /**
48      * Tag used for all resources that belong to the same logical group. run, destroy commands are
49      * scoped to group.
50      * 
51      * @return group for this node, or null, if not a part of a group
52      * 
53      */
54     @Nullable
55     String getGroup();
56  
57     /**
58      * @see #getGroup
59      */
60     @Deprecated
61     String getTag();
62  
63     /**
64      * 
65      * The hardware this node is running, if possible to determine.
66      */
67     @Nullable
68     Hardware getHardware();
69  
70     /**
71      * 
72      * The id of the image this node was created from, if possible to correlate.
73      */
74     @Nullable
75     String getImageId();
76  
77     /**
78      * 
79      * The operating system this node is running, if possible to determine.
80      */
81     @Nullable
82     OperatingSystem getOperatingSystem();
83  
84     /**
85      * Current State of the node
86      */
87     NodeState getState();
88  
89     /**
90      * @return the TCP port used for terminal connections. Generally, this is port 22 for ssh.
91      */
92     int getLoginPort();
93  
94     /**
95      * secures access to root with a password. This password is required to access either the console
96      * or run sudo as root.
97      * <p/>
98      * ex. {@code echo 'password' |sudo -S command}
99      * 
100     * @return root or console password, if configured, or null.
101     */
102    @Nullable
103    String getAdminPassword();
104 
105    /**
106     * If possible, these are returned upon all detail requests. However, it is often the case that
107     * credentials are only available at "run" time.
108     */
109    Credentials getCredentials();
110 
111    /**
112     * All public IP addresses, potentially including shared ips.
113     */
114    Set<String> getPublicAddresses();
115 
116    /**
117     * All private IP addresses.
118     */
119    Set<String> getPrivateAddresses();
120 
121 }