polytrix 0.0.1 → 0.1.0.pre
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +2 -2
- data/.rspec +1 -6
- data/.rubocop-todo.yml +19 -0
- data/.rubocop.yml +10 -0
- data/.travis.yml +11 -0
- data/Gemfile +0 -16
- data/README.md +119 -28
- data/Rakefile +18 -123
- data/bin/polytrix +5 -0
- data/doc-src/_markdown.md +5 -0
- data/doc-src/default_bootstrap.md +13 -0
- data/docs/influences.md +28 -0
- data/docs/samples/code2doc/java/HelloWorld.md +13 -0
- data/docs/samples/code2doc/java/Quine.md +33 -0
- data/docs/samples/code2doc/python/hello_world.md +3 -0
- data/docs/samples/code2doc/python/quine.md +4 -0
- data/docs/samples/code2doc/ruby/hello_world.md +7 -0
- data/features/execution.feature +67 -0
- data/features/fixtures/configs/empty.yml +12 -0
- data/features/fixtures/configs/hello_world.yml +10 -0
- data/features/fixtures/spec/polytrix_merge.rb +5 -0
- data/features/fixtures/spec/polytrix_spec.rb +10 -0
- data/features/reporting.feature +140 -0
- data/features/step_definitions/sdk_steps.rb +12 -0
- data/features/support/env.rb +8 -0
- data/lib/polytrix/challenge.rb +20 -7
- data/lib/polytrix/challenge_runner.rb +9 -44
- data/lib/polytrix/cli/add.rb +67 -0
- data/lib/polytrix/cli/report.rb +88 -0
- data/lib/polytrix/cli/reports/hash_reporter.rb +30 -0
- data/lib/polytrix/cli/reports/json_reporter.rb +14 -0
- data/lib/polytrix/cli/reports/markdown_reporter.rb +23 -0
- data/lib/polytrix/cli/reports/yaml_reporter.rb +14 -0
- data/lib/polytrix/cli.rb +158 -0
- data/lib/polytrix/configuration.rb +65 -4
- data/lib/polytrix/core/file_system_helper.rb +75 -0
- data/lib/polytrix/core/implementor.rb +31 -3
- data/lib/polytrix/documentation/code_segmenter.rb +168 -0
- data/lib/polytrix/documentation/comment_styles.rb +87 -0
- data/lib/polytrix/documentation/helpers/code_helper.rb +85 -0
- data/lib/polytrix/documentation/view_helper.rb +21 -0
- data/lib/polytrix/documentation_generator.rb +59 -10
- data/lib/polytrix/executor.rb +89 -0
- data/lib/polytrix/logger.rb +17 -0
- data/lib/polytrix/manifest.rb +64 -7
- data/lib/polytrix/result.rb +16 -2
- data/lib/polytrix/rspec/documentation_formatter.rb +41 -16
- data/lib/polytrix/rspec/yaml_report.rb +51 -0
- data/lib/polytrix/rspec.rb +32 -53
- data/lib/polytrix/runners/middleware/feature_executor.rb +4 -3
- data/lib/polytrix/runners/middleware/setup_env_vars.rb +6 -4
- data/lib/polytrix/validation.rb +20 -0
- data/lib/polytrix/validations.rb +23 -0
- data/lib/polytrix/validator.rb +20 -0
- data/lib/polytrix/validator_registry.rb +34 -0
- data/lib/polytrix/version.rb +1 -1
- data/lib/polytrix.rb +125 -22
- data/polytrix.gemspec +7 -2
- data/polytrix.rb +6 -0
- data/polytrix_tests.yml +20 -0
- data/resources/code_sample.tt +2 -0
- data/samples/.gitignore +2 -0
- data/samples/_markdown.md +5 -0
- data/samples/default_bootstrap.rb +14 -0
- data/samples/polytrix.rb +28 -0
- data/samples/polytrix_cli.sh +7 -0
- data/samples/polytrix_tests.yml +10 -0
- data/{sdks/fog → samples}/scripts/bootstrap +0 -2
- data/samples/scripts/wrapper +7 -0
- data/samples/sdks/custom/polytrix.yml +2 -0
- data/samples/sdks/java/.gitignore +2 -0
- data/samples/sdks/java/build.gradle +14 -0
- data/samples/sdks/java/challenges/HelloWorld.java +10 -0
- data/samples/sdks/java/challenges/Quine.java +31 -0
- data/samples/sdks/java/code_sample.tt +11 -0
- data/samples/sdks/java/scripts/bootstrap +2 -0
- data/samples/sdks/java/scripts/wrapper +8 -0
- data/samples/sdks/python/challenges/hello_world.py +2 -0
- data/samples/sdks/python/challenges/quine.py +2 -0
- data/{sdks/pkgcloud → samples/sdks/python}/scripts/wrapper +1 -1
- data/samples/sdks/ruby/challenges/hello_world.rb +4 -0
- data/scripts/bootstrap +1 -9
- data/scripts/wrapper +7 -0
- data/spec/fabricators/challenge_fabricator.rb +17 -0
- data/spec/fabricators/manifest_fabricator.rb +50 -0
- data/spec/fabricators/validator_fabricator.rb +12 -0
- data/spec/fixtures/{polytrix.yml → polytrix_tests.yml} +0 -0
- data/spec/fixtures/src-doc/_scenario.md.erb +1 -0
- data/spec/polytrix/challenge_runner_spec.rb +3 -3
- data/spec/polytrix/challenge_spec.rb +3 -4
- data/spec/polytrix/cli_spec.rb +39 -0
- data/spec/polytrix/configuration_spec.rb +45 -1
- data/spec/polytrix/documentation/helpers/code_helper_spec.rb +120 -0
- data/spec/polytrix/documentation_generator_spec.rb +41 -20
- data/spec/polytrix/file_finder_spec.rb +4 -3
- data/spec/polytrix/implementor_spec.rb +33 -0
- data/spec/polytrix/manifest_spec.rb +32 -14
- data/spec/polytrix/middleware/feature_executor_spec.rb +1 -1
- data/spec/polytrix/result_spec.rb +49 -0
- data/spec/polytrix/validations_spec.rb +16 -0
- data/spec/polytrix/validator_registry_spec.rb +39 -0
- data/spec/polytrix/validator_spec.rb +63 -0
- data/spec/polytrix_spec.rb +33 -7
- data/spec/spec_helper.rb +14 -1
- data/spec/thor_spy.rb +64 -0
- metadata +177 -160
- data/.rspec_parallel +0 -10
- data/Vagrantfile +0 -41
- data/features/0_identity_spec.rb +0 -40
- data/features/1_cloud_files_spec.rb +0 -48
- data/features/2_servers_spec.rb +0 -19
- data/features/features_helper.rb +0 -46
- data/features/helpers/cloudfiles_helper.rb +0 -31
- data/features/helpers/pacto_helper.rb +0 -33
- data/features/helpers/teardown_helper.rb +0 -49
- data/features/pacto/extensions/loaders/api_blueprint_loader.rb +0 -63
- data/features/pacto/extensions/loaders/simple_loader.rb +0 -55
- data/features/pacto/extensions/loaders/yaml_or_json_loader.rb +0 -17
- data/features/pacto/extensions/matchers.rb +0 -38
- data/features/phase2/feature_coverage_report.rb +0 -109
- data/features/phase2/run_all_features.rb +0 -14
- data/features/static_site/fixtures/index.html +0 -6
- data/lib/polytrix/challenge_builder.rb +0 -16
- data/lib/polytrix/core/file_finder.rb +0 -43
- data/lib/polytrix/core/result_tracker.rb +0 -25
- data/lib/polytrix/runners/middleware/pacto.rb +0 -59
- data/packer/.gitignore +0 -3
- data/packer/Berksfile +0 -15
- data/packer/Gemfile +0 -5
- data/packer/Vagrantfile +0 -128
- data/packer/cookbooks/drg/metadata.rb +0 -27
- data/packer/cookbooks/drg/recipes/admins.rb +0 -22
- data/packer/cookbooks/drg/recipes/default.rb +0 -9
- data/packer/cookbooks/drg/recipes/dotnet.rb +0 -4
- data/packer/cookbooks/drg/recipes/golang.rb +0 -4
- data/packer/cookbooks/drg/recipes/java.rb +0 -5
- data/packer/cookbooks/drg/recipes/php.rb +0 -10
- data/packer/cookbooks/drg/recipes/ruby.rb +0 -29
- data/packer/cookbooks/drg/recipes/system.rb +0 -13
- data/packer/create_box.sh +0 -10
- data/packer/http/preseed.cfg +0 -87
- data/packer/packer.json +0 -91
- data/packer/scripts/root_setup.sh +0 -37
- data/packer/scripts/setup.sh +0 -32
- data/pacto/config/pacto_server.rb +0 -40
- data/pacto/contracts/dfw.servers.api.rackspacecloud.com/v2/account_id/extensions.json +0 -64
- data/pacto/contracts/dfw.servers.api.rackspacecloud.com/v2/account_id/flavors/id.json +0 -100
- data/pacto/contracts/dfw.servers.api.rackspacecloud.com/v2/account_id/images/id.json +0 -176
- data/pacto/contracts/dfw.servers.api.rackspacecloud.com/v2/account_id/servers/id.json +0 -189
- data/pacto/contracts/dfw.servers.api.rackspacecloud.com/v2/account_id/servers.json +0 -63
- data/pacto/contracts/dns.api.rackspacecloud.com/v1.0/_tenant_id/domains.json +0 -62
- data/pacto/contracts/identity.api.rackspacecloud.com/v2.0/tokens.json +0 -192
- data/pacto/contracts/monitoring.api.rackspacecloud.com/v1.0/_tenant_id/account.json +0 -39
- data/pacto/contracts/ord.autoscale.api.rackspacecloud.com/v1.0/_tenant_id/groups.json +0 -38
- data/pacto/contracts/ord.blockstorage.api.rackspacecloud.com/v1/_tenant_id/volumes.json +0 -30
- data/pacto/contracts/ord.databases.api.rackspacecloud.com/v1.0/_tenant_id/instances.json +0 -30
- data/pacto/contracts/ord.loadbalancers.api.rackspacecloud.com/v1.0/_tenant_id/loadbalancers.json +0 -114
- data/pacto/contracts/ord.queues.api.rackspacecloud.com/v1/_tenant_id/queues.json +0 -13
- data/pacto/contracts/ord.servers.api.rackspacecloud.com/v2/_tenant_id/os-networksv2.json +0 -46
- data/pacto/contracts/ord.servers.api.rackspacecloud.com/v2/_tenant_id/servers/detail.json +0 -230
- data/pacto/contracts/storage101.dfw1.clouddrive.com/v1/mosso_account/container/object.json +0 -15
- data/pacto/contracts/storage101.dfw1.clouddrive.com/v1/mosso_account.json +0 -43
- data/pacto/contracts/storage101.ord1.clouddrive.com/v1/_mosso_id.json +0 -44
- data/pacto/pacto_server.rb +0 -100
- data/pacto/rackspace_uri_map.yaml +0 -229
- data/scripts/cibuild +0 -4
- data/sdks/fog/.gitignore +0 -1
- data/sdks/fog/Gemfile +0 -5
- data/sdks/fog/challenges/all_connections.rb +0 -45
- data/sdks/fog/challenges/authenticate_token.rb +0 -15
- data/sdks/fog/challenges/cdn_enable_container.rb +0 -20
- data/sdks/fog/challenges/create_a_container.rb +0 -17
- data/sdks/fog/challenges/create_server.rb +0 -36
- data/sdks/fog/challenges/get_object_metadata.rb +0 -13
- data/sdks/fog/challenges/list_containers.rb +0 -10
- data/sdks/fog/challenges/provision_scalable_webapp.rb +0 -30
- data/sdks/fog/challenges/upload_folder.rb +0 -25
- data/sdks/fog/scripts/bootstrap.ps1 +0 -1
- data/sdks/fog/scripts/wrapper +0 -2
- data/sdks/fog/scripts/wrapper.ps1 +0 -1
- data/sdks/gophercloud/.gitignore +0 -2
- data/sdks/gophercloud/challenges/authenticate_token.go +0 -23
- data/sdks/gophercloud/scripts/bootstrap +0 -6
- data/sdks/gophercloud/scripts/wrapper +0 -10
- data/sdks/jclouds/.gitignore +0 -1
- data/sdks/jclouds/challenges/AuthenticateToken.java +0 -115
- data/sdks/jclouds/pom.xml +0 -34
- data/sdks/jclouds/scripts/bootstrap +0 -3
- data/sdks/jclouds/scripts/wrapper +0 -7
- data/sdks/openstack.net/.gitignore +0 -4
- data/sdks/openstack.net/.nuget/Microsoft.Build.dll +0 -0
- data/sdks/openstack.net/.nuget/NuGet.Config +0 -6
- data/sdks/openstack.net/.nuget/NuGet.exe +0 -0
- data/sdks/openstack.net/.nuget/NuGet.targets +0 -136
- data/sdks/openstack.net/Challenge.cs +0 -10
- data/sdks/openstack.net/RunChallenge.cs +0 -19
- data/sdks/openstack.net/challenges/AuthenticateToken.cs +0 -24
- data/sdks/openstack.net/challenges/Weird.cs +0 -133
- data/sdks/openstack.net/openstack.net.csproj +0 -58
- data/sdks/openstack.net/openstack.net.sln +0 -27
- data/sdks/openstack.net/openstack.net.userprefs +0 -8
- data/sdks/openstack.net/packages.config +0 -6
- data/sdks/openstack.net/scripts/bootstrap +0 -2
- data/sdks/openstack.net/scripts/bootstrap.ps1 +0 -2
- data/sdks/openstack.net/scripts/wrapper +0 -7
- data/sdks/openstack.net/scripts/wrapper.ps1 +0 -1
- data/sdks/php-opencloud/.gitignore +0 -4
- data/sdks/php-opencloud/challenges/all_connections.php +0 -64
- data/sdks/php-opencloud/challenges/authenticate_token.php +0 -14
- data/sdks/php-opencloud/challenges/create_server.php +0 -39
- data/sdks/php-opencloud/challenges/get_object_metadata.php +0 -19
- data/sdks/php-opencloud/composer.json +0 -5
- data/sdks/php-opencloud/scripts/bootstrap +0 -4
- data/sdks/php-opencloud/scripts/bootstrap.ps1 +0 -2
- data/sdks/php-opencloud/scripts/wrapper +0 -2
- data/sdks/php-opencloud/scripts/wrapper.ps1 +0 -1
- data/sdks/pkgcloud/.gitignore +0 -1
- data/sdks/pkgcloud/challenges/authenticate_token.js +0 -17
- data/sdks/pkgcloud/challenges/get_object_metadata.js +0 -18
- data/sdks/pkgcloud/scripts/bootstrap +0 -2
- data/sdks/pkgcloud/scripts/bootstrap.ps1 +0 -1
- data/sdks/pkgcloud/scripts/wrapper.ps1 +0 -1
- data/sdks/pyrax/.gitignore +0 -2
- data/sdks/pyrax/challenges/all_connections.py +0 -61
- data/sdks/pyrax/challenges/authenticate_token.py +0 -17
- data/sdks/pyrax/challenges/cdn_enable_container.py +0 -22
- data/sdks/pyrax/challenges/create_a_container.py +0 -21
- data/sdks/pyrax/challenges/create_server.py +0 -35
- data/sdks/pyrax/challenges/get_object_metadata.py +0 -17
- data/sdks/pyrax/challenges/upload_folder.py +0 -32
- data/sdks/pyrax/requirements.txt +0 -21
- data/sdks/pyrax/scripts/bootstrap +0 -9
- data/sdks/pyrax/scripts/bootstrap.ps1 +0 -7
- data/sdks/pyrax/scripts/wrapper +0 -3
- data/sdks/pyrax/scripts/wrapper.ps1 +0 -2
- data/spec/polytrix/challenge_builder_spec.rb +0 -16
- data/spec/rspec_spec.rb +0 -17
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
using System;
|
|
2
|
-
using System.IO;
|
|
3
|
-
using System.Text;
|
|
4
|
-
using System.Net;
|
|
5
|
-
using System.Collections;
|
|
6
|
-
using System.Collections.Generic;
|
|
7
|
-
using System.Reflection;
|
|
8
|
-
using net.openstack.Core.Domain;
|
|
9
|
-
using net.openstack.Core.Providers;
|
|
10
|
-
using net.openstack.Providers.Rackspace;
|
|
11
|
-
using net.openstack.Providers.Rackspace.Objects;
|
|
12
|
-
using HttpMethod = JSIStudios.SimpleRESTServices.Client.HttpMethod;
|
|
13
|
-
|
|
14
|
-
namespace openstack.net
|
|
15
|
-
{
|
|
16
|
-
class Weird : Challenge
|
|
17
|
-
{
|
|
18
|
-
public int Run (string[] args)
|
|
19
|
-
{
|
|
20
|
-
var auth_url = new Uri(Environment.GetEnvironmentVariable ("RAX_AUTH_URL"));
|
|
21
|
-
Console.WriteLine ("Connecting to " + auth_url);
|
|
22
|
-
CloudIdentity identity = new RackspaceCloudIdentity {
|
|
23
|
-
Username = Environment.GetEnvironmentVariable("RAX_USERNAME"),
|
|
24
|
-
APIKey = Environment.GetEnvironmentVariable("RAX_API_KEY")
|
|
25
|
-
};
|
|
26
|
-
// IIdentityProvider identityProvider = new CloudIdentityProvider (identity, auth_url);
|
|
27
|
-
IIdentityProvider identityProvider = new CloudIdentityProvider (identity);
|
|
28
|
-
// IObjectStorageProvider provider = new CloudBlockStorageProvider(testIdentity, "dfw", identityProvider, null);
|
|
29
|
-
IObjectStorageProvider provider = new CloudFilesProvider(identityProvider);
|
|
30
|
-
TestProtocolViolation(provider);
|
|
31
|
-
Console.WriteLine ("Testing!");
|
|
32
|
-
return 0;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
public void TestProtocolViolation(IObjectStorageProvider provider)
|
|
36
|
-
{
|
|
37
|
-
try
|
|
38
|
-
{
|
|
39
|
-
TestTempUrlWithSpecialCharactersInObjectName(provider);
|
|
40
|
-
}
|
|
41
|
-
catch (WebException ex)
|
|
42
|
-
{
|
|
43
|
-
/* ServicePoint servicePoint = ServicePointManager.FindServicePoint(ex.Response.ResponseUri);
|
|
44
|
-
FieldInfo table = typeof(ServicePointManager).GetField("s_ServicePointTable", BindingFlags.Static | BindingFlags.NonPublic);
|
|
45
|
-
WeakReference weakReference = (WeakReference)((Hashtable)table.GetValue(null))[servicePoint.Address.GetLeftPart(UriPartial.Authority)];
|
|
46
|
-
if (weakReference != null)
|
|
47
|
-
weakReference.Target = null; */
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
TestTempUrlExpired(provider);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
public void TestTempUrlExpired(IObjectStorageProvider provider)
|
|
54
|
-
{
|
|
55
|
-
string TestContainerPrefix = "sambug";
|
|
56
|
-
|
|
57
|
-
string containerName = TestContainerPrefix + Path.GetRandomFileName();
|
|
58
|
-
string objectName = Path.GetRandomFileName();
|
|
59
|
-
string fileContents = "File contents!";
|
|
60
|
-
|
|
61
|
-
Dictionary<string, string> accountMetadata = provider.GetAccountMetaData();
|
|
62
|
-
string tempUrlKey;
|
|
63
|
-
if (!accountMetadata.TryGetValue("Temp-Url-Key", out tempUrlKey))
|
|
64
|
-
{
|
|
65
|
-
tempUrlKey = Guid.NewGuid().ToString("N");
|
|
66
|
-
accountMetadata = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
|
|
67
|
-
accountMetadata["Temp-Url-Key"] = tempUrlKey;
|
|
68
|
-
provider.UpdateAccountMetadata(accountMetadata);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
ObjectStore result = provider.CreateContainer(containerName);
|
|
72
|
-
|
|
73
|
-
Stream stream = new MemoryStream(Encoding.UTF8.GetBytes(fileContents));
|
|
74
|
-
provider.CreateObject(containerName, stream, objectName);
|
|
75
|
-
|
|
76
|
-
// verify a past time does not work
|
|
77
|
-
try
|
|
78
|
-
{
|
|
79
|
-
DateTimeOffset expirationTime = DateTimeOffset.Now - TimeSpan.FromSeconds(3);
|
|
80
|
-
Uri uri = ((CloudFilesProvider)provider).CreateTemporaryPublicUri(HttpMethod.GET, containerName, objectName, tempUrlKey, expirationTime);
|
|
81
|
-
WebRequest request = HttpWebRequest.Create(uri);
|
|
82
|
-
using (WebResponse response = request.GetResponse())
|
|
83
|
-
{
|
|
84
|
-
Stream cdnStream = response.GetResponseStream();
|
|
85
|
-
StreamReader reader = new StreamReader(cdnStream, Encoding.UTF8);
|
|
86
|
-
string text = reader.ReadToEnd();
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
catch (WebException ex)
|
|
90
|
-
{
|
|
91
|
-
// Assert.AreEqual(HttpStatusCode.Unauthorized, ((HttpWebResponse)ex.Response).StatusCode);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
provider.DeleteContainer(containerName, deleteObjects: true);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
public void TestTempUrlWithSpecialCharactersInObjectName(IObjectStorageProvider provider)
|
|
98
|
-
{
|
|
99
|
-
string TestContainerPrefix = "sambug";
|
|
100
|
-
string containerName = TestContainerPrefix + Path.GetRandomFileName();
|
|
101
|
-
string objectName = "§ /\n\r 你好";
|
|
102
|
-
string fileContents = "File contents!";
|
|
103
|
-
|
|
104
|
-
Dictionary<string, string> accountMetadata = provider.GetAccountMetaData();
|
|
105
|
-
string tempUrlKey;
|
|
106
|
-
if (!accountMetadata.TryGetValue("Temp-Url-Key", out tempUrlKey))
|
|
107
|
-
{
|
|
108
|
-
tempUrlKey = Guid.NewGuid().ToString("N");
|
|
109
|
-
accountMetadata = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
|
|
110
|
-
accountMetadata["Temp-Url-Key"] = tempUrlKey;
|
|
111
|
-
provider.UpdateAccountMetadata(accountMetadata);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
ObjectStore result = provider.CreateContainer(containerName);
|
|
115
|
-
|
|
116
|
-
Stream stream = new MemoryStream(Encoding.UTF8.GetBytes(fileContents));
|
|
117
|
-
provider.CreateObject(containerName, stream, objectName);
|
|
118
|
-
|
|
119
|
-
// verify a future time works
|
|
120
|
-
DateTimeOffset expirationTime = DateTimeOffset.Now + TimeSpan.FromSeconds(10);
|
|
121
|
-
Uri uri = ((CloudFilesProvider)provider).CreateTemporaryPublicUri(HttpMethod.GET, containerName, objectName, tempUrlKey, expirationTime);
|
|
122
|
-
WebRequest request = HttpWebRequest.Create(uri);
|
|
123
|
-
using (WebResponse response = request.GetResponse())
|
|
124
|
-
{
|
|
125
|
-
Stream cdnStream = response.GetResponseStream();
|
|
126
|
-
StreamReader reader = new StreamReader(cdnStream, Encoding.UTF8);
|
|
127
|
-
string text = reader.ReadToEnd();
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
provider.DeleteContainer(containerName, deleteObjects: true);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
3
|
-
<PropertyGroup>
|
|
4
|
-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
|
5
|
-
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
|
6
|
-
<ProductVersion>10.0.0</ProductVersion>
|
|
7
|
-
<SchemaVersion>2.0</SchemaVersion>
|
|
8
|
-
<ProjectGuid>{391B73DA-3906-4A09-9F92-A4196BB00ECF}</ProjectGuid>
|
|
9
|
-
<OutputType>Exe</OutputType>
|
|
10
|
-
<RootNamespace>openstack.net</RootNamespace>
|
|
11
|
-
<AssemblyName>openstack.net</AssemblyName>
|
|
12
|
-
</PropertyGroup>
|
|
13
|
-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
|
14
|
-
<DebugSymbols>true</DebugSymbols>
|
|
15
|
-
<DebugType>full</DebugType>
|
|
16
|
-
<Optimize>false</Optimize>
|
|
17
|
-
<OutputPath>bin\Debug</OutputPath>
|
|
18
|
-
<DefineConstants>DEBUG;</DefineConstants>
|
|
19
|
-
<ErrorReport>prompt</ErrorReport>
|
|
20
|
-
<WarningLevel>4</WarningLevel>
|
|
21
|
-
<Externalconsole>true</Externalconsole>
|
|
22
|
-
<PlatformTarget>x86</PlatformTarget>
|
|
23
|
-
</PropertyGroup>
|
|
24
|
-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
|
25
|
-
<DebugType>full</DebugType>
|
|
26
|
-
<Optimize>true</Optimize>
|
|
27
|
-
<OutputPath>bin\Release</OutputPath>
|
|
28
|
-
<ErrorReport>prompt</ErrorReport>
|
|
29
|
-
<WarningLevel>4</WarningLevel>
|
|
30
|
-
<Externalconsole>true</Externalconsole>
|
|
31
|
-
<PlatformTarget>x86</PlatformTarget>
|
|
32
|
-
</PropertyGroup>
|
|
33
|
-
<ItemGroup>
|
|
34
|
-
<Reference Include="System" />
|
|
35
|
-
<Reference Include="Newtonsoft.Json">
|
|
36
|
-
<HintPath>packages\Newtonsoft.Json.5.0.8\lib\net40\Newtonsoft.Json.dll</HintPath>
|
|
37
|
-
</Reference>
|
|
38
|
-
<Reference Include="SimpleRESTServices">
|
|
39
|
-
<HintPath>packages\SimpleRESTServices.1.3.0.1\lib\net40\SimpleRESTServices.dll</HintPath>
|
|
40
|
-
</Reference>
|
|
41
|
-
<Reference Include="openstacknet">
|
|
42
|
-
<HintPath>packages\openstack.net.1.3.2.1\lib\net40\openstacknet.dll</HintPath>
|
|
43
|
-
</Reference>
|
|
44
|
-
</ItemGroup>
|
|
45
|
-
<ItemGroup>
|
|
46
|
-
<Compile Include="challenges\*.cs" />
|
|
47
|
-
<Compile Include="Challenge.cs" />
|
|
48
|
-
<Compile Include="RunChallenge.cs" />
|
|
49
|
-
</ItemGroup>
|
|
50
|
-
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
|
51
|
-
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
|
52
|
-
<ItemGroup>
|
|
53
|
-
<None Include="packages.config" />
|
|
54
|
-
</ItemGroup>
|
|
55
|
-
<ItemGroup>
|
|
56
|
-
<Folder Include="challenges\" />
|
|
57
|
-
</ItemGroup>
|
|
58
|
-
</Project>
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
Microsoft Visual Studio Solution File, Format Version 11.00
|
|
3
|
-
# Visual Studio 2010
|
|
4
|
-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "openstack.net", "openstack.net.csproj", "{391B73DA-3906-4A09-9F92-A4196BB00ECF}"
|
|
5
|
-
EndProject
|
|
6
|
-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{E9E4006E-EA17-47D4-AC7F-B092E8994661}"
|
|
7
|
-
ProjectSection(SolutionItems) = preProject
|
|
8
|
-
.nuget\NuGet.Config = .nuget\NuGet.Config
|
|
9
|
-
.nuget\NuGet.exe = .nuget\NuGet.exe
|
|
10
|
-
.nuget\NuGet.targets = .nuget\NuGet.targets
|
|
11
|
-
EndProjectSection
|
|
12
|
-
EndProject
|
|
13
|
-
Global
|
|
14
|
-
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
|
15
|
-
Debug|x86 = Debug|x86
|
|
16
|
-
Release|x86 = Release|x86
|
|
17
|
-
EndGlobalSection
|
|
18
|
-
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
|
19
|
-
{391B73DA-3906-4A09-9F92-A4196BB00ECF}.Debug|x86.ActiveCfg = Debug|x86
|
|
20
|
-
{391B73DA-3906-4A09-9F92-A4196BB00ECF}.Debug|x86.Build.0 = Debug|x86
|
|
21
|
-
{391B73DA-3906-4A09-9F92-A4196BB00ECF}.Release|x86.ActiveCfg = Release|x86
|
|
22
|
-
{391B73DA-3906-4A09-9F92-A4196BB00ECF}.Release|x86.Build.0 = Release|x86
|
|
23
|
-
EndGlobalSection
|
|
24
|
-
GlobalSection(MonoDevelopProperties) = preSolution
|
|
25
|
-
StartupItem = openstack.net.csproj
|
|
26
|
-
EndGlobalSection
|
|
27
|
-
EndGlobal
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<Properties>
|
|
2
|
-
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|x86" />
|
|
3
|
-
<MonoDevelop.Ide.Workbench />
|
|
4
|
-
<MonoDevelop.Ide.DebuggingService.Breakpoints>
|
|
5
|
-
<BreakpointStore />
|
|
6
|
-
</MonoDevelop.Ide.DebuggingService.Breakpoints>
|
|
7
|
-
<MonoDevelop.Ide.DebuggingService.PinnedWatches />
|
|
8
|
-
</Properties>
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<packages>
|
|
3
|
-
<package id="Newtonsoft.Json" version="5.0.8" targetFramework="net40" />
|
|
4
|
-
<package id="openstack.net" version="1.3.2.1" targetFramework="net40" />
|
|
5
|
-
<package id="SimpleRESTServices" version="1.3.0.1" targetFramework="net40" />
|
|
6
|
-
</packages>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.\bin\Debug\openstack.net.exe "$args"
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
<?php
|
|
2
|
-
require 'vendor/autoload.php';
|
|
3
|
-
use OpenCloud\Rackspace;
|
|
4
|
-
|
|
5
|
-
$region = getenv('RAX_REGION');
|
|
6
|
-
$endpoint = getenv('RAX_AUTH_URL') . '/v2.0/';
|
|
7
|
-
$credentials = array(
|
|
8
|
-
'username' => getenv('RAX_USERNAME'),
|
|
9
|
-
'apiKey' => getenv('RAX_API_KEY')
|
|
10
|
-
);
|
|
11
|
-
|
|
12
|
-
$rackspace = new Rackspace($endpoint, $credentials);
|
|
13
|
-
$rackspace->Authenticate();
|
|
14
|
-
|
|
15
|
-
$compute = $rackspace->computeService('cloudServersOpenStack', $region);
|
|
16
|
-
$servers = $compute->serverList();
|
|
17
|
-
$networks = $compute->networkList();
|
|
18
|
-
// echo("Servers: ".var_export($servers));
|
|
19
|
-
// echo("Networks: ".var_export($networks));
|
|
20
|
-
|
|
21
|
-
$loadBalancerService = $rackspace->loadBalancerService('cloudLoadBalancers', $region);
|
|
22
|
-
$load_balancers = $loadBalancerService->loadBalancerList();
|
|
23
|
-
// echo("Cloud Load Balancers: ".var_export($load_balancers));
|
|
24
|
-
|
|
25
|
-
$cloudFilesService = $rackspace->objectStoreService('cloudFiles', $region);
|
|
26
|
-
$containers = $cloudFilesService->listContainers();
|
|
27
|
-
// echo("Cloud Files Containers: ".var_export($containers));
|
|
28
|
-
|
|
29
|
-
$databaseService = $rackspace->databaseService('cloudDatabases', $region);
|
|
30
|
-
$databases = $databaseService->instanceList();
|
|
31
|
-
// echo("Cloud Databases: ".var_export($databases));
|
|
32
|
-
|
|
33
|
-
$dnsService = $rackspace->dnsService('cloudDNS', $region);
|
|
34
|
-
$domains = $dnsService->domainList();
|
|
35
|
-
// Can I get zones?
|
|
36
|
-
// echo("Cloud DNS: $zones")
|
|
37
|
-
// echo('Cloud DNS: $domains');
|
|
38
|
-
|
|
39
|
-
$identityService = $rackspace->identityService();
|
|
40
|
-
$users = $identityService->getUsers();
|
|
41
|
-
// echo("Cloud Identity Users: ".var_export($users));
|
|
42
|
-
|
|
43
|
-
$monitoringService = $rackspace->cloudMonitoringService('cloudMonitoring', 'ORD', 'publicURL');
|
|
44
|
-
$checkTypes = $monitoringService->getCheckTypes();
|
|
45
|
-
// Can I get the account info?
|
|
46
|
-
// echo("Cloud Monitoring Account: $account")
|
|
47
|
-
// echo("Cloud Monitoring Check Types: ".var_export($checkTypes));
|
|
48
|
-
|
|
49
|
-
$blockStorageService = $rackspace->volumeService('cloudBlockStorage', 'DFW');
|
|
50
|
-
$volumes = $blockStorageService->volumeList(false);
|
|
51
|
-
// echo("Cloud Block Storage Volumes: ".var_export($volumes));
|
|
52
|
-
|
|
53
|
-
# Cloud Backup?
|
|
54
|
-
|
|
55
|
-
$autoscaleService = $rackspace->autoscaleService();
|
|
56
|
-
$groups = $autoscaleService->groupList();
|
|
57
|
-
// echo("Autoscale Scaling Groups: ".var_export($groups));
|
|
58
|
-
|
|
59
|
-
# Cloud Queues
|
|
60
|
-
$queuesService = $rackspace->queuesService('cloudQueues', $region);
|
|
61
|
-
$queues = $queuesService->listQueues();
|
|
62
|
-
// echo("Cloud Queues: ".var_export($queues));
|
|
63
|
-
|
|
64
|
-
?>
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<?php
|
|
2
|
-
require 'vendor/autoload.php';
|
|
3
|
-
use OpenCloud\Rackspace;
|
|
4
|
-
|
|
5
|
-
$endpoint = getenv('RAX_AUTH_URL') . '/v2.0/';
|
|
6
|
-
$credentials = array(
|
|
7
|
-
'username' => getenv('RAX_USERNAME'),
|
|
8
|
-
'apiKey' => getenv('RAX_API_KEY')
|
|
9
|
-
);
|
|
10
|
-
|
|
11
|
-
$rackspace = new Rackspace($endpoint, $credentials);
|
|
12
|
-
$rackspace->Authenticate();
|
|
13
|
-
echo('Authenticated')
|
|
14
|
-
?>
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
<?php
|
|
2
|
-
require('vendor/autoload.php');
|
|
3
|
-
use OpenCloud\Rackspace;
|
|
4
|
-
|
|
5
|
-
$endpoint = getenv('RAX_AUTH_URL') . '/v2.0/';
|
|
6
|
-
$credentials = array(
|
|
7
|
-
'username' => getenv('RAX_USERNAME'),
|
|
8
|
-
'apiKey' => getenv('RAX_API_KEY')
|
|
9
|
-
);
|
|
10
|
-
|
|
11
|
-
$rackspace = new Rackspace($endpoint, $credentials);
|
|
12
|
-
$compute = $rackspace->computeService('cloudServersOpenStack', getenv('RAX_REGION'));
|
|
13
|
-
|
|
14
|
-
$image_id = getenv('SERVER1_IMAGE');
|
|
15
|
-
$flavor_id = getenv('SERVER1_FLAVOR');
|
|
16
|
-
|
|
17
|
-
// Create a server in DFW
|
|
18
|
-
$server = $compute->Server();
|
|
19
|
-
// create it
|
|
20
|
-
print("Creating server...");
|
|
21
|
-
$server->create(array(
|
|
22
|
-
'name' => 'php-opencloud server',
|
|
23
|
-
// Using the image ID from ORD
|
|
24
|
-
'image' => $compute->image($image_id),
|
|
25
|
-
// And a flavor that's too small
|
|
26
|
-
'flavor' => $compute->flavor($flavor_id)
|
|
27
|
-
));
|
|
28
|
-
print("requested, now waiting...\n");
|
|
29
|
-
print("ID=" . $server->id . "...\n");
|
|
30
|
-
$server->WaitFor("ACTIVE", 600, 'dot');
|
|
31
|
-
print("done\n");
|
|
32
|
-
exit(0);
|
|
33
|
-
|
|
34
|
-
function dot($server)
|
|
35
|
-
{
|
|
36
|
-
printf("%s %3d%%\n", $server->status, $server->progress);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
?>
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<?php
|
|
2
|
-
require 'vendor/autoload.php';
|
|
3
|
-
use OpenCloud\Rackspace;
|
|
4
|
-
|
|
5
|
-
$region = getenv('RAX_REGION');
|
|
6
|
-
$endpoint = getenv('RAX_AUTH_URL') . '/v2.0/';
|
|
7
|
-
$credentials = array(
|
|
8
|
-
'username' => getenv('RAX_USERNAME'),
|
|
9
|
-
'apiKey' => getenv('RAX_API_KEY')
|
|
10
|
-
);
|
|
11
|
-
$directory = getenv('TEST_DIRECTORY');
|
|
12
|
-
$file = getenv('TEST_FILE');
|
|
13
|
-
|
|
14
|
-
$rackspace = new Rackspace($endpoint, $credentials);
|
|
15
|
-
$cloudFilesService = $rackspace->objectStoreService('cloudFiles', $region);
|
|
16
|
-
$container = $cloudFilesService->getContainer($directory);
|
|
17
|
-
$object = $container->getPartialObject($file);
|
|
18
|
-
|
|
19
|
-
?>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
php "$args"
|
data/sdks/pkgcloud/.gitignore
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
node_modules/
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
var pkgcloud = require('pkgcloud');
|
|
2
|
-
|
|
3
|
-
// create our client with your rackspace credentials
|
|
4
|
-
var client = pkgcloud.providers.rackspace.compute.createClient({
|
|
5
|
-
username: process.env.RAX_USERNAME,
|
|
6
|
-
apiKey: process.env.RAX_API_KEY,
|
|
7
|
-
authUrl: process.env.RAX_AUTH_URL,
|
|
8
|
-
region: process.env.RAX_REGION
|
|
9
|
-
});
|
|
10
|
-
client.auth(function(err) {
|
|
11
|
-
if (err) {
|
|
12
|
-
console.log(err.message);
|
|
13
|
-
process.exit(1);
|
|
14
|
-
} else {
|
|
15
|
-
console.log('Authenticated');
|
|
16
|
-
}
|
|
17
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
var pkgcloud = require('pkgcloud');
|
|
2
|
-
|
|
3
|
-
// create our client with your rackspace credentials
|
|
4
|
-
var storageClient = pkgcloud.providers.rackspace.storage.createClient({
|
|
5
|
-
username: process.env.RAX_USERNAME,
|
|
6
|
-
apiKey: process.env.RAX_API_KEY,
|
|
7
|
-
authUrl: process.env.RAX_AUTH_URL,
|
|
8
|
-
region: process.env.RAX_REGION
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
storageClient.getFile(process.env.TEST_DIRECTORY, process.env.TEST_FILE, function (err, server) {
|
|
12
|
-
if (err) {
|
|
13
|
-
console.dir(err);
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
console.dir(server);
|
|
18
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
npm install pkgcloud
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
node "$args"
|
data/sdks/pyrax/.gitignore
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python
|
|
2
|
-
|
|
3
|
-
import os
|
|
4
|
-
import pyrax
|
|
5
|
-
|
|
6
|
-
pyrax.set_setting("identity_type", "rackspace")
|
|
7
|
-
# Create the identity object
|
|
8
|
-
pyrax._create_identity()
|
|
9
|
-
# Change its endpoint
|
|
10
|
-
pyrax.identity.auth_endpoint = os.getenv('RAX_AUTH_URL') + '/v2.0/'
|
|
11
|
-
|
|
12
|
-
# Authenticate
|
|
13
|
-
pyrax.set_credentials(os.getenv('RAX_USERNAME'), os.getenv('RAX_API_KEY'))
|
|
14
|
-
|
|
15
|
-
print "Authenticated"
|
|
16
|
-
|
|
17
|
-
# Cloud Servers API - List Servers
|
|
18
|
-
cs = pyrax.cloudservers
|
|
19
|
-
print "Servers:", cs.servers.list()
|
|
20
|
-
|
|
21
|
-
# Networks API - List Networks
|
|
22
|
-
cnw = pyrax.cloud_networks
|
|
23
|
-
print "Networks:", cnw.list()
|
|
24
|
-
|
|
25
|
-
# Cloud Files API - List Files
|
|
26
|
-
cf = pyrax.cloudfiles
|
|
27
|
-
cf.http_log_debug = True
|
|
28
|
-
print "Cloud Files Containers:", cf.list_containers()
|
|
29
|
-
|
|
30
|
-
# Cloud Load Balancers
|
|
31
|
-
clb = pyrax.cloud_loadbalancers
|
|
32
|
-
print "Cloud Load Balancers:", clb.list()
|
|
33
|
-
|
|
34
|
-
# Cloud Database
|
|
35
|
-
cdb = pyrax.cloud_databases
|
|
36
|
-
print "Cloud Databases:", cdb.list()
|
|
37
|
-
|
|
38
|
-
# Cloud DNS
|
|
39
|
-
cdns = pyrax.cloud_dns
|
|
40
|
-
print "Cloud DNS:", cdns.list()
|
|
41
|
-
|
|
42
|
-
# Cloud Identity
|
|
43
|
-
# print "Cloud Identity Users:", pyrax.identity.list_users()
|
|
44
|
-
|
|
45
|
-
# Cloud Monitoring
|
|
46
|
-
cm = pyrax.cloud_monitoring
|
|
47
|
-
print "Cloud Monitoring Account:", cm.get_account()
|
|
48
|
-
|
|
49
|
-
# Cloud Block Storage
|
|
50
|
-
cbs = pyrax.cloud_blockstorage
|
|
51
|
-
print "Cloud Block Storage Volumes:", cbs.list()
|
|
52
|
-
|
|
53
|
-
# Cloud Backup?
|
|
54
|
-
|
|
55
|
-
# Autoscale
|
|
56
|
-
ax = pyrax.autoscale
|
|
57
|
-
print "Autoscale Scaling Groups:", ax.list()
|
|
58
|
-
|
|
59
|
-
# Cloud Queues
|
|
60
|
-
pq = pyrax.queues
|
|
61
|
-
print "Cloud Queues:", pq.list()
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python
|
|
2
|
-
|
|
3
|
-
import os
|
|
4
|
-
import pyrax
|
|
5
|
-
|
|
6
|
-
pyrax.set_setting("identity_type", "rackspace")
|
|
7
|
-
# Create the identity object
|
|
8
|
-
pyrax._create_identity()
|
|
9
|
-
# Change its endpoint
|
|
10
|
-
endpoint = os.getenv('RAX_AUTH_URL')
|
|
11
|
-
if endpoint is not None:
|
|
12
|
-
pyrax.identity.auth_endpoint = os.getenv('RAX_AUTH_URL') + '/v2.0/'
|
|
13
|
-
|
|
14
|
-
# Authenticate
|
|
15
|
-
pyrax.set_credentials(os.getenv('RAX_USERNAME'), os.getenv('RAX_API_KEY'))
|
|
16
|
-
|
|
17
|
-
print "Authenticated"
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python
|
|
2
|
-
|
|
3
|
-
import os
|
|
4
|
-
import pyrax
|
|
5
|
-
|
|
6
|
-
container_name = 'my-site'
|
|
7
|
-
folder_to_upload = os.getenv('TEST_DIRECTORY')
|
|
8
|
-
username = os.getenv('RAX_USERNAME')
|
|
9
|
-
api_key = os.getenv('RAX_API_KEY')
|
|
10
|
-
auth_endpoint = os.getenv('RAX_AUTH_URL')
|
|
11
|
-
|
|
12
|
-
pyrax.set_setting("identity_type", "rackspace")
|
|
13
|
-
# Create the identity object
|
|
14
|
-
pyrax._create_identity()
|
|
15
|
-
# Change its endpoint
|
|
16
|
-
pyrax.identity.auth_endpoint = auth_endpoint + '/v2.0/'
|
|
17
|
-
|
|
18
|
-
# Identity Connection - Authenticate
|
|
19
|
-
pyrax.set_credentials(username, api_key)
|
|
20
|
-
|
|
21
|
-
cf = pyrax.cloudfiles
|
|
22
|
-
cf.make_container_public(container_name, ttl=900)
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python
|
|
2
|
-
|
|
3
|
-
import os
|
|
4
|
-
import pyrax
|
|
5
|
-
|
|
6
|
-
container_name = os.getenv('CONTAINER_NAME')
|
|
7
|
-
username = os.getenv('RAX_USERNAME')
|
|
8
|
-
api_key = os.getenv('RAX_API_KEY')
|
|
9
|
-
auth_endpoint = os.getenv('RAX_AUTH_URL')
|
|
10
|
-
|
|
11
|
-
pyrax.set_setting("identity_type", "rackspace")
|
|
12
|
-
# Create the identity object
|
|
13
|
-
pyrax._create_identity()
|
|
14
|
-
# Change its endpoint
|
|
15
|
-
pyrax.identity.auth_endpoint = auth_endpoint + '/v2.0/'
|
|
16
|
-
|
|
17
|
-
# Identity Connection - Authenticate
|
|
18
|
-
pyrax.set_credentials(username, api_key)
|
|
19
|
-
|
|
20
|
-
cf = pyrax.cloudfiles
|
|
21
|
-
cont = cf.create_container("my-site")
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python
|
|
2
|
-
|
|
3
|
-
import os
|
|
4
|
-
import pyrax
|
|
5
|
-
# [Configure Pyrax](https://github.com/rackspace/pyrax/blob/master/docs/getting_started.md#pyrax-configuration)
|
|
6
|
-
# to use the Rackspace identity service.
|
|
7
|
-
|
|
8
|
-
pyrax.set_setting("identity_type", "rackspace")
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
# Change the authentication endpoint if requested, otherwise use the default
|
|
12
|
-
custom_endpoint = os.getenv('RAX_AUTH_URL')
|
|
13
|
-
if custom_endpoint is not None:
|
|
14
|
-
pyrax._create_identity()
|
|
15
|
-
# Pyrax requires the endpoint to contain the version
|
|
16
|
-
pyrax.identity.auth_endpoint = custom_endpoint + '/v2.0/'
|
|
17
|
-
|
|
18
|
-
# Set the region, needs to be done before authenticating.
|
|
19
|
-
pyrax.set_setting('region', os.getenv('RAX_REGION'))
|
|
20
|
-
|
|
21
|
-
# [Authenticate](https://github.com/rackspace/pyrax/blob/master/docs/getting_started.md#authenticating)
|
|
22
|
-
# using an API key.
|
|
23
|
-
pyrax.set_credentials(os.getenv('RAX_USERNAME'), os.getenv('RAX_API_KEY'))
|
|
24
|
-
|
|
25
|
-
# Get the flavor and image for the test scenario.
|
|
26
|
-
flavor = os.getenv('SERVER1_FLAVOR')
|
|
27
|
-
image = os.getenv('SERVER1_IMAGE')
|
|
28
|
-
|
|
29
|
-
# Create a [Cloud Servers](https://github.com/rackspace/pyrax/blob/master/docs/cloud_servers.md) connection.
|
|
30
|
-
cs = pyrax.cloudservers
|
|
31
|
-
|
|
32
|
-
# [Create a server](https://github.com/rackspace/pyrax/blob/master/docs/cloud_servers.md#creating-a-server)
|
|
33
|
-
server = cs.servers.create("Pyrax Server", image, flavor)
|
|
34
|
-
# and [wait for it to build](https://github.com/rackspace/pyrax/blob/master/docs/cloud_servers.md#waiting-for-server-completion).
|
|
35
|
-
pyrax.utils.wait_for_build(server, verbose=True)
|