Giter Club home page Giter Club logo

azure-armrest's Introduction

Description

A Ruby interface for Azure using the new REST API.

Synopsis

require 'azure/armrest'

# Set things on a global level. All other objects will then use the
# information you set here.

Azure::ArmRest::ArmRestManager.configure(
  :client_id       => 'XXXXX',
  :client_key      => 'YYYYY',
  :tenant_id       => 'ZZZZZ',
  :subscription_id => 'ABCDEFG'
)

# This will then use the configuration info set above.
vmm = Azure::ArmRest::VirtualMachineManager.new

# Alternatively you can set the configuration information on a per-instance
# basis if you need different credentials for different classes.
vmm = Azure::ArmRest::VirtualMachineManager.new(
  :client_id       => 'XXXXX',
  :client_key      => 'YYYYY',
  :tenant_id       => 'ZZZZZ',
  :subscription_id => 'ABCDEFG'
)

# Call this before making method calls if using per-instance configuration.
# This is not necessary if you set it via ArmRestManager.configure.
vmm.get_token

# Create a virtual machine
vmm.create_virtual_machine(
  :name           => 'some_vm',
  :location       => 'West US', 
  :vm_size        => 'Standard_A1',
  :computer_name  => 'whatever',
  :admin_username => 'admin_user',
  :admin_password => 'adminxxxxxx',
  :os_disk        => {:name => 'disk_name1', :os_type => 'Linux', :caching => 'read'},
  :data_disks     => {:name => 'data_disk1', :lun => 0, :caching => 'read'}
)

= Tokens and methods You will not be able to make any method calls until you first call the get_token method.

= Subscriptions If you do not provide a subscription ID to the constructor, then the first subscription ID returned from a REST call will be used.

= Notes Currently only the client credentials strategy is supported. Support for other strategies may be added over time.

= Authors

  • Daniel Berger
  • Bronagh Sorota

azure-armrest's People

Contributors

djberg96 avatar

Watchers

 avatar  avatar

Forkers

tubbz-alt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.