polytrix 0.0.1 → 0.1.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- 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,45 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'fog'
|
4
|
-
|
5
|
-
connection_opts = {
|
6
|
-
:rackspace_username => ENV['RAX_USERNAME'],
|
7
|
-
:rackspace_api_key => ENV['RAX_API_KEY'],
|
8
|
-
:rackspace_region => ENV['RAX_REGION'].downcase.to_sym,
|
9
|
-
:rackspace_auth_url => "#{ENV['RAX_AUTH_URL']}/v2.0"
|
10
|
-
}
|
11
|
-
|
12
|
-
# Compute services:
|
13
|
-
compute = Fog::Compute.new(connection_opts.merge({:provider => 'rackspace'}))
|
14
|
-
puts "Servers: #{compute.servers.all}"
|
15
|
-
puts "Networks: #{compute.networks.all}"
|
16
|
-
|
17
|
-
load_balancers = Fog::Rackspace::LoadBalancers.new(connection_opts)
|
18
|
-
puts "Cloud Load Balancers: #{load_balancers.load_balancers.all}"
|
19
|
-
|
20
|
-
storage = Fog::Storage.new(connection_opts.merge({:provider => 'rackspace'}))
|
21
|
-
puts "Cloud Files Containers: #{storage.directories.all}"
|
22
|
-
|
23
|
-
databases = Fog::Rackspace::Databases.new(connection_opts)
|
24
|
-
puts "Cloud Databases: #{databases.instances.all}"
|
25
|
-
|
26
|
-
dns = Fog::DNS::Rackspace.new(connection_opts)
|
27
|
-
puts "Cloud DNS: #{dns.zones.all}"
|
28
|
-
|
29
|
-
identity = Fog::Rackspace::Identity.new(connection_opts)
|
30
|
-
puts "Cloud Identity Users: #{identity.users.all}"
|
31
|
-
|
32
|
-
monitoring = Fog::Rackspace::Monitoring.new(connection_opts)
|
33
|
-
puts "Cloud Monitoring Account: #{monitoring.list_entities}"
|
34
|
-
|
35
|
-
block_storage = Fog::Rackspace::BlockStorage.new(connection_opts)
|
36
|
-
puts "Cloud Block Storage Volumes: #{block_storage.volumes.all}"
|
37
|
-
|
38
|
-
# Cloud Backup?
|
39
|
-
|
40
|
-
autoscale = Fog::Rackspace::AutoScale.new(connection_opts)
|
41
|
-
puts "Autoscale Scaling Groups: #{autoscale.groups.all}"
|
42
|
-
|
43
|
-
# Cloud Queues
|
44
|
-
queues = Fog::Rackspace::Queues.new(connection_opts)
|
45
|
-
puts "Cloud Queues: #{queues.queues.all}"
|
@@ -1,15 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
# This example demonstrates creating a server with the Rackpace Open Cloud
|
4
|
-
|
5
|
-
require 'fog'
|
6
|
-
|
7
|
-
service = Fog::Compute.new({
|
8
|
-
:provider => 'rackspace',
|
9
|
-
:rackspace_username => ENV['RAX_USERNAME'],
|
10
|
-
:rackspace_api_key => ENV['RAX_API_KEY'],
|
11
|
-
:rackspace_region => ENV['RAX_REGION'].downcase.to_sym,
|
12
|
-
:rackspace_auth_url => "#{ENV['RAX_AUTH_URL']}/v2.0"
|
13
|
-
})
|
14
|
-
|
15
|
-
puts "Authenticated"
|
@@ -1,20 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'fog'
|
4
|
-
connection_opts = {
|
5
|
-
:rackspace_username => ENV['RAX_USERNAME'],
|
6
|
-
:rackspace_api_key => ENV['RAX_API_KEY'],
|
7
|
-
:rackspace_region => ENV['RAX_REGION'].downcase.to_sym,
|
8
|
-
:rackspace_auth_url => "#{ENV['RAX_AUTH_URL']}/v2.0"
|
9
|
-
}
|
10
|
-
storage = Fog::Storage.new(connection_opts.merge({:provider => 'rackspace'}))
|
11
|
-
|
12
|
-
container_name = 'my-site'
|
13
|
-
folder_to_upload = ENV['TEST_DIRECTORY']
|
14
|
-
username = ENV['RAX_USERNAME']
|
15
|
-
api_key = ENV['RAX_API_KEY']
|
16
|
-
auth_endpoint = ENV['RAX_AUTH_URL']
|
17
|
-
|
18
|
-
directory = storage.directories.get container_name
|
19
|
-
directory.public = true
|
20
|
-
directory.save
|
@@ -1,17 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'fog'
|
4
|
-
connection_opts = {
|
5
|
-
:rackspace_username => ENV['RAX_USERNAME'],
|
6
|
-
:rackspace_api_key => ENV['RAX_API_KEY'],
|
7
|
-
:rackspace_region => ENV['RAX_REGION'].downcase.to_sym,
|
8
|
-
:rackspace_auth_url => "#{ENV['RAX_AUTH_URL']}/v2.0"
|
9
|
-
}
|
10
|
-
storage = Fog::Storage.new(connection_opts.merge({:provider => 'rackspace'}))
|
11
|
-
|
12
|
-
container_name = ENV['CONTAINER_NAME']
|
13
|
-
username = ENV['RAX_USERNAME']
|
14
|
-
api_key = ENV['RAX_API_KEY']
|
15
|
-
auth_endpoint = ENV['RAX_AUTH_URL']
|
16
|
-
|
17
|
-
storage.directories.create :key => 'my-site'
|
@@ -1,36 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'fog'
|
4
|
-
Excon.defaults[:ssl_verify_peer] = false
|
5
|
-
|
6
|
-
service = Fog::Compute.new({
|
7
|
-
:provider => 'rackspace',
|
8
|
-
:rackspace_username => ENV['RAX_USERNAME'],
|
9
|
-
:rackspace_api_key => ENV['RAX_API_KEY'],
|
10
|
-
:rackspace_region => ENV['RAX_REGION'].downcase.to_sym,
|
11
|
-
:rackspace_auth_url => "#{ENV['RAX_AUTH_URL']}/v2.0"
|
12
|
-
})
|
13
|
-
|
14
|
-
server = service.servers.create :name => 'Fog Server',
|
15
|
-
:flavor_id => ENV['SERVER1_FLAVOR'],
|
16
|
-
:image_id => ENV['SERVER1_IMAGE']
|
17
|
-
|
18
|
-
puts "\n"
|
19
|
-
|
20
|
-
begin
|
21
|
-
# Check every 5 seconds to see if server is in the active state (ready?).
|
22
|
-
# If the server has not been built in 5 minutes (600 seconds) an exception will be raised.
|
23
|
-
server.wait_for(600, 5) do
|
24
|
-
print "."
|
25
|
-
STDOUT.flush
|
26
|
-
ready?
|
27
|
-
end
|
28
|
-
|
29
|
-
puts "[DONE]\n\n"
|
30
|
-
|
31
|
-
rescue Fog::Errors::TimeoutError
|
32
|
-
puts "[TIMEOUT]\n\n"
|
33
|
-
|
34
|
-
puts "This server is currently #{server.progress}% into the build process and is taking longer to complete than expected."
|
35
|
-
puts "You can continute to monitor the build process through the web console at https://mycloud.rackspace.com/\n\n"
|
36
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
require 'fog'
|
3
|
-
|
4
|
-
service = Fog::Storage.new({
|
5
|
-
:provider => 'rackspace',
|
6
|
-
:rackspace_username => ENV['RAX_USERNAME'],
|
7
|
-
:rackspace_api_key => ENV['RAX_API_KEY'],
|
8
|
-
:rackspace_region => ENV['RAX_REGION'],
|
9
|
-
:rackspace_auth_url => "#{ENV['RAX_AUTH_URL']}/v2.0"
|
10
|
-
})
|
11
|
-
# directory = service.directories.get ENV['TEST_DIRECTORY']
|
12
|
-
# directory.files.head_object ENV['TEST_FILE']
|
13
|
-
service.head_object ENV['TEST_DIRECTORY'], ENV['TEST_FILE']
|
@@ -1,10 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
require 'fog'
|
3
|
-
|
4
|
-
service = Fog::Storage.new({
|
5
|
-
:provider => 'rackspace',
|
6
|
-
:rackspace_username => ENV['RAX_USERNAME'],
|
7
|
-
:rackspace_api_key => ENV['RAX_API_KEY'],
|
8
|
-
:rackspace_auth_url => "#{ENV['RAX_AUTH_URL']}/v2.0"
|
9
|
-
})
|
10
|
-
containers = service.get_containers
|
@@ -1,30 +0,0 @@
|
|
1
|
-
require 'fog'
|
2
|
-
|
3
|
-
volume_name = 'my_volume'
|
4
|
-
connection_opts = {
|
5
|
-
:rackspace_username => ENV['RAX_USERNAME'],
|
6
|
-
:rackspace_api_key => ENV['RAX_API_KEY'],
|
7
|
-
:rackspace_region => ENV['RAX_REGION'].downcase.to_sym,
|
8
|
-
:rackspace_auth_url => "#{ENV['RAX_AUTH_URL']}/v2.0"
|
9
|
-
}
|
10
|
-
|
11
|
-
compute = Fog::Compute.new(connection_opts.merge(:provider => 'rackspace'))
|
12
|
-
|
13
|
-
server = compute.servers.create :name => 'Fog Server',
|
14
|
-
:flavor_id => ENV['SERVER1_FLAVOR'],
|
15
|
-
:image_id => ENV['SERVER1_IMAGE']
|
16
|
-
|
17
|
-
server.wait_for(600, 5) do
|
18
|
-
print "."
|
19
|
-
STDOUT.flush
|
20
|
-
ready?
|
21
|
-
end
|
22
|
-
|
23
|
-
server = server.reload
|
24
|
-
|
25
|
-
cbs_service = Fog::Rackspace::BlockStorage.new(connection_opts)
|
26
|
-
|
27
|
-
puts "\nCreating Volume\n"
|
28
|
-
volume = cbs_service.volumes.create(:size => 100, :display_name => volume_name)
|
29
|
-
puts "\nAttaching volume\n"
|
30
|
-
attachment = server.attach_volume volume
|
@@ -1,25 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'fog'
|
4
|
-
connection_opts = {
|
5
|
-
:rackspace_username => ENV['RAX_USERNAME'],
|
6
|
-
:rackspace_api_key => ENV['RAX_API_KEY'],
|
7
|
-
:rackspace_region => ENV['RAX_REGION'].downcase.to_sym,
|
8
|
-
:rackspace_auth_url => "#{ENV['RAX_AUTH_URL']}/v2.0"
|
9
|
-
}
|
10
|
-
storage = Fog::Storage.new(connection_opts.merge({:provider => 'rackspace'}))
|
11
|
-
|
12
|
-
container_name = 'my-site'
|
13
|
-
folder_to_upload = ENV['TEST_DIRECTORY']
|
14
|
-
username = ENV['RAX_USERNAME']
|
15
|
-
api_key = ENV['RAX_API_KEY']
|
16
|
-
auth_endpoint = ENV['RAX_AUTH_URL']
|
17
|
-
|
18
|
-
puts 'Uploading folder'
|
19
|
-
local_directory = Pathname.new folder_to_upload
|
20
|
-
remote_directory = storage.directories.create :key => container_name
|
21
|
-
Dir["#{folder_to_upload}/**.*"].each do |file|
|
22
|
-
file_key = Pathname.new(file).relative_path_from local_directory
|
23
|
-
remote_directory.files.create :key => file_key.to_s, :body => File.open(file)
|
24
|
-
end
|
25
|
-
puts 'Done uploading'
|
@@ -1 +0,0 @@
|
|
1
|
-
bundle install
|
data/sdks/fog/scripts/wrapper
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
bundle exec ruby "$args"
|
data/sdks/gophercloud/.gitignore
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
package main
|
2
|
-
|
3
|
-
import (
|
4
|
-
"github.com/rackspace/gophercloud"
|
5
|
-
"os"
|
6
|
-
)
|
7
|
-
|
8
|
-
func main() {
|
9
|
-
var provider = os.Getenv("RAX_AUTH_URL") + "/v2.0/tokens"
|
10
|
-
var username = os.Getenv("RAX_USERNAME")
|
11
|
-
var api_key = os.Getenv("RAX_API_KEY")
|
12
|
-
_, err := gophercloud.Authenticate(
|
13
|
-
provider,
|
14
|
-
gophercloud.AuthOptions{
|
15
|
-
Username: username,
|
16
|
-
ApiKey: api_key,
|
17
|
-
},
|
18
|
-
)
|
19
|
-
if err != nil {
|
20
|
-
panic(err)
|
21
|
-
}
|
22
|
-
println("Authenticated")
|
23
|
-
}
|
@@ -1,10 +0,0 @@
|
|
1
|
-
#!/bin/bash
|
2
|
-
export GOPATH=`pwd`/go
|
3
|
-
CHALLENGES_DIR=$(dirname $1)
|
4
|
-
export SDK_PROVIDER=${RAX_AUTH_URL}/v2.0/tokens
|
5
|
-
# export SDK_PROVIDER=rackspace-us
|
6
|
-
export SDK_USERNAME=$RAX_USERNAME
|
7
|
-
export SDK_API_KEY=$RAX_API_KEY
|
8
|
-
export SDK_PASSWORD=none
|
9
|
-
# go run $1 $CHALLENGES_DIR/libargs.go
|
10
|
-
go run $1
|
data/sdks/jclouds/.gitignore
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
target/
|
@@ -1,115 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* Licensed to the Apache Software Foundation (ASF) under one
|
3
|
-
* or more contributor license agreements. See the NOTICE file
|
4
|
-
* distributed with this work for additional information
|
5
|
-
* regarding copyright ownership. The ASF licenses this file
|
6
|
-
* to you under the Apache License, Version 2.0 (the
|
7
|
-
* "License"); you may not use this file except in compliance
|
8
|
-
* with the License. You may obtain a copy of the License at
|
9
|
-
*
|
10
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
11
|
-
*
|
12
|
-
* Unless required by applicable law or agreed to in writing,
|
13
|
-
* software distributed under the License is distributed on an
|
14
|
-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
15
|
-
* KIND, either express or implied. See the License for the
|
16
|
-
* specific language governing permissions and limitations
|
17
|
-
* under the License.
|
18
|
-
*/
|
19
|
-
package org.jclouds.examples.rackspace;
|
20
|
-
|
21
|
-
import java.io.Closeable;
|
22
|
-
import java.util.Properties;
|
23
|
-
|
24
|
-
import org.jclouds.ContextBuilder;
|
25
|
-
import org.jclouds.compute.ComputeService;
|
26
|
-
import org.jclouds.compute.ComputeServiceContext;
|
27
|
-
import org.jclouds.openstack.keystone.v2_0.config.CredentialTypes;
|
28
|
-
import org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties;
|
29
|
-
import org.jclouds.openstack.nova.v2_0.NovaApi;
|
30
|
-
import org.jclouds.openstack.nova.v2_0.NovaAsyncApi;
|
31
|
-
import org.jclouds.rest.RestContext;
|
32
|
-
|
33
|
-
/**
|
34
|
-
* To authenticate using jclouds you need to provide your credentials to a Context as in the init() method below.
|
35
|
-
* Authentication occurs on your first actual interaction with the Rackspace Cloud (i.e. the very first time
|
36
|
-
* you call a method that needs to talk to the cloud). Once you are authenticated you receive a token that is
|
37
|
-
* cached and you won't reauthenticate for subsequent calls. If your token expires before the JVM quits, jclouds
|
38
|
-
* will automatically handle reauthentication and get a new token for you.
|
39
|
-
*
|
40
|
-
* If authentication doesn't work, the call will result in an org.jclouds.rest.AuthorizationException
|
41
|
-
*
|
42
|
-
* This example demostrates how you would authenticate via username and password or API key. The default is
|
43
|
-
* authentication via API key, which is used in the rest of the examples in this package.
|
44
|
-
*
|
45
|
-
* @author Everett Toews
|
46
|
-
*/
|
47
|
-
public class AuthenticateToken implements Closeable {
|
48
|
-
private ComputeService compute;
|
49
|
-
private RestContext<NovaApi, NovaAsyncApi> nova;
|
50
|
-
|
51
|
-
/**
|
52
|
-
* To get a username and API key see http://www.jclouds.org/documentation/quickstart/rackspace/
|
53
|
-
*
|
54
|
-
* The first argument (args[0]) must be your username
|
55
|
-
* The second argument (args[1]) must be your API key or password
|
56
|
-
* [Optional] The third argument (args[2]) must be "password" if password authentication is used,
|
57
|
-
* otherwise default to using API key.
|
58
|
-
*/
|
59
|
-
public static void main(String[] args) {
|
60
|
-
AuthenticateToken authenticate = new AuthenticateToken();
|
61
|
-
|
62
|
-
try {
|
63
|
-
authenticate.init(args);
|
64
|
-
authenticate.authenticateOnCall();
|
65
|
-
}
|
66
|
-
catch (Exception e) {
|
67
|
-
e.printStackTrace();
|
68
|
-
}
|
69
|
-
finally {
|
70
|
-
authenticate.close();
|
71
|
-
}
|
72
|
-
}
|
73
|
-
|
74
|
-
private void init(String[] args) {
|
75
|
-
// The provider configures jclouds To use the Rackspace Cloud (US)
|
76
|
-
// To use the Rackspace Cloud (UK) set the provider to "rackspace-cloudservers-uk"
|
77
|
-
String provider = "rackspace-cloudservers-us";
|
78
|
-
|
79
|
-
String username = System.getenv("RAX_USERNAME");
|
80
|
-
String credential = System.getenv("RAX_API_KEY");
|
81
|
-
|
82
|
-
Properties overrides = new Properties();
|
83
|
-
|
84
|
-
if (args.length == 3 && "password".equals(args[2])) {
|
85
|
-
overrides.put(KeystoneProperties.CREDENTIAL_TYPE, CredentialTypes.PASSWORD_CREDENTIALS);
|
86
|
-
}
|
87
|
-
|
88
|
-
String endpoint = System.getenv("RAX_AUTH_URL") + "/v2.0/";
|
89
|
-
ComputeServiceContext context = ContextBuilder.newBuilder(provider)
|
90
|
-
.credentials(username, credential)
|
91
|
-
.overrides(overrides)
|
92
|
-
.endpoint(endpoint)
|
93
|
-
.buildView(ComputeServiceContext.class);
|
94
|
-
compute = context.getComputeService();
|
95
|
-
nova = context.unwrap();
|
96
|
-
}
|
97
|
-
|
98
|
-
/**
|
99
|
-
* Calling getConfiguredZones() causes jclouds to authenticate. If authentication doesn't work, the call to
|
100
|
-
* getConfiguredZones() will result in an org.jclouds.rest.AuthorizationException
|
101
|
-
*/
|
102
|
-
private void authenticateOnCall() {
|
103
|
-
nova.getApi().getConfiguredZones();
|
104
|
-
System.out.println("Authenticated");
|
105
|
-
}
|
106
|
-
|
107
|
-
/**
|
108
|
-
* Always close your service when you're done with it.
|
109
|
-
*/
|
110
|
-
public void close() {
|
111
|
-
if (compute != null) {
|
112
|
-
compute.getContext();
|
113
|
-
}
|
114
|
-
}
|
115
|
-
}
|
data/sdks/jclouds/pom.xml
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
2
|
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
3
|
-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
|
4
|
-
http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
5
|
-
<modelVersion>4.0.0</modelVersion>
|
6
|
-
<groupId>com.mycompany.app</groupId>
|
7
|
-
<artifactId>my-app</artifactId>
|
8
|
-
<packaging>jar</packaging>
|
9
|
-
<version>1.0-SNAPSHOT</version>
|
10
|
-
<name>Maven Quick Start Archetype</name>
|
11
|
-
<url>http://maven.apache.org</url>
|
12
|
-
<build>
|
13
|
-
<sourceDirectory>challenges</sourceDirectory>
|
14
|
-
<plugins>
|
15
|
-
<plugin>
|
16
|
-
<groupId>org.codehaus.mojo</groupId>
|
17
|
-
<artifactId>versions-maven-plugin</artifactId>
|
18
|
-
<version>2.1</version>
|
19
|
-
</plugin>
|
20
|
-
<plugin>
|
21
|
-
<groupId>org.codehaus.mojo</groupId>
|
22
|
-
<artifactId>exec-maven-plugin</artifactId>
|
23
|
-
<version>1.2.1</version>
|
24
|
-
</plugin>
|
25
|
-
</plugins>
|
26
|
-
</build>
|
27
|
-
<dependencies>
|
28
|
-
<dependency>
|
29
|
-
<groupId>org.apache.jclouds</groupId>
|
30
|
-
<artifactId>jclouds-all</artifactId>
|
31
|
-
<version>1.7.2</version>
|
32
|
-
</dependency>
|
33
|
-
</dependencies>
|
34
|
-
</project>
|
Binary file
|
Binary file
|
@@ -1,136 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
2
|
-
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
3
|
-
<PropertyGroup>
|
4
|
-
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir>
|
5
|
-
|
6
|
-
<!-- Enable the restore command to run before builds -->
|
7
|
-
<RestorePackages Condition=" '$(RestorePackages)' == '' ">true</RestorePackages>
|
8
|
-
|
9
|
-
<!-- Property that enables building a package from a project -->
|
10
|
-
<BuildPackage Condition=" '$(BuildPackage)' == '' ">false</BuildPackage>
|
11
|
-
|
12
|
-
<!-- Determines if package restore consent is required to restore packages -->
|
13
|
-
<RequireRestoreConsent Condition=" '$(RequireRestoreConsent)' != 'false' ">true</RequireRestoreConsent>
|
14
|
-
|
15
|
-
<!-- Download NuGet.exe if it does not already exist -->
|
16
|
-
<DownloadNuGetExe Condition=" '$(DownloadNuGetExe)' == '' ">false</DownloadNuGetExe>
|
17
|
-
</PropertyGroup>
|
18
|
-
|
19
|
-
<ItemGroup Condition=" '$(PackageSources)' == '' ">
|
20
|
-
<!-- Package sources used to restore packages. By default, registered sources under %APPDATA%\NuGet\NuGet.Config will be used -->
|
21
|
-
<!-- The official NuGet package source (https://www.nuget.org/api/v2/) will be excluded if package sources are specified and it does not appear in the list -->
|
22
|
-
<!--
|
23
|
-
<PackageSource Include="https://www.nuget.org/api/v2/" />
|
24
|
-
<PackageSource Include="https://my-nuget-source/nuget/" />
|
25
|
-
-->
|
26
|
-
</ItemGroup>
|
27
|
-
|
28
|
-
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT'">
|
29
|
-
<!-- Windows specific commands -->
|
30
|
-
<NuGetToolsPath>$([System.IO.Path]::Combine($(SolutionDir), ".nuget"))</NuGetToolsPath>
|
31
|
-
<PackagesConfig>$([System.IO.Path]::Combine($(ProjectDir), "packages.config"))</PackagesConfig>
|
32
|
-
</PropertyGroup>
|
33
|
-
|
34
|
-
<PropertyGroup Condition=" '$(OS)' != 'Windows_NT'">
|
35
|
-
<!-- We need to launch nuget.exe with the mono command if we're not on windows -->
|
36
|
-
<NuGetToolsPath>$(SolutionDir).nuget</NuGetToolsPath>
|
37
|
-
<PackagesConfig>packages.config</PackagesConfig>
|
38
|
-
</PropertyGroup>
|
39
|
-
|
40
|
-
<PropertyGroup>
|
41
|
-
<!-- NuGet command -->
|
42
|
-
<NuGetExePath Condition=" '$(NuGetExePath)' == '' ">$(NuGetToolsPath)\NuGet.exe</NuGetExePath>
|
43
|
-
<PackageSources Condition=" $(PackageSources) == '' ">@(PackageSource)</PackageSources>
|
44
|
-
|
45
|
-
<NuGetCommand Condition=" '$(OS)' == 'Windows_NT'">"$(NuGetExePath)"</NuGetCommand>
|
46
|
-
<NuGetCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 $(NuGetExePath)</NuGetCommand>
|
47
|
-
|
48
|
-
<PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))</PackageOutputDir>
|
49
|
-
|
50
|
-
<RequireConsentSwitch Condition=" $(RequireRestoreConsent) == 'true' ">-RequireConsent</RequireConsentSwitch>
|
51
|
-
<NonInteractiveSwitch Condition=" '$(VisualStudioVersion)' != '' AND '$(OS)' == 'Windows_NT' ">-NonInteractive</NonInteractiveSwitch>
|
52
|
-
|
53
|
-
<PaddedSolutionDir Condition=" '$(OS)' == 'Windows_NT'">"$(SolutionDir) "</PaddedSolutionDir>
|
54
|
-
<PaddedSolutionDir Condition=" '$(OS)' != 'Windows_NT' ">"$(SolutionDir)"</PaddedSolutionDir>
|
55
|
-
|
56
|
-
<!-- Commands -->
|
57
|
-
<RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir)</RestoreCommand>
|
58
|
-
<BuildCommand>$(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols</BuildCommand>
|
59
|
-
|
60
|
-
<!-- We need to ensure packages are restored prior to assembly resolve -->
|
61
|
-
<BuildDependsOn Condition="$(RestorePackages) == 'true'">
|
62
|
-
RestorePackages;
|
63
|
-
$(BuildDependsOn);
|
64
|
-
</BuildDependsOn>
|
65
|
-
|
66
|
-
<!-- Make the build depend on restore packages -->
|
67
|
-
<BuildDependsOn Condition="$(BuildPackage) == 'true'">
|
68
|
-
$(BuildDependsOn);
|
69
|
-
BuildPackage;
|
70
|
-
</BuildDependsOn>
|
71
|
-
</PropertyGroup>
|
72
|
-
|
73
|
-
<Target Name="CheckPrerequisites">
|
74
|
-
<!-- Raise an error if we're unable to locate nuget.exe -->
|
75
|
-
<Error Condition="'$(DownloadNuGetExe)' != 'true' AND !Exists('$(NuGetExePath)')" Text="Unable to locate '$(NuGetExePath)'" />
|
76
|
-
<!--
|
77
|
-
Take advantage of MsBuild's build dependency tracking to make sure that we only ever download nuget.exe once.
|
78
|
-
This effectively acts as a lock that makes sure that the download operation will only happen once and all
|
79
|
-
parallel builds will have to wait for it to complete.
|
80
|
-
-->
|
81
|
-
<MsBuild Targets="_DownloadNuGet" Projects="$(MSBuildThisFileFullPath)" Properties="Configuration=NOT_IMPORTANT;DownloadNuGetExe=$(DownloadNuGetExe)" />
|
82
|
-
</Target>
|
83
|
-
|
84
|
-
<Target Name="_DownloadNuGet">
|
85
|
-
<DownloadNuGet OutputFilename="$(NuGetExePath)" Condition=" '$(DownloadNuGetExe)' == 'true' AND !Exists('$(NuGetExePath)')" />
|
86
|
-
</Target>
|
87
|
-
|
88
|
-
<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
|
89
|
-
<Exec Command="$(RestoreCommand)"
|
90
|
-
Condition="'$(OS)' != 'Windows_NT' And Exists('$(PackagesConfig)')" />
|
91
|
-
|
92
|
-
<Exec Command="$(RestoreCommand)"
|
93
|
-
LogStandardErrorAsError="true"
|
94
|
-
Condition="'$(OS)' == 'Windows_NT' And Exists('$(PackagesConfig)')" />
|
95
|
-
</Target>
|
96
|
-
|
97
|
-
<Target Name="BuildPackage" DependsOnTargets="CheckPrerequisites">
|
98
|
-
<Exec Command="$(BuildCommand)"
|
99
|
-
Condition=" '$(OS)' != 'Windows_NT' " />
|
100
|
-
|
101
|
-
<Exec Command="$(BuildCommand)"
|
102
|
-
LogStandardErrorAsError="true"
|
103
|
-
Condition=" '$(OS)' == 'Windows_NT' " />
|
104
|
-
</Target>
|
105
|
-
|
106
|
-
<UsingTask TaskName="DownloadNuGet" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
|
107
|
-
<ParameterGroup>
|
108
|
-
<OutputFilename ParameterType="System.String" Required="true" />
|
109
|
-
</ParameterGroup>
|
110
|
-
<Task>
|
111
|
-
<Reference Include="System.Core" />
|
112
|
-
<Using Namespace="System" />
|
113
|
-
<Using Namespace="System.IO" />
|
114
|
-
<Using Namespace="System.Net" />
|
115
|
-
<Using Namespace="Microsoft.Build.Framework" />
|
116
|
-
<Using Namespace="Microsoft.Build.Utilities" />
|
117
|
-
<Code Type="Fragment" Language="cs">
|
118
|
-
<![CDATA[
|
119
|
-
try {
|
120
|
-
OutputFilename = Path.GetFullPath(OutputFilename);
|
121
|
-
|
122
|
-
Log.LogMessage("Downloading latest version of NuGet.exe...");
|
123
|
-
WebClient webClient = new WebClient();
|
124
|
-
webClient.DownloadFile("https://www.nuget.org/nuget.exe", OutputFilename);
|
125
|
-
|
126
|
-
return true;
|
127
|
-
}
|
128
|
-
catch (Exception ex) {
|
129
|
-
Log.LogErrorFromException(ex);
|
130
|
-
return false;
|
131
|
-
}
|
132
|
-
]]>
|
133
|
-
</Code>
|
134
|
-
</Task>
|
135
|
-
</UsingTask>
|
136
|
-
</Project>
|
@@ -1,19 +0,0 @@
|
|
1
|
-
using System;
|
2
|
-
using System.IO;
|
3
|
-
|
4
|
-
namespace openstack.net
|
5
|
-
{
|
6
|
-
public class RunChallenge
|
7
|
-
{
|
8
|
-
public static void Main (string[] args)
|
9
|
-
{
|
10
|
-
// Pacto cannot currently validate 100-Continue responses. See https://github.com/thoughtworks/pacto/issues/87
|
11
|
-
System.Net.ServicePointManager.Expect100Continue = false;
|
12
|
-
var challenge = Path.GetFileNameWithoutExtension(args[0]);
|
13
|
-
var challenge_class = Type.GetType("openstack.net." + challenge);
|
14
|
-
var challenge_object = Activator.CreateInstance(challenge_class) as Challenge;
|
15
|
-
challenge_object.Run(args);
|
16
|
-
}
|
17
|
-
}
|
18
|
-
}
|
19
|
-
|
@@ -1,24 +0,0 @@
|
|
1
|
-
using System;
|
2
|
-
using net.openstack.Providers.Rackspace;
|
3
|
-
using net.openstack.Core.Providers;
|
4
|
-
using net.openstack.Core.Exceptions.Response;
|
5
|
-
using net.openstack.Providers.Rackspace.Objects;
|
6
|
-
|
7
|
-
namespace openstack.net
|
8
|
-
{
|
9
|
-
class AuthenticateToken : Challenge
|
10
|
-
{
|
11
|
-
public int Run (string[] args)
|
12
|
-
{
|
13
|
-
var auth_url = new Uri(Environment.GetEnvironmentVariable ("RAX_AUTH_URL"));
|
14
|
-
Console.WriteLine ("Connecting to " + auth_url);
|
15
|
-
IIdentityProvider identityProvider = new CloudIdentityProvider (null, null, null, auth_url);
|
16
|
-
identityProvider.Authenticate (new RackspaceCloudIdentity {
|
17
|
-
Username = Environment.GetEnvironmentVariable("RAX_USERNAME"),
|
18
|
-
APIKey = Environment.GetEnvironmentVariable("RAX_API_KEY")
|
19
|
-
});
|
20
|
-
Console.WriteLine ("Authenticated!");
|
21
|
-
return 0;
|
22
|
-
}
|
23
|
-
}
|
24
|
-
}
|