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.reference; |
20 | |
21 | import javax.inject.Named; |
22 | import javax.inject.Singleton; |
23 | |
24 | import com.google.inject.Inject; |
25 | |
26 | /** |
27 | * |
28 | * @author Adrian Cole |
29 | */ |
30 | public interface ComputeServiceConstants { |
31 | |
32 | public static final String COMPUTE_LOGGER = "jclouds.compute"; |
33 | public static final String LOCAL_PARTITION_GB_PATTERN = "disk_drive/%s/gb"; |
34 | public static final String PROPERTY_TIMEOUT_NODE_TERMINATED = "jclouds.compute.timeout.node-terminated"; |
35 | public static final String PROPERTY_TIMEOUT_NODE_RUNNING = "jclouds.compute.timeout.node-running"; |
36 | public static final String PROPERTY_TIMEOUT_NODE_SUSPENDED = "jclouds.compute.timeout.node-suspended"; |
37 | public static final String PROPERTY_TIMEOUT_SCRIPT_COMPLETE = "jclouds.compute.timeout.script-complete"; |
38 | public static final String PROPERTY_TIMEOUT_PORT_OPEN = "jclouds.compute.timeout.port-open"; |
39 | /** |
40 | * comma-separated nodes that we shouldn't attempt to list as they are dead in the provider for |
41 | * some reason. |
42 | */ |
43 | public static final String PROPERTY_BLACKLIST_NODES = "jclouds.compute.blacklist-nodes"; |
44 | |
45 | /** |
46 | * os to map of version input string to output string |
47 | * <p/> |
48 | * ex. |
49 | * |
50 | * <pre> |
51 | * {"centos":{"5.4":"5.4","5.5":"5.5"},"rhel":{"5.4":"5.4","5.5":"5.5"},"ubuntu":{"karmic":"9.10","lucid":"10.04","maverick":"10.10","natty":"11.04"},"windows":{"2008":"2008","Server 2008":"2008","2008 R2":"2008 R2","Server 2008 R2":"2008 R2","2008 SP2":"2008 SP2","Server 2008 SP2":"2008 SP2"}} |
52 | * </pre> |
53 | */ |
54 | public static final String PROPERTY_OS_VERSION_MAP_JSON = "jclouds.compute.os-version-map-json"; |
55 | |
56 | @Singleton |
57 | public static class ReferenceData { |
58 | @Inject(optional = true) |
59 | @Named(PROPERTY_OS_VERSION_MAP_JSON) |
60 | public String osVersionMapJson = "{\"suse\":{\"\":\"\",\"11\":\"11\",\"11 SP1\":\"11 SP1\"},\"debian\":{\"\":\"\",\"lenny\":\"5.0\",\"squeeze\":\"6.0\"},\"centos\":{\"\":\"\",\"5\":\"5.0\",\"5.2\":\"5.2\",\"5.3\":\"5.3\",\"5.4\":\"5.4\",\"5.5\":\"5.5\",\"5.6\":\"5.6\",\"5.7\":\"5.7\",\"6.0\":\"6.0\"},\"rhel\":{\"\":\"\",\"5\":\"5.0\",\"5.2\":\"5.2\",\"5.3\":\"5.3\",\"5.4\":\"5.4\",\"5.5\":\"5.5\",\"5.6\":\"5.6\",\"5.7\":\"5.7\",\"6.0\":\"6.0\"},\"solaris\":{\"\":\"\",\"10\":\"10\"},\"ubuntu\":{\"\":\"\",\"hardy\":\"8.04\",\"karmic\":\"9.10\",\"lucid\":\"10.04\",\"10.04.1\":\"10.04\",\"maverick\":\"10.10\",\"natty\":\"11.04\",\"oneiric\":\"11.10\",\"precise\":\"12.04\"},\"windows\":{\"\":\"\",\"2003\":\"2003\",\"2003 Standard\":\"2003\",\"2003 R2\":\"2003 R2\",\"2008\":\"2008\",\"2008 Web\":\"2008\",\"2008 Server\":\"2008\",\"Server 2008\":\"2008\",\"2008 R1\":\"2008 R1\",\"2008 R2\":\"2008 R2\",\"Server 2008 R2\":\"2008 R2\",\"2008 Server R2\":\"2008 R2\",\"2008 SP2\":\"2008 SP2\",\"Server 2008 SP2\":\"2008 SP2\"}}"; |
61 | } |
62 | |
63 | @Singleton |
64 | public static class Timeouts { |
65 | @Inject(optional = true) |
66 | @Named(PROPERTY_TIMEOUT_NODE_TERMINATED) |
67 | public long nodeTerminated = 30 * 1000; |
68 | |
69 | @Inject(optional = true) |
70 | @Named(PROPERTY_TIMEOUT_NODE_RUNNING) |
71 | public long nodeRunning = 1200 * 1000; |
72 | |
73 | @Inject(optional = true) |
74 | @Named(PROPERTY_TIMEOUT_NODE_SUSPENDED) |
75 | public long nodeSuspended = 30 * 1000; |
76 | |
77 | @Inject(optional = true) |
78 | @Named(PROPERTY_TIMEOUT_SCRIPT_COMPLETE) |
79 | public long scriptComplete = 600 * 1000; |
80 | |
81 | @Inject(optional = true) |
82 | @Named(PROPERTY_TIMEOUT_PORT_OPEN) |
83 | public long portOpen = 600 * 1000; |
84 | |
85 | } |
86 | } |