appscale-tools 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +37 -0
- data/README +17 -0
- data/bin/appscale-add-keypair +15 -0
- data/bin/appscale-describe-instances +16 -0
- data/bin/appscale-remove-app +13 -0
- data/bin/appscale-reset-pwd +13 -0
- data/bin/appscale-run-instances +15 -0
- data/bin/appscale-terminate-instances +14 -0
- data/bin/appscale-upload-app +13 -0
- data/doc/AdvancedNode.html +163 -0
- data/doc/AppControllerClient.html +831 -0
- data/doc/AppEngineConfigException.html +165 -0
- data/doc/AppScaleException.html +165 -0
- data/doc/AppScaleTools.html +768 -0
- data/doc/BadCommandLineArgException.html +166 -0
- data/doc/BadConfigurationException.html +166 -0
- data/doc/CommonFunctions.html +2559 -0
- data/doc/EncryptionHelper.html +332 -0
- data/doc/GodInterface.html +443 -0
- data/doc/InfrastructureException.html +166 -0
- data/doc/Node.html +470 -0
- data/doc/NodeLayout.html +1297 -0
- data/doc/Object.html +539 -0
- data/doc/ParseArgs.html +268 -0
- data/doc/RemoteLogging.html +268 -0
- data/doc/SimpleNode.html +163 -0
- data/doc/UsageText.html +1204 -0
- data/doc/UserAppClient.html +993 -0
- data/doc/VMTools.html +1365 -0
- data/doc/bin/appscale-add-keypair.html +56 -0
- data/doc/bin/appscale-describe-instances.html +56 -0
- data/doc/bin/appscale-remove-app.html +56 -0
- data/doc/bin/appscale-reset-pwd.html +56 -0
- data/doc/bin/appscale-run-instances.html +56 -0
- data/doc/bin/appscale-terminate-instances.html +56 -0
- data/doc/bin/appscale-upload-app.html +56 -0
- data/doc/created.rid +21 -0
- data/doc/images/add.png +0 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/delete.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/transparent.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +116 -0
- data/doc/js/darkfish.js +153 -0
- data/doc/js/jquery.js +18 -0
- data/doc/js/navigation.js +142 -0
- data/doc/js/quicksearch.js +114 -0
- data/doc/js/search.js +94 -0
- data/doc/js/search_index.js +1 -0
- data/doc/js/searcher.js +228 -0
- data/doc/js/thickbox-compressed.js +10 -0
- data/doc/lib/app_controller_client_rb.html +60 -0
- data/doc/lib/appscale_tools_rb.html +88 -0
- data/doc/lib/common_functions_rb.html +78 -0
- data/doc/lib/custom_exceptions_rb.html +54 -0
- data/doc/lib/encryption_helper_rb.html +60 -0
- data/doc/lib/godinterface_rb.html +52 -0
- data/doc/lib/node_layout_rb.html +55 -0
- data/doc/lib/parse_args_rb.html +58 -0
- data/doc/lib/remote_log_rb.html +58 -0
- data/doc/lib/sshcopyid.html +174 -0
- data/doc/lib/usage_text_rb.html +58 -0
- data/doc/lib/user_app_client_rb.html +62 -0
- data/doc/lib/vm_tools_rb.html +62 -0
- data/doc/table_of_contents.html +496 -0
- data/lib/app_controller_client.rb +181 -0
- data/lib/appscale_tools.rb +403 -0
- data/lib/common_functions.rb +1467 -0
- data/lib/custom_exceptions.rb +25 -0
- data/lib/encryption_helper.rb +86 -0
- data/lib/godinterface.rb +152 -0
- data/lib/node_layout.rb +665 -0
- data/lib/parse_args.rb +415 -0
- data/lib/remote_log.rb +46 -0
- data/lib/sshcopyid +65 -0
- data/lib/usage_text.rb +144 -0
- data/lib/user_app_client.rb +245 -0
- data/lib/vm_tools.rb +549 -0
- data/test/tc_app_controller_client.rb +10 -0
- data/test/tc_appscale_add_keypair.rb +44 -0
- data/test/tc_appscale_describe_instances.rb +69 -0
- data/test/tc_appscale_remove_app.rb +128 -0
- data/test/tc_appscale_reset_pwd.rb +156 -0
- data/test/tc_appscale_run_instances.rb +48 -0
- data/test/tc_appscale_terminate_instances.rb +104 -0
- data/test/tc_appscale_upload_app.rb +166 -0
- data/test/tc_common_functions.rb +56 -0
- data/test/tc_encryption_helper.rb +10 -0
- data/test/tc_god_interface.rb +10 -0
- data/test/tc_node_layout.rb +93 -0
- data/test/tc_parse_args.rb +160 -0
- data/test/tc_user_app_client.rb +10 -0
- data/test/tc_vm_tools.rb +10 -0
- data/test/ts_all.rb +20 -0
- metadata +211 -0
@@ -0,0 +1,165 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
6
|
+
|
7
|
+
<title>class AppEngineConfigException - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
|
10
|
+
|
11
|
+
<script type="text/javascript">
|
12
|
+
var rdoc_rel_prefix = "./";
|
13
|
+
</script>
|
14
|
+
|
15
|
+
<script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
|
16
|
+
<script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
|
17
|
+
<script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
|
18
|
+
<script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
|
19
|
+
<script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
|
20
|
+
<script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>
|
21
|
+
|
22
|
+
|
23
|
+
<body id="top" class="class">
|
24
|
+
<nav id="metadata">
|
25
|
+
<nav id="home-section" class="section">
|
26
|
+
<h3 class="section-header">
|
27
|
+
<a href="./index.html">Home</a>
|
28
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
29
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
30
|
+
</h3>
|
31
|
+
</nav>
|
32
|
+
|
33
|
+
|
34
|
+
<nav id="search-section" class="section project-section" class="initially-hidden">
|
35
|
+
<form action="#" method="get" accept-charset="utf-8">
|
36
|
+
<h3 class="section-header">
|
37
|
+
<input type="text" name="search" placeholder="Search" id="search-field"
|
38
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
39
|
+
</h3>
|
40
|
+
</form>
|
41
|
+
|
42
|
+
<ul id="search-results" class="initially-hidden"></ul>
|
43
|
+
</nav>
|
44
|
+
|
45
|
+
|
46
|
+
<div id="file-metadata">
|
47
|
+
<nav id="file-list-section" class="section">
|
48
|
+
<h3 class="section-header">Defined In</h3>
|
49
|
+
<ul>
|
50
|
+
<li>lib/custom_exceptions.rb
|
51
|
+
</ul>
|
52
|
+
</nav>
|
53
|
+
|
54
|
+
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<div id="class-metadata">
|
58
|
+
|
59
|
+
<nav id="parent-class-section" class="section">
|
60
|
+
<h3 class="section-header">Parent</h3>
|
61
|
+
|
62
|
+
<p class="link"><a href="AppScaleException.html">AppScaleException</a>
|
63
|
+
|
64
|
+
</nav>
|
65
|
+
|
66
|
+
|
67
|
+
|
68
|
+
</div>
|
69
|
+
|
70
|
+
<div id="project-metadata">
|
71
|
+
<nav id="fileindex-section" class="section project-section">
|
72
|
+
<h3 class="section-header">Pages</h3>
|
73
|
+
|
74
|
+
<ul>
|
75
|
+
|
76
|
+
<li class="file"><a href="./lib/sshcopyid.html">sshcopyid</a>
|
77
|
+
|
78
|
+
</ul>
|
79
|
+
</nav>
|
80
|
+
|
81
|
+
<nav id="classindex-section" class="section project-section">
|
82
|
+
<h3 class="section-header">Class and Module Index</h3>
|
83
|
+
|
84
|
+
<ul class="link-list">
|
85
|
+
|
86
|
+
<li><a href="./AdvancedNode.html">AdvancedNode</a>
|
87
|
+
|
88
|
+
<li><a href="./AppControllerClient.html">AppControllerClient</a>
|
89
|
+
|
90
|
+
<li><a href="./AppEngineConfigException.html">AppEngineConfigException</a>
|
91
|
+
|
92
|
+
<li><a href="./AppScaleException.html">AppScaleException</a>
|
93
|
+
|
94
|
+
<li><a href="./AppScaleTools.html">AppScaleTools</a>
|
95
|
+
|
96
|
+
<li><a href="./BadCommandLineArgException.html">BadCommandLineArgException</a>
|
97
|
+
|
98
|
+
<li><a href="./BadConfigurationException.html">BadConfigurationException</a>
|
99
|
+
|
100
|
+
<li><a href="./CommonFunctions.html">CommonFunctions</a>
|
101
|
+
|
102
|
+
<li><a href="./EncryptionHelper.html">EncryptionHelper</a>
|
103
|
+
|
104
|
+
<li><a href="./GodInterface.html">GodInterface</a>
|
105
|
+
|
106
|
+
<li><a href="./InfrastructureException.html">InfrastructureException</a>
|
107
|
+
|
108
|
+
<li><a href="./Node.html">Node</a>
|
109
|
+
|
110
|
+
<li><a href="./NodeLayout.html">NodeLayout</a>
|
111
|
+
|
112
|
+
<li><a href="./Object.html">Object</a>
|
113
|
+
|
114
|
+
<li><a href="./ParseArgs.html">ParseArgs</a>
|
115
|
+
|
116
|
+
<li><a href="./RemoteLogging.html">RemoteLogging</a>
|
117
|
+
|
118
|
+
<li><a href="./SimpleNode.html">SimpleNode</a>
|
119
|
+
|
120
|
+
<li><a href="./UsageText.html">UsageText</a>
|
121
|
+
|
122
|
+
<li><a href="./UserAppClient.html">UserAppClient</a>
|
123
|
+
|
124
|
+
<li><a href="./VMTools.html">VMTools</a>
|
125
|
+
|
126
|
+
</ul>
|
127
|
+
</nav>
|
128
|
+
|
129
|
+
</div>
|
130
|
+
</nav>
|
131
|
+
|
132
|
+
<div id="documentation">
|
133
|
+
<h1 class="class">class AppEngineConfigException</h1>
|
134
|
+
|
135
|
+
<div id="description" class="description">
|
136
|
+
|
137
|
+
<p>a class representing exceptions related to app engine apps to be uploaded</p>
|
138
|
+
|
139
|
+
</div><!-- description -->
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
<!-- Methods -->
|
154
|
+
|
155
|
+
</section><!-- 5Buntitled-5D -->
|
156
|
+
|
157
|
+
</div><!-- documentation -->
|
158
|
+
|
159
|
+
|
160
|
+
<footer id="validator-badges">
|
161
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
162
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
|
163
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
164
|
+
</footer>
|
165
|
+
|
@@ -0,0 +1,165 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
6
|
+
|
7
|
+
<title>class AppScaleException - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
|
10
|
+
|
11
|
+
<script type="text/javascript">
|
12
|
+
var rdoc_rel_prefix = "./";
|
13
|
+
</script>
|
14
|
+
|
15
|
+
<script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
|
16
|
+
<script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
|
17
|
+
<script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
|
18
|
+
<script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
|
19
|
+
<script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
|
20
|
+
<script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>
|
21
|
+
|
22
|
+
|
23
|
+
<body id="top" class="class">
|
24
|
+
<nav id="metadata">
|
25
|
+
<nav id="home-section" class="section">
|
26
|
+
<h3 class="section-header">
|
27
|
+
<a href="./index.html">Home</a>
|
28
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
29
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
30
|
+
</h3>
|
31
|
+
</nav>
|
32
|
+
|
33
|
+
|
34
|
+
<nav id="search-section" class="section project-section" class="initially-hidden">
|
35
|
+
<form action="#" method="get" accept-charset="utf-8">
|
36
|
+
<h3 class="section-header">
|
37
|
+
<input type="text" name="search" placeholder="Search" id="search-field"
|
38
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
39
|
+
</h3>
|
40
|
+
</form>
|
41
|
+
|
42
|
+
<ul id="search-results" class="initially-hidden"></ul>
|
43
|
+
</nav>
|
44
|
+
|
45
|
+
|
46
|
+
<div id="file-metadata">
|
47
|
+
<nav id="file-list-section" class="section">
|
48
|
+
<h3 class="section-header">Defined In</h3>
|
49
|
+
<ul>
|
50
|
+
<li>lib/custom_exceptions.rb
|
51
|
+
</ul>
|
52
|
+
</nav>
|
53
|
+
|
54
|
+
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<div id="class-metadata">
|
58
|
+
|
59
|
+
<nav id="parent-class-section" class="section">
|
60
|
+
<h3 class="section-header">Parent</h3>
|
61
|
+
|
62
|
+
<p class="link">Exception
|
63
|
+
|
64
|
+
</nav>
|
65
|
+
|
66
|
+
|
67
|
+
|
68
|
+
</div>
|
69
|
+
|
70
|
+
<div id="project-metadata">
|
71
|
+
<nav id="fileindex-section" class="section project-section">
|
72
|
+
<h3 class="section-header">Pages</h3>
|
73
|
+
|
74
|
+
<ul>
|
75
|
+
|
76
|
+
<li class="file"><a href="./lib/sshcopyid.html">sshcopyid</a>
|
77
|
+
|
78
|
+
</ul>
|
79
|
+
</nav>
|
80
|
+
|
81
|
+
<nav id="classindex-section" class="section project-section">
|
82
|
+
<h3 class="section-header">Class and Module Index</h3>
|
83
|
+
|
84
|
+
<ul class="link-list">
|
85
|
+
|
86
|
+
<li><a href="./AdvancedNode.html">AdvancedNode</a>
|
87
|
+
|
88
|
+
<li><a href="./AppControllerClient.html">AppControllerClient</a>
|
89
|
+
|
90
|
+
<li><a href="./AppEngineConfigException.html">AppEngineConfigException</a>
|
91
|
+
|
92
|
+
<li><a href="./AppScaleException.html">AppScaleException</a>
|
93
|
+
|
94
|
+
<li><a href="./AppScaleTools.html">AppScaleTools</a>
|
95
|
+
|
96
|
+
<li><a href="./BadCommandLineArgException.html">BadCommandLineArgException</a>
|
97
|
+
|
98
|
+
<li><a href="./BadConfigurationException.html">BadConfigurationException</a>
|
99
|
+
|
100
|
+
<li><a href="./CommonFunctions.html">CommonFunctions</a>
|
101
|
+
|
102
|
+
<li><a href="./EncryptionHelper.html">EncryptionHelper</a>
|
103
|
+
|
104
|
+
<li><a href="./GodInterface.html">GodInterface</a>
|
105
|
+
|
106
|
+
<li><a href="./InfrastructureException.html">InfrastructureException</a>
|
107
|
+
|
108
|
+
<li><a href="./Node.html">Node</a>
|
109
|
+
|
110
|
+
<li><a href="./NodeLayout.html">NodeLayout</a>
|
111
|
+
|
112
|
+
<li><a href="./Object.html">Object</a>
|
113
|
+
|
114
|
+
<li><a href="./ParseArgs.html">ParseArgs</a>
|
115
|
+
|
116
|
+
<li><a href="./RemoteLogging.html">RemoteLogging</a>
|
117
|
+
|
118
|
+
<li><a href="./SimpleNode.html">SimpleNode</a>
|
119
|
+
|
120
|
+
<li><a href="./UsageText.html">UsageText</a>
|
121
|
+
|
122
|
+
<li><a href="./UserAppClient.html">UserAppClient</a>
|
123
|
+
|
124
|
+
<li><a href="./VMTools.html">VMTools</a>
|
125
|
+
|
126
|
+
</ul>
|
127
|
+
</nav>
|
128
|
+
|
129
|
+
</div>
|
130
|
+
</nav>
|
131
|
+
|
132
|
+
<div id="documentation">
|
133
|
+
<h1 class="class">class AppScaleException</h1>
|
134
|
+
|
135
|
+
<div id="description" class="description">
|
136
|
+
|
137
|
+
<p>a generic class to represent exceptions thrown within AppScale</p>
|
138
|
+
|
139
|
+
</div><!-- description -->
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
<!-- Methods -->
|
154
|
+
|
155
|
+
</section><!-- 5Buntitled-5D -->
|
156
|
+
|
157
|
+
</div><!-- documentation -->
|
158
|
+
|
159
|
+
|
160
|
+
<footer id="validator-badges">
|
161
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
162
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
|
163
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
164
|
+
</footer>
|
165
|
+
|
@@ -0,0 +1,768 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
6
|
+
|
7
|
+
<title>module AppScaleTools - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
|
10
|
+
|
11
|
+
<script type="text/javascript">
|
12
|
+
var rdoc_rel_prefix = "./";
|
13
|
+
</script>
|
14
|
+
|
15
|
+
<script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
|
16
|
+
<script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
|
17
|
+
<script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
|
18
|
+
<script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
|
19
|
+
<script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
|
20
|
+
<script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>
|
21
|
+
|
22
|
+
|
23
|
+
<body id="top" class="module">
|
24
|
+
<nav id="metadata">
|
25
|
+
<nav id="home-section" class="section">
|
26
|
+
<h3 class="section-header">
|
27
|
+
<a href="./index.html">Home</a>
|
28
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
29
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
30
|
+
</h3>
|
31
|
+
</nav>
|
32
|
+
|
33
|
+
|
34
|
+
<nav id="search-section" class="section project-section" class="initially-hidden">
|
35
|
+
<form action="#" method="get" accept-charset="utf-8">
|
36
|
+
<h3 class="section-header">
|
37
|
+
<input type="text" name="search" placeholder="Search" id="search-field"
|
38
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
39
|
+
</h3>
|
40
|
+
</form>
|
41
|
+
|
42
|
+
<ul id="search-results" class="initially-hidden"></ul>
|
43
|
+
</nav>
|
44
|
+
|
45
|
+
|
46
|
+
<div id="file-metadata">
|
47
|
+
<nav id="file-list-section" class="section">
|
48
|
+
<h3 class="section-header">Defined In</h3>
|
49
|
+
<ul>
|
50
|
+
<li>lib/appscale_tools.rb
|
51
|
+
</ul>
|
52
|
+
</nav>
|
53
|
+
|
54
|
+
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<div id="class-metadata">
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
<!-- Method Quickref -->
|
62
|
+
<nav id="method-list-section" class="section">
|
63
|
+
<h3 class="section-header">Methods</h3>
|
64
|
+
|
65
|
+
<ul class="link-list">
|
66
|
+
|
67
|
+
<li><a href="#method-c-add_keypair">::add_keypair</a>
|
68
|
+
|
69
|
+
<li><a href="#method-c-describe_instances">::describe_instances</a>
|
70
|
+
|
71
|
+
<li><a href="#method-c-remove_app">::remove_app</a>
|
72
|
+
|
73
|
+
<li><a href="#method-c-reset_password">::reset_password</a>
|
74
|
+
|
75
|
+
<li><a href="#method-c-run_instances">::run_instances</a>
|
76
|
+
|
77
|
+
<li><a href="#method-c-terminate_instances">::terminate_instances</a>
|
78
|
+
|
79
|
+
<li><a href="#method-c-upload_app">::upload_app</a>
|
80
|
+
|
81
|
+
</ul>
|
82
|
+
</nav>
|
83
|
+
|
84
|
+
</div>
|
85
|
+
|
86
|
+
<div id="project-metadata">
|
87
|
+
<nav id="fileindex-section" class="section project-section">
|
88
|
+
<h3 class="section-header">Pages</h3>
|
89
|
+
|
90
|
+
<ul>
|
91
|
+
|
92
|
+
<li class="file"><a href="./lib/sshcopyid.html">sshcopyid</a>
|
93
|
+
|
94
|
+
</ul>
|
95
|
+
</nav>
|
96
|
+
|
97
|
+
<nav id="classindex-section" class="section project-section">
|
98
|
+
<h3 class="section-header">Class and Module Index</h3>
|
99
|
+
|
100
|
+
<ul class="link-list">
|
101
|
+
|
102
|
+
<li><a href="./AdvancedNode.html">AdvancedNode</a>
|
103
|
+
|
104
|
+
<li><a href="./AppControllerClient.html">AppControllerClient</a>
|
105
|
+
|
106
|
+
<li><a href="./AppEngineConfigException.html">AppEngineConfigException</a>
|
107
|
+
|
108
|
+
<li><a href="./AppScaleException.html">AppScaleException</a>
|
109
|
+
|
110
|
+
<li><a href="./AppScaleTools.html">AppScaleTools</a>
|
111
|
+
|
112
|
+
<li><a href="./BadCommandLineArgException.html">BadCommandLineArgException</a>
|
113
|
+
|
114
|
+
<li><a href="./BadConfigurationException.html">BadConfigurationException</a>
|
115
|
+
|
116
|
+
<li><a href="./CommonFunctions.html">CommonFunctions</a>
|
117
|
+
|
118
|
+
<li><a href="./EncryptionHelper.html">EncryptionHelper</a>
|
119
|
+
|
120
|
+
<li><a href="./GodInterface.html">GodInterface</a>
|
121
|
+
|
122
|
+
<li><a href="./InfrastructureException.html">InfrastructureException</a>
|
123
|
+
|
124
|
+
<li><a href="./Node.html">Node</a>
|
125
|
+
|
126
|
+
<li><a href="./NodeLayout.html">NodeLayout</a>
|
127
|
+
|
128
|
+
<li><a href="./Object.html">Object</a>
|
129
|
+
|
130
|
+
<li><a href="./ParseArgs.html">ParseArgs</a>
|
131
|
+
|
132
|
+
<li><a href="./RemoteLogging.html">RemoteLogging</a>
|
133
|
+
|
134
|
+
<li><a href="./SimpleNode.html">SimpleNode</a>
|
135
|
+
|
136
|
+
<li><a href="./UsageText.html">UsageText</a>
|
137
|
+
|
138
|
+
<li><a href="./UserAppClient.html">UserAppClient</a>
|
139
|
+
|
140
|
+
<li><a href="./VMTools.html">VMTools</a>
|
141
|
+
|
142
|
+
</ul>
|
143
|
+
</nav>
|
144
|
+
|
145
|
+
</div>
|
146
|
+
</nav>
|
147
|
+
|
148
|
+
<div id="documentation">
|
149
|
+
<h1 class="module">module AppScaleTools</h1>
|
150
|
+
|
151
|
+
<div id="description" class="description">
|
152
|
+
|
153
|
+
</div><!-- description -->
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
<!-- Constants -->
|
165
|
+
<section id="constants-list" class="section">
|
166
|
+
<h3 class="section-header">Constants</h3>
|
167
|
+
<dl>
|
168
|
+
|
169
|
+
<dt id="ADD_KEYPAIR_FLAGS">ADD_KEYPAIR_FLAGS
|
170
|
+
|
171
|
+
<dd class="description">
|
172
|
+
|
173
|
+
|
174
|
+
<dt id="ADD_KEYPAIR_USAGE">ADD_KEYPAIR_USAGE
|
175
|
+
|
176
|
+
<dd class="description">
|
177
|
+
|
178
|
+
|
179
|
+
<dt id="APPSCALE_NOT_RUNNING">APPSCALE_NOT_RUNNING
|
180
|
+
|
181
|
+
<dd class="description">
|
182
|
+
|
183
|
+
|
184
|
+
<dt id="APP_ALREADY_EXISTS">APP_ALREADY_EXISTS
|
185
|
+
|
186
|
+
<dd class="description">
|
187
|
+
|
188
|
+
|
189
|
+
<dt id="APP_NOT_RUNNING">APP_NOT_RUNNING
|
190
|
+
|
191
|
+
<dd class="description">
|
192
|
+
|
193
|
+
|
194
|
+
<dt id="APP_REMOVAL_CANCELLED">APP_REMOVAL_CANCELLED
|
195
|
+
|
196
|
+
<dd class="description">
|
197
|
+
|
198
|
+
|
199
|
+
<dt id="DESCRIBE_INSTANCES_FLAGS">DESCRIBE_INSTANCES_FLAGS
|
200
|
+
|
201
|
+
<dd class="description">
|
202
|
+
|
203
|
+
|
204
|
+
<dt id="DESCRIBE_INSTANCES_USAGE">DESCRIBE_INSTANCES_USAGE
|
205
|
+
|
206
|
+
<dd class="description">
|
207
|
+
|
208
|
+
|
209
|
+
<dt id="DJINN_SERVER_DIED_MSG">DJINN_SERVER_DIED_MSG
|
210
|
+
|
211
|
+
<dd class="description">
|
212
|
+
|
213
|
+
|
214
|
+
<dt id="DJINN_SERVER_PORT">DJINN_SERVER_PORT
|
215
|
+
|
216
|
+
<dd class="description">
|
217
|
+
|
218
|
+
|
219
|
+
<dt id="FQDN_REGEX">FQDN_REGEX
|
220
|
+
|
221
|
+
<dd class="description">
|
222
|
+
|
223
|
+
|
224
|
+
<dt id="IP_OR_FQDN">IP_OR_FQDN
|
225
|
+
|
226
|
+
<dd class="description">
|
227
|
+
|
228
|
+
|
229
|
+
<dt id="IP_REGEX">IP_REGEX
|
230
|
+
|
231
|
+
<dd class="description">
|
232
|
+
|
233
|
+
|
234
|
+
<dt id="NO_APPNAME_GIVEN">NO_APPNAME_GIVEN
|
235
|
+
|
236
|
+
<dd class="description">
|
237
|
+
|
238
|
+
|
239
|
+
<dt id="NO_FILE_PROVIDED_MSG">NO_FILE_PROVIDED_MSG
|
240
|
+
|
241
|
+
<dd class="description">
|
242
|
+
|
243
|
+
|
244
|
+
<dt id="NO_MACHINE_SET">NO_MACHINE_SET
|
245
|
+
|
246
|
+
<dd class="description">
|
247
|
+
|
248
|
+
|
249
|
+
<dt id="PBSERVER_PORT">PBSERVER_PORT
|
250
|
+
|
251
|
+
<dd class="description">
|
252
|
+
|
253
|
+
|
254
|
+
<dt id="REMOVE_APP_FLAGS">REMOVE_APP_FLAGS
|
255
|
+
|
256
|
+
<dd class="description">
|
257
|
+
|
258
|
+
|
259
|
+
<dt id="REMOVE_APP_USAGE">REMOVE_APP_USAGE
|
260
|
+
|
261
|
+
<dd class="description">
|
262
|
+
|
263
|
+
|
264
|
+
<dt id="RESET_PASSWORD_FLAGS">RESET_PASSWORD_FLAGS
|
265
|
+
|
266
|
+
<dd class="description">
|
267
|
+
|
268
|
+
|
269
|
+
<dt id="RESET_PASSWORD_USAGE">RESET_PASSWORD_USAGE
|
270
|
+
|
271
|
+
<dd class="description">
|
272
|
+
|
273
|
+
|
274
|
+
<dt id="RUN_INSTANCES_FLAGS">RUN_INSTANCES_FLAGS
|
275
|
+
|
276
|
+
<dd class="description">
|
277
|
+
|
278
|
+
|
279
|
+
<dt id="RUN_INSTANCES_USAGE">RUN_INSTANCES_USAGE
|
280
|
+
|
281
|
+
<dd class="description">
|
282
|
+
|
283
|
+
|
284
|
+
<dt id="SSH_PORT">SSH_PORT
|
285
|
+
|
286
|
+
<dd class="description">
|
287
|
+
|
288
|
+
|
289
|
+
<dt id="TERMINATE_INSTANCES_FLAGS">TERMINATE_INSTANCES_FLAGS
|
290
|
+
|
291
|
+
<dd class="description">
|
292
|
+
|
293
|
+
|
294
|
+
<dt id="TERMINATE_INSTANCES_USAGE">TERMINATE_INSTANCES_USAGE
|
295
|
+
|
296
|
+
<dd class="description">
|
297
|
+
|
298
|
+
|
299
|
+
<dt id="UA_SERVER_PORT">UA_SERVER_PORT
|
300
|
+
|
301
|
+
<dd class="description">
|
302
|
+
|
303
|
+
|
304
|
+
<dt id="UNABLE_TO_TERMINATE_ANY_MACHINES">UNABLE_TO_TERMINATE_ANY_MACHINES
|
305
|
+
|
306
|
+
<dd class="description">
|
307
|
+
|
308
|
+
|
309
|
+
<dt id="UPLOAD_APP_FLAGS">UPLOAD_APP_FLAGS
|
310
|
+
|
311
|
+
<dd class="description">
|
312
|
+
|
313
|
+
|
314
|
+
<dt id="UPLOAD_APP_USAGE">UPLOAD_APP_USAGE
|
315
|
+
|
316
|
+
<dd class="description">
|
317
|
+
|
318
|
+
|
319
|
+
<dt id="USER_NOT_ADMIN">USER_NOT_ADMIN
|
320
|
+
|
321
|
+
<dd class="description">
|
322
|
+
|
323
|
+
|
324
|
+
<dt id="USE_SSL">USE_SSL
|
325
|
+
|
326
|
+
<dd class="description">
|
327
|
+
|
328
|
+
|
329
|
+
</dl>
|
330
|
+
</section>
|
331
|
+
|
332
|
+
|
333
|
+
|
334
|
+
|
335
|
+
<!-- Methods -->
|
336
|
+
|
337
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section section">
|
338
|
+
<h3 class="section-header">Public Class Methods</h3>
|
339
|
+
|
340
|
+
|
341
|
+
<div id="method-c-add_keypair" class="method-detail ">
|
342
|
+
|
343
|
+
<div class="method-heading">
|
344
|
+
<span class="method-name">add_keypair</span><span
|
345
|
+
class="method-args">(options)</span>
|
346
|
+
<span class="method-click-advice">click to toggle source</span>
|
347
|
+
</div>
|
348
|
+
|
349
|
+
|
350
|
+
<div class="method-description">
|
351
|
+
|
352
|
+
|
353
|
+
|
354
|
+
|
355
|
+
|
356
|
+
<div class="method-source-code" id="add_keypair-source">
|
357
|
+
<pre><span class="ruby-comment"># File lib/appscale_tools.rb, line 165</span>
|
358
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">add_keypair</span>(<span class="ruby-identifier">options</span>)
|
359
|
+
<span class="ruby-identifier">keyname</span> = <span class="ruby-identifier">options</span>[<span class="ruby-string">'keyname'</span>]
|
360
|
+
<span class="ruby-identifier">ips_yaml</span> = <span class="ruby-identifier">options</span>[<span class="ruby-string">'ips'</span>]
|
361
|
+
<span class="ruby-identifier">auto</span> = <span class="ruby-identifier">options</span>[<span class="ruby-string">'auto'</span>]
|
362
|
+
|
363
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">ips_yaml</span>.<span class="ruby-identifier">nil?</span>
|
364
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">BadConfigurationException</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">ADD_KEYPAIR_USAGE</span>)
|
365
|
+
<span class="ruby-keyword">end</span>
|
366
|
+
|
367
|
+
<span class="ruby-identifier">node_layout</span> = <span class="ruby-constant">NodeLayout</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">ips_yaml</span>, { <span class="ruby-value">:database</span> =<span class="ruby-operator">></span> <span class="ruby-string">"cassandra"</span> } )
|
368
|
+
|
369
|
+
<span class="ruby-identifier">required_commands</span> = [<span class="ruby-string">"ssh-keygen"</span>, <span class="ruby-string">"ssh-copy-id"</span>]
|
370
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">auto</span>
|
371
|
+
<span class="ruby-identifier">required_commands</span> <span class="ruby-operator"><<</span> <span class="ruby-string">"expect"</span>
|
372
|
+
<span class="ruby-keyword">end</span>
|
373
|
+
<span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">require_commands</span>(<span class="ruby-identifier">required_commands</span>)
|
374
|
+
|
375
|
+
<span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">make_appscale_directory</span>()
|
376
|
+
|
377
|
+
<span class="ruby-identifier">path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-node">"~/.appscale/#{keyname}"</span>)
|
378
|
+
<span class="ruby-identifier">pub_key</span>, <span class="ruby-identifier">backup_key</span> = <span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">generate_rsa_key</span>(<span class="ruby-identifier">keyname</span>)
|
379
|
+
|
380
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">auto</span>
|
381
|
+
<span class="ruby-identifier">print</span> <span class="ruby-string">"\nEnter SSH password of root: "</span>
|
382
|
+
<span class="ruby-identifier">password</span> = <span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">get_line_from_stdin_no_echo</span>()
|
383
|
+
|
384
|
+
<span class="ruby-comment"># Location of expect script that interacts with ssh-copy-id</span>
|
385
|
+
<span class="ruby-identifier">expect_script</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-keyword">__FILE__</span>), <span class="ruby-string">".."</span>, <span class="ruby-string">"lib"</span>),<span class="ruby-string">"sshcopyid"</span>)
|
386
|
+
<span class="ruby-keyword">end</span>
|
387
|
+
|
388
|
+
<span class="ruby-identifier">ips</span> = <span class="ruby-identifier">node_layout</span>.<span class="ruby-identifier">nodes</span>.<span class="ruby-identifier">collect</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">node</span><span class="ruby-operator">|</span> <span class="ruby-identifier">node</span>.<span class="ruby-identifier">id</span> }
|
389
|
+
<span class="ruby-identifier">copy_success</span> = <span class="ruby-keyword">true</span>
|
390
|
+
|
391
|
+
<span class="ruby-identifier">ips</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">ip</span><span class="ruby-operator">|</span>
|
392
|
+
<span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">ssh_copy_id</span>(<span class="ruby-identifier">ip</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">auto</span>, <span class="ruby-identifier">expect_script</span>, <span class="ruby-identifier">password</span>)
|
393
|
+
}
|
394
|
+
|
395
|
+
<span class="ruby-identifier">head_node_ip</span> = <span class="ruby-identifier">node_layout</span>.<span class="ruby-identifier">head_node</span>.<span class="ruby-identifier">id</span>
|
396
|
+
<span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">scp_ssh_key_to_ip</span>(<span class="ruby-identifier">head_node_ip</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">pub_key</span>)
|
397
|
+
|
398
|
+
<span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">cp</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">backup_key</span>)
|
399
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-string">"A new ssh key has been generated for you and placed at"</span> <span class="ruby-operator">+</span>
|
400
|
+
<span class="ruby-node">" #{path}. You can now use this key to log into any of the "</span> <span class="ruby-operator">+</span>
|
401
|
+
<span class="ruby-string">"machines you specified without providing a password via the"</span> <span class="ruby-operator">+</span>
|
402
|
+
<span class="ruby-node">" following command:\n\tssh root@#{head_node_ip} -i #{path}"</span>
|
403
|
+
<span class="ruby-keyword">end</span></pre>
|
404
|
+
</div><!-- add_keypair-source -->
|
405
|
+
|
406
|
+
</div>
|
407
|
+
|
408
|
+
|
409
|
+
|
410
|
+
|
411
|
+
</div><!-- add_keypair-method -->
|
412
|
+
|
413
|
+
|
414
|
+
<div id="method-c-describe_instances" class="method-detail ">
|
415
|
+
|
416
|
+
<div class="method-heading">
|
417
|
+
<span class="method-name">describe_instances</span><span
|
418
|
+
class="method-args">(options)</span>
|
419
|
+
<span class="method-click-advice">click to toggle source</span>
|
420
|
+
</div>
|
421
|
+
|
422
|
+
|
423
|
+
<div class="method-description">
|
424
|
+
|
425
|
+
|
426
|
+
|
427
|
+
|
428
|
+
|
429
|
+
<div class="method-source-code" id="describe_instances-source">
|
430
|
+
<pre><span class="ruby-comment"># File lib/appscale_tools.rb, line 213</span>
|
431
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">describe_instances</span>(<span class="ruby-identifier">options</span>)
|
432
|
+
<span class="ruby-identifier">keyname</span> = <span class="ruby-identifier">options</span>[<span class="ruby-string">'keyname'</span>]
|
433
|
+
<span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">update_locations_file</span>(<span class="ruby-identifier">keyname</span>)
|
434
|
+
<span class="ruby-identifier">secret_key</span> = <span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">get_secret_key</span>(<span class="ruby-identifier">keyname</span>)
|
435
|
+
|
436
|
+
<span class="ruby-identifier">instance_info</span> = []
|
437
|
+
<span class="ruby-identifier">all_ips</span> = <span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">get_all_public_ips</span>(<span class="ruby-identifier">keyname</span>)
|
438
|
+
<span class="ruby-identifier">all_ips</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">ip</span><span class="ruby-operator">|</span>
|
439
|
+
<span class="ruby-identifier">acc</span> = <span class="ruby-constant">AppControllerClient</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">ip</span>, <span class="ruby-identifier">secret_key</span>)
|
440
|
+
<span class="ruby-identifier">instance_info</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">acc</span>.<span class="ruby-identifier">status</span>()
|
441
|
+
}
|
442
|
+
|
443
|
+
<span class="ruby-keyword">return</span> {<span class="ruby-value">:error</span> =<span class="ruby-operator">></span> <span class="ruby-keyword">nil</span>, <span class="ruby-value">:result</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">instance_info</span> }
|
444
|
+
<span class="ruby-keyword">end</span></pre>
|
445
|
+
</div><!-- describe_instances-source -->
|
446
|
+
|
447
|
+
</div>
|
448
|
+
|
449
|
+
|
450
|
+
|
451
|
+
|
452
|
+
</div><!-- describe_instances-method -->
|
453
|
+
|
454
|
+
|
455
|
+
<div id="method-c-remove_app" class="method-detail ">
|
456
|
+
|
457
|
+
<div class="method-heading">
|
458
|
+
<span class="method-name">remove_app</span><span
|
459
|
+
class="method-args">(options)</span>
|
460
|
+
<span class="method-click-advice">click to toggle source</span>
|
461
|
+
</div>
|
462
|
+
|
463
|
+
|
464
|
+
<div class="method-description">
|
465
|
+
|
466
|
+
|
467
|
+
|
468
|
+
|
469
|
+
|
470
|
+
<div class="method-source-code" id="remove_app-source">
|
471
|
+
<pre><span class="ruby-comment"># File lib/appscale_tools.rb, line 229</span>
|
472
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">remove_app</span>(<span class="ruby-identifier">options</span>)
|
473
|
+
<span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">update_locations_file</span>(<span class="ruby-identifier">options</span>[<span class="ruby-string">'keyname'</span>])
|
474
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-string">'appname'</span>].<span class="ruby-identifier">nil?</span>
|
475
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">BadConfigurationException</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">NO_APPNAME_GIVEN</span>)
|
476
|
+
<span class="ruby-keyword">end</span>
|
477
|
+
|
478
|
+
<span class="ruby-identifier">result</span> = <span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">confirm_app_removal</span>(<span class="ruby-identifier">options</span>[<span class="ruby-string">'confirm'</span>],
|
479
|
+
<span class="ruby-identifier">options</span>[<span class="ruby-string">'appname'</span>])
|
480
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">result</span> <span class="ruby-operator">==</span> <span class="ruby-string">"NO"</span>
|
481
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">AppScaleException</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">APP_REMOVAL_CANCELLED</span>)
|
482
|
+
<span class="ruby-keyword">end</span>
|
483
|
+
|
484
|
+
<span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">remove_app</span>(<span class="ruby-identifier">options</span>[<span class="ruby-string">'appname'</span>], <span class="ruby-identifier">options</span>[<span class="ruby-string">'keyname'</span>])
|
485
|
+
<span class="ruby-constant">Kernel</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">"Done shutting down app #{options['appname']}"</span>
|
486
|
+
<span class="ruby-keyword">end</span></pre>
|
487
|
+
</div><!-- remove_app-source -->
|
488
|
+
|
489
|
+
</div>
|
490
|
+
|
491
|
+
|
492
|
+
|
493
|
+
|
494
|
+
</div><!-- remove_app-method -->
|
495
|
+
|
496
|
+
|
497
|
+
<div id="method-c-reset_password" class="method-detail ">
|
498
|
+
|
499
|
+
<div class="method-heading">
|
500
|
+
<span class="method-name">reset_password</span><span
|
501
|
+
class="method-args">(options)</span>
|
502
|
+
<span class="method-click-advice">click to toggle source</span>
|
503
|
+
</div>
|
504
|
+
|
505
|
+
|
506
|
+
<div class="method-description">
|
507
|
+
|
508
|
+
|
509
|
+
|
510
|
+
|
511
|
+
|
512
|
+
<div class="method-source-code" id="reset_password-source">
|
513
|
+
<pre><span class="ruby-comment"># File lib/appscale_tools.rb, line 246</span>
|
514
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">reset_password</span>(<span class="ruby-identifier">options</span>)
|
515
|
+
<span class="ruby-identifier">keyname</span> = <span class="ruby-identifier">options</span>[<span class="ruby-string">'keyname'</span>]
|
516
|
+
<span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">update_locations_file</span>(<span class="ruby-identifier">keyname</span>)
|
517
|
+
<span class="ruby-identifier">secret</span> = <span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">get_secret_key</span>(<span class="ruby-identifier">keyname</span>)
|
518
|
+
|
519
|
+
<span class="ruby-identifier">head_node_ip</span> = <span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">get_load_balancer_ip</span>(<span class="ruby-identifier">keyname</span>)
|
520
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">head_node_ip</span>.<span class="ruby-identifier">empty?</span>
|
521
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">BadConfigurationException</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">APPSCALE_NOT_RUNNING</span>)
|
522
|
+
<span class="ruby-keyword">end</span>
|
523
|
+
|
524
|
+
<span class="ruby-identifier">user</span> = <span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">get_email</span>
|
525
|
+
<span class="ruby-identifier">pass</span> = <span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">get_password</span>
|
526
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-string">"\n"</span>
|
527
|
+
<span class="ruby-identifier">encrypted_pass</span> = <span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">encrypt_password</span>(<span class="ruby-identifier">user</span>, <span class="ruby-identifier">pass</span>)
|
528
|
+
|
529
|
+
<span class="ruby-identifier">acc</span> = <span class="ruby-constant">AppControllerClient</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">head_node_ip</span>, <span class="ruby-identifier">secret</span>)
|
530
|
+
<span class="ruby-identifier">userappserver_ip</span> = <span class="ruby-identifier">acc</span>.<span class="ruby-identifier">get_userappserver_ip</span>
|
531
|
+
|
532
|
+
<span class="ruby-identifier">uac</span> = <span class="ruby-constant">UserAppClient</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">userappserver_ip</span>, <span class="ruby-identifier">secret</span>)
|
533
|
+
<span class="ruby-identifier">uac</span>.<span class="ruby-identifier">change_password</span>(<span class="ruby-identifier">user</span>, <span class="ruby-identifier">encrypted_pass</span>)
|
534
|
+
<span class="ruby-keyword">end</span></pre>
|
535
|
+
</div><!-- reset_password-source -->
|
536
|
+
|
537
|
+
</div>
|
538
|
+
|
539
|
+
|
540
|
+
|
541
|
+
|
542
|
+
</div><!-- reset_password-method -->
|
543
|
+
|
544
|
+
|
545
|
+
<div id="method-c-run_instances" class="method-detail ">
|
546
|
+
|
547
|
+
<div class="method-heading">
|
548
|
+
<span class="method-name">run_instances</span><span
|
549
|
+
class="method-args">(options)</span>
|
550
|
+
<span class="method-click-advice">click to toggle source</span>
|
551
|
+
</div>
|
552
|
+
|
553
|
+
|
554
|
+
<div class="method-description">
|
555
|
+
|
556
|
+
|
557
|
+
|
558
|
+
|
559
|
+
|
560
|
+
<div class="method-source-code" id="run_instances-source">
|
561
|
+
<pre><span class="ruby-comment"># File lib/appscale_tools.rb, line 269</span>
|
562
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">run_instances</span>(<span class="ruby-identifier">options</span>)
|
563
|
+
<span class="ruby-identifier">infrastructure</span> = <span class="ruby-identifier">options</span>[<span class="ruby-string">'infrastructure'</span>]
|
564
|
+
<span class="ruby-identifier">instance_type</span> = <span class="ruby-identifier">options</span>[<span class="ruby-string">'instance_type'</span>]
|
565
|
+
<span class="ruby-identifier">machine</span> = <span class="ruby-identifier">options</span>[<span class="ruby-string">'machine'</span>]
|
566
|
+
<span class="ruby-identifier">max_images</span> = <span class="ruby-identifier">options</span>[<span class="ruby-string">'max_images'</span>]
|
567
|
+
<span class="ruby-identifier">table</span> = <span class="ruby-identifier">options</span>[<span class="ruby-string">'table'</span>]
|
568
|
+
|
569
|
+
<span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">make_appscale_directory</span>()
|
570
|
+
<span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">validate_run_instances_options</span>(<span class="ruby-identifier">options</span>)
|
571
|
+
<span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">print_starting_message</span>(<span class="ruby-identifier">infrastructure</span>, <span class="ruby-identifier">instance_type</span>)
|
572
|
+
<span class="ruby-constant">RemoteLogging</span>.<span class="ruby-identifier">remote_post</span>(<span class="ruby-identifier">max_images</span>, <span class="ruby-identifier">table</span>, <span class="ruby-identifier">infrastructure</span>, <span class="ruby-string">"starting"</span>, <span class="ruby-string">"unknown"</span>)
|
573
|
+
<span class="ruby-identifier">sleep</span>(<span class="ruby-value">2</span>)
|
574
|
+
|
575
|
+
<span class="ruby-identifier">apps_to_start</span>, <span class="ruby-identifier">app_info</span> = <span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">get_app_info_from_options</span>(<span class="ruby-identifier">options</span>)
|
576
|
+
<span class="ruby-identifier">node_layout</span>, <span class="ruby-identifier">result</span> = <span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">generate_node_layout</span>(<span class="ruby-identifier">options</span>)
|
577
|
+
<span class="ruby-identifier">head_node_result</span> = <span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">start_head_node</span>(<span class="ruby-identifier">options</span>, <span class="ruby-identifier">node_layout</span>,
|
578
|
+
<span class="ruby-identifier">apps_to_start</span>)
|
579
|
+
|
580
|
+
<span class="ruby-identifier">print</span> <span class="ruby-string">"\nPlease wait for AppScale to prepare your machines for use."</span>
|
581
|
+
<span class="ruby-constant">STDOUT</span>.<span class="ruby-identifier">flush</span>
|
582
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-string">"\n"</span>
|
583
|
+
|
584
|
+
<span class="ruby-identifier">acc</span> = <span class="ruby-identifier">head_node_result</span>[<span class="ruby-value">:acc</span>]
|
585
|
+
<span class="ruby-identifier">secret_key</span> = <span class="ruby-identifier">head_node_result</span>[<span class="ruby-value">:secret_key</span>]
|
586
|
+
<span class="ruby-identifier">head_node_ip</span> = <span class="ruby-identifier">head_node_result</span>[<span class="ruby-value">:head_node_ip</span>]
|
587
|
+
<span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">write_and_copy_node_file</span>(<span class="ruby-identifier">options</span>, <span class="ruby-identifier">node_layout</span>,
|
588
|
+
<span class="ruby-identifier">head_node_result</span>)
|
589
|
+
|
590
|
+
<span class="ruby-identifier">userappserver_ip</span> = <span class="ruby-identifier">acc</span>.<span class="ruby-identifier">get_userappserver_ip</span>(<span class="ruby-constant">LOGS_VERBOSE</span>)
|
591
|
+
<span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">update_locations_file</span>(<span class="ruby-identifier">options</span>[<span class="ruby-string">'keyname'</span>], [<span class="ruby-identifier">head_node_ip</span>])
|
592
|
+
<span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">verbose</span>(<span class="ruby-node">"Run instances: UserAppServer is at #{userappserver_ip}"</span>, <span class="ruby-identifier">options</span>[<span class="ruby-string">'verbose'</span>])
|
593
|
+
<span class="ruby-identifier">uac</span> = <span class="ruby-constant">UserAppClient</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">userappserver_ip</span>, <span class="ruby-identifier">secret_key</span>)
|
594
|
+
<span class="ruby-identifier">user</span>, <span class="ruby-identifier">pass</span> = <span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">get_credentials</span>(<span class="ruby-identifier">options</span>[<span class="ruby-string">'test'</span>])
|
595
|
+
<span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">create_user</span>(<span class="ruby-identifier">user</span>, <span class="ruby-identifier">options</span>[<span class="ruby-string">'test'</span>], <span class="ruby-identifier">head_node_ip</span>,
|
596
|
+
<span class="ruby-identifier">secret_key</span>, <span class="ruby-identifier">uac</span>, <span class="ruby-identifier">pass</span>)
|
597
|
+
|
598
|
+
<span class="ruby-identifier">uac</span>.<span class="ruby-identifier">set_cloud_admin_status</span>(<span class="ruby-identifier">user</span>, <span class="ruby-identifier">new_status</span>=<span class="ruby-string">"true"</span>)
|
599
|
+
<span class="ruby-identifier">uac</span>.<span class="ruby-identifier">set_cloud_admin_capabilities</span>(<span class="ruby-identifier">user</span>)
|
600
|
+
|
601
|
+
<span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">wait_for_nodes_to_load</span>(<span class="ruby-identifier">head_node_ip</span>, <span class="ruby-identifier">secret_key</span>)
|
602
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-string">'file_location'</span>].<span class="ruby-identifier">nil?</span>
|
603
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-string">"No app uploaded. Use appscale-upload-app to upload an app later."</span>
|
604
|
+
<span class="ruby-keyword">else</span>
|
605
|
+
<span class="ruby-identifier">remote_file_path</span> = <span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">scp_app_to_ip</span>(<span class="ruby-identifier">app_info</span>[<span class="ruby-value">:app_name</span>],
|
606
|
+
<span class="ruby-identifier">user</span>, <span class="ruby-identifier">app_info</span>[<span class="ruby-value">:language</span>], <span class="ruby-identifier">options</span>[<span class="ruby-string">'keyname'</span>], <span class="ruby-identifier">head_node_ip</span>,
|
607
|
+
<span class="ruby-identifier">app_info</span>[<span class="ruby-value">:file</span>], <span class="ruby-identifier">uac</span>)
|
608
|
+
|
609
|
+
<span class="ruby-identifier">acc</span>.<span class="ruby-identifier">done_uploading</span>(<span class="ruby-identifier">app_info</span>[<span class="ruby-value">:app_name</span>], <span class="ruby-identifier">remote_file_path</span>)
|
610
|
+
|
611
|
+
<span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">wait_for_app_to_start</span>(<span class="ruby-identifier">head_node_ip</span>, <span class="ruby-identifier">secret_key</span>,
|
612
|
+
<span class="ruby-identifier">app_info</span>[<span class="ruby-value">:app_name</span>])
|
613
|
+
<span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">clear_app</span>(<span class="ruby-identifier">app_info</span>[<span class="ruby-value">:file</span>])
|
614
|
+
<span class="ruby-keyword">end</span>
|
615
|
+
|
616
|
+
<span class="ruby-identifier">login_ip</span> = <span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">get_login_ip</span>(<span class="ruby-identifier">head_node_ip</span>, <span class="ruby-identifier">secret_key</span>)
|
617
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-string">"The status of your AppScale instance is at the following"</span> <span class="ruby-operator">+</span>
|
618
|
+
<span class="ruby-node">" URL: http://#{login_ip}/status"</span>
|
619
|
+
|
620
|
+
<span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">write_and_copy_node_file</span>(<span class="ruby-identifier">options</span>, <span class="ruby-identifier">node_layout</span>,
|
621
|
+
<span class="ruby-identifier">head_node_result</span>)
|
622
|
+
<span class="ruby-constant">RemoteLogging</span>.<span class="ruby-identifier">remote_post</span>(<span class="ruby-identifier">max_images</span>, <span class="ruby-identifier">table</span>, <span class="ruby-identifier">infrastructure</span>, <span class="ruby-string">"started"</span>, <span class="ruby-string">"success"</span>)
|
623
|
+
<span class="ruby-keyword">end</span></pre>
|
624
|
+
</div><!-- run_instances-source -->
|
625
|
+
|
626
|
+
</div>
|
627
|
+
|
628
|
+
|
629
|
+
|
630
|
+
|
631
|
+
</div><!-- run_instances-method -->
|
632
|
+
|
633
|
+
|
634
|
+
<div id="method-c-terminate_instances" class="method-detail ">
|
635
|
+
|
636
|
+
<div class="method-heading">
|
637
|
+
<span class="method-name">terminate_instances</span><span
|
638
|
+
class="method-args">(options)</span>
|
639
|
+
<span class="method-click-advice">click to toggle source</span>
|
640
|
+
</div>
|
641
|
+
|
642
|
+
|
643
|
+
<div class="method-description">
|
644
|
+
|
645
|
+
|
646
|
+
|
647
|
+
|
648
|
+
|
649
|
+
<div class="method-source-code" id="terminate_instances-source">
|
650
|
+
<pre><span class="ruby-comment"># File lib/appscale_tools.rb, line 333</span>
|
651
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">terminate_instances</span>(<span class="ruby-identifier">options</span>)
|
652
|
+
<span class="ruby-identifier">keyname</span> = <span class="ruby-identifier">options</span>[<span class="ruby-string">'keyname'</span>]
|
653
|
+
<span class="ruby-identifier">locations_yaml</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-node">"~/.appscale/locations-#{keyname}.yaml"</span>)
|
654
|
+
<span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-identifier">locations_yaml</span>)
|
655
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">AppScaleException</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">APPSCALE_NOT_RUNNING</span>)
|
656
|
+
<span class="ruby-keyword">end</span>
|
657
|
+
|
658
|
+
<span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">update_locations_file</span>(<span class="ruby-identifier">keyname</span>)
|
659
|
+
<span class="ruby-identifier">shadow_ip</span> = <span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">get_head_node_ip</span>(<span class="ruby-identifier">keyname</span>)
|
660
|
+
<span class="ruby-identifier">secret</span> = <span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">get_secret_key</span>(<span class="ruby-identifier">keyname</span>)
|
661
|
+
|
662
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-string">'backup_neptune_info'</span>]
|
663
|
+
<span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">backup_neptune_info</span>(<span class="ruby-identifier">keyname</span>, <span class="ruby-identifier">shadow_ip</span>,
|
664
|
+
<span class="ruby-identifier">options</span>[<span class="ruby-string">'backup_neptune_info'</span>])
|
665
|
+
<span class="ruby-keyword">end</span>
|
666
|
+
|
667
|
+
<span class="ruby-identifier">infrastructure</span> = <span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">get_infrastructure</span>(<span class="ruby-identifier">keyname</span>, <span class="ruby-identifier">required</span>=<span class="ruby-keyword">true</span>)
|
668
|
+
<span class="ruby-keyword">if</span> <span class="ruby-constant">VALID_CLOUD_TYPES</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">infrastructure</span>)
|
669
|
+
<span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">terminate_via_infrastructure</span>(<span class="ruby-identifier">infrastructure</span>, <span class="ruby-identifier">keyname</span>, <span class="ruby-identifier">shadow_ip</span>, <span class="ruby-identifier">secret</span>)
|
670
|
+
<span class="ruby-keyword">else</span>
|
671
|
+
<span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">terminate_via_vmm</span>(<span class="ruby-identifier">keyname</span>, <span class="ruby-identifier">options</span>[<span class="ruby-string">'verbose'</span>])
|
672
|
+
<span class="ruby-keyword">end</span>
|
673
|
+
|
674
|
+
<span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">delete_appscale_files</span>(<span class="ruby-identifier">keyname</span>)
|
675
|
+
<span class="ruby-keyword">end</span></pre>
|
676
|
+
</div><!-- terminate_instances-source -->
|
677
|
+
|
678
|
+
</div>
|
679
|
+
|
680
|
+
|
681
|
+
|
682
|
+
|
683
|
+
</div><!-- terminate_instances-method -->
|
684
|
+
|
685
|
+
|
686
|
+
<div id="method-c-upload_app" class="method-detail ">
|
687
|
+
|
688
|
+
<div class="method-heading">
|
689
|
+
<span class="method-name">upload_app</span><span
|
690
|
+
class="method-args">(options)</span>
|
691
|
+
<span class="method-click-advice">click to toggle source</span>
|
692
|
+
</div>
|
693
|
+
|
694
|
+
|
695
|
+
<div class="method-description">
|
696
|
+
|
697
|
+
|
698
|
+
|
699
|
+
|
700
|
+
|
701
|
+
<div class="method-source-code" id="upload_app-source">
|
702
|
+
<pre><span class="ruby-comment"># File lib/appscale_tools.rb, line 360</span>
|
703
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">upload_app</span>(<span class="ruby-identifier">options</span>)
|
704
|
+
<span class="ruby-identifier">file_location</span> = <span class="ruby-identifier">options</span>[<span class="ruby-string">'file_location'</span>]
|
705
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">file_location</span>.<span class="ruby-identifier">nil?</span>
|
706
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">AppScaleException</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">NO_FILE_PROVIDED_MSG</span>)
|
707
|
+
<span class="ruby-keyword">end</span>
|
708
|
+
|
709
|
+
<span class="ruby-identifier">keyname</span> = <span class="ruby-identifier">options</span>[<span class="ruby-string">'keyname'</span>]
|
710
|
+
<span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">update_locations_file</span>(<span class="ruby-identifier">keyname</span>)
|
711
|
+
<span class="ruby-identifier">secret_key</span> = <span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">get_secret_key</span>(<span class="ruby-identifier">keyname</span>)
|
712
|
+
<span class="ruby-identifier">head_node_ip</span> = <span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">get_head_node_ip</span>(<span class="ruby-identifier">keyname</span>)
|
713
|
+
<span class="ruby-identifier">database</span> = <span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">get_table</span>(<span class="ruby-identifier">keyname</span>)
|
714
|
+
|
715
|
+
<span class="ruby-identifier">app_info</span> = <span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">get_app_name_from_tar</span>(<span class="ruby-identifier">file_location</span>)
|
716
|
+
<span class="ruby-identifier">app_name</span>, <span class="ruby-identifier">file_location</span>, <span class="ruby-identifier">language</span> = <span class="ruby-identifier">app_info</span>[<span class="ruby-value">:app_name</span>], <span class="ruby-identifier">app_info</span>[<span class="ruby-value">:file</span>], <span class="ruby-identifier">app_info</span>[<span class="ruby-value">:language</span>]
|
717
|
+
<span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">validate_app_name</span>(<span class="ruby-identifier">app_name</span>, <span class="ruby-identifier">database</span>)
|
718
|
+
|
719
|
+
<span class="ruby-identifier">acc</span> = <span class="ruby-constant">AppControllerClient</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">head_node_ip</span>, <span class="ruby-identifier">secret_key</span>)
|
720
|
+
<span class="ruby-identifier">user</span> = <span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">get_username_from_options</span>(<span class="ruby-identifier">options</span>)
|
721
|
+
<span class="ruby-identifier">userappserver_ip</span> = <span class="ruby-identifier">acc</span>.<span class="ruby-identifier">get_userappserver_ip</span>(<span class="ruby-constant">LOGS_VERBOSE</span>)
|
722
|
+
<span class="ruby-identifier">uac</span> = <span class="ruby-constant">UserAppClient</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">userappserver_ip</span>, <span class="ruby-identifier">secret_key</span>)
|
723
|
+
<span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">uac</span>.<span class="ruby-identifier">does_user_exist?</span>(<span class="ruby-identifier">user</span>)
|
724
|
+
<span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">create_user</span>(<span class="ruby-identifier">user</span>, <span class="ruby-identifier">options</span>[<span class="ruby-string">'test'</span>], <span class="ruby-identifier">head_node_ip</span>,
|
725
|
+
<span class="ruby-identifier">secret_key</span>, <span class="ruby-identifier">uac</span>)
|
726
|
+
<span class="ruby-keyword">end</span>
|
727
|
+
|
728
|
+
<span class="ruby-constant">Kernel</span>.<span class="ruby-identifier">puts</span> <span class="ruby-string">""</span>
|
729
|
+
|
730
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">uac</span>.<span class="ruby-identifier">does_app_exist?</span>(<span class="ruby-identifier">app_name</span>)
|
731
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">AppScaleException</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">APP_ALREADY_EXISTS</span>)
|
732
|
+
<span class="ruby-keyword">end</span>
|
733
|
+
|
734
|
+
<span class="ruby-identifier">app_admin</span> = <span class="ruby-identifier">uac</span>.<span class="ruby-identifier">get_app_admin</span>(<span class="ruby-identifier">app_name</span>)
|
735
|
+
<span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">app_admin</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">user</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">app_admin</span>
|
736
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">AppScaleException</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">USER_NOT_ADMIN</span>)
|
737
|
+
<span class="ruby-keyword">end</span>
|
738
|
+
|
739
|
+
<span class="ruby-identifier">remote_file_path</span> = <span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">scp_app_to_ip</span>(<span class="ruby-identifier">app_name</span>, <span class="ruby-identifier">user</span>, <span class="ruby-identifier">language</span>,
|
740
|
+
<span class="ruby-identifier">keyname</span>, <span class="ruby-identifier">head_node_ip</span>, <span class="ruby-identifier">file_location</span>, <span class="ruby-identifier">uac</span>)
|
741
|
+
<span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">update_appcontroller</span>(<span class="ruby-identifier">head_node_ip</span>, <span class="ruby-identifier">secret_key</span>, <span class="ruby-identifier">app_name</span>,
|
742
|
+
<span class="ruby-identifier">remote_file_path</span>)
|
743
|
+
<span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">wait_for_app_to_start</span>(<span class="ruby-identifier">head_node_ip</span>, <span class="ruby-identifier">secret_key</span>, <span class="ruby-identifier">app_name</span>)
|
744
|
+
<span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">clear_app</span>(<span class="ruby-identifier">file_location</span>)
|
745
|
+
<span class="ruby-keyword">end</span></pre>
|
746
|
+
</div><!-- upload_app-source -->
|
747
|
+
|
748
|
+
</div>
|
749
|
+
|
750
|
+
|
751
|
+
|
752
|
+
|
753
|
+
</div><!-- upload_app-method -->
|
754
|
+
|
755
|
+
|
756
|
+
</section><!-- public-class-method-details -->
|
757
|
+
|
758
|
+
</section><!-- 5Buntitled-5D -->
|
759
|
+
|
760
|
+
</div><!-- documentation -->
|
761
|
+
|
762
|
+
|
763
|
+
<footer id="validator-badges">
|
764
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
765
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
|
766
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
767
|
+
</footer>
|
768
|
+
|