Skip to content

Commit f01d6d6

Browse files
author
Ranjan Kumar
committed
Initial Commit
0 parents  commit f01d6d6

30 files changed

+933
-0
lines changed

.gitignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
*.gem
2+
*.rbc
3+
.bundle
4+
.config
5+
.yardoc
6+
Gemfile.lock
7+
InstalledFiles
8+
_yardoc
9+
coverage
10+
doc/
11+
lib/bundler/man
12+
pkg
13+
rdoc
14+
spec/reports
15+
test/tmp
16+
test/version_tmp
17+
tmp
18+
*.bundle
19+
*.so
20+
*.o
21+
*.a
22+
mkmf.log
23+
gemfiles/*.lock

CONTRIBUTING.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
## Getting Involved
2+
3+
New contributors are always welcome, when it doubt please ask questions. We strive to be an open and welcoming community. Please be nice to one another.
4+
5+
### Coding
6+
7+
* Pick a task:
8+
* Offer feedback on open [pull requests](https://github.com/fog/fog-azure/pulls).
9+
* Review open [issues](https://github.com/fog/fog-azure/issues) for things to help on.
10+
* [Create an issue](https://github.com/fog/fog-azure/issues/new) to start a discussion on additions or features.
11+
* Fork the project, add your changes and tests to cover them in a topic branch.
12+
* Commit your changes and rebase against `fog/fog-azure` to ensure everything is up to date.
13+
* [Submit a pull request](https://github.com/fog/fog-azure/compare/)
14+
15+
### Non-Coding
16+
17+
* Offer feedback on open [issues](https://github.com/fog/fog-azure/issues).
18+
* Organize or volunteer at events.

CONTRIBUTORS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
* Jeff Mendoza <[email protected]>
2+
* Ranjan Kumar <[email protected]>
3+
4+

Gemfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
source 'https://rubygems.org'
2+
3+
# Specify your gem's dependencies in fog-azure.gemspec
4+
gemspec

LICENSE.md

Whitespace-only changes.

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Fog::Azure
2+
3+
Module for the 'fog' gem to support Windows Azure
4+
5+
## Help Needed
6+
7+
This gem needs a maintainer. If you want to work on it, please contact
8+
[@jeffmendoza](mailto:[email protected]) or [@ranjan](mailto:[email protected])
9+
10+
## Installation
11+
12+
Add this line to your application's Gemfile:
13+
14+
```ruby
15+
gem 'fog-azure'
16+
```
17+
18+
And then execute:
19+
20+
$ bundle
21+
22+
Or install it yourself as:
23+
24+
$ gem install fog-azure
25+
26+
## Usage
27+
28+
TODO: Write usage instructions here
29+
30+
## Contributing
31+
32+
1. Fork it ( https://github.com/fog/fog-azure/fork )
33+
2. Create your feature branch (`git checkout -b my-new-feature`)
34+
3. Commit your changes (`git commit -am 'Add some feature'`)
35+
4. Push to the branch (`git push origin my-new-feature`)
36+
5. Create a new Pull Request

Rakefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
require 'bundler/gem_tasks'
2+
require 'rake/testtask'
3+
4+
Rake::TestTask.new do |t|
5+
t.libs.push %w(spec)
6+
t.test_files = FileList['spec/**/*_spec.rb']
7+
t.verbose = true
8+
end
9+
10+
desc 'Default Task'
11+
task :default => :test

fog-azure.gemspec

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# coding: utf-8
2+
lib = File.expand_path('../lib', __FILE__)
3+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4+
require 'fog/azure/version'
5+
6+
Gem::Specification.new do |spec|
7+
spec.name = "fog-azure"
8+
spec.version = Fog::AZURE::VERSION
9+
spec.authors = ["Jeff Mendoza", "Ranjan Kumar"]
10+
11+
spec.summary = %q{Module for the 'fog' gem to support Azure cloud services.}
12+
spec.description = %q{This library can be used as a module for `fog` or as standalone provider
13+
to use the Azure cloud services in applications..}
14+
spec.homepage = "http://github.com/fog/fog-azure"
15+
spec.license = "MIT"
16+
17+
spec.files = `git ls-files -z`.split("\x0")
18+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
19+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20+
spec.require_paths = ["lib"]
21+
22+
spec.add_development_dependency 'bundler', '~> 1.6'
23+
spec.add_development_dependency 'rake', '~> 10.0'
24+
spec.add_development_dependency 'shindo', '~> 0.3'
25+
spec.add_development_dependency('azure', '~>0.6')
26+
27+
spec.add_dependency 'fog-core', '~> 1.27'
28+
spec.add_dependency 'fog-json', '~> 1.0'
29+
spec.add_dependency 'fog-xml', '~> 0.1'
30+
end

lib/fog/azure.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
require 'fog/azure/version'
2+
3+
module Fog
4+
module AZURE
5+
end
6+
end
7+
8+
require 'fog/azure/core'
9+
require 'fog/azure/compute'

lib/fog/azure/compute.rb

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
require "fog/azure/core"
2+
3+
module Fog
4+
module Compute
5+
class Azure < Fog::Service
6+
requires :azure_sub_id
7+
requires :azure_pem
8+
9+
recognizes :azure_api_url
10+
11+
request_path "fog/azure/requests/compute"
12+
request :list_virtual_machines
13+
request :create_virtual_machine
14+
request :delete_virtual_machine
15+
request :get_storage_account
16+
request :create_storage_account
17+
request :list_storage_accounts
18+
request :delete_storage_account
19+
request :reboot_server
20+
request :shutdown_server
21+
request :start_server
22+
request :list_images
23+
24+
model_path "fog/azure/models/compute"
25+
model :server
26+
collection :servers
27+
model :storage_account
28+
collection :storage_accounts
29+
model :image
30+
collection :images
31+
32+
class Mock
33+
def initialize(options={})
34+
begin
35+
require "azure"
36+
rescue LoadError => e
37+
retry if require("rubygems")
38+
raise e.message
39+
end
40+
end
41+
end
42+
43+
class Real
44+
def initialize(options)
45+
begin
46+
require "azure"
47+
rescue LoadError => e
48+
retry if require("rubygems")
49+
raise e.message
50+
end
51+
::Azure.configure do |cfg|
52+
cfg.management_certificate = options[:azure_pem]
53+
cfg.subscription_id = options[:azure_sub_id]
54+
cfg.management_endpoint = options[:azure_api_url] || \
55+
"https://management.core.windows.net"
56+
end
57+
@vm_svc = ::Azure::VirtualMachineManagementService.new
58+
@stg_svc = ::Azure::StorageManagementService.new
59+
@image_svc = ::Azure::VirtualMachineImageManagementService.new
60+
end
61+
end
62+
end
63+
end
64+
end

0 commit comments

Comments
 (0)