View Javadoc

1   /**
2    * Licensed to jclouds, Inc. (jclouds) under one or more
3    * contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  jclouds licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  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,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.jclouds.compute.domain;
20  
21  import java.util.Set;
22  
23  import org.jclouds.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 }