azure 0.7.5 → 0.7.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ODRlOGE5Nzk1YmFiZjQ5YTk3NTMwODYxYmNlNjcxMWUyMDBkNTlmZA==
4
+ ZmZkYTMzZjlmNjM4NmM1NTFkYTdmZGY1MDFhNzM5ZjMwZjg0OWUyMA==
5
5
  data.tar.gz: !binary |-
6
- Yzg0NDFlZGViNWE0NWVmZTExMTMzN2I0MGE5YjAyMGYyZDEwOTAwMg==
6
+ YmY4NjVkZjEwNmY0MTFkMWEyYjI1NjM0N2U1MmNmMTc1NDY1YzM5YQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NDVjYTIzNDFlMTExNzA1NzQ1Y2Y5MzQ5OWY0ZmQ5NThiMmIzMTg3M2ZkOGQ1
10
- MzExMWM0ZDg3ZDQzNzg0YzYwYzAzNzViZjc3NzRlNWIwZWUyMzk0NmNhZjBm
11
- OTYyZDQzNDExZWIwMmQxMGM5NDVhYWI1ZDI4M2RlOTdmZDA1YWM=
9
+ ZGNiZGQzNGQ2M2I5YWI3NTQwMjE1OTBlY2ZlMmJlNjdjZDI0YTM3ZWY2Zjcz
10
+ ZjY0ZDg2NGZiYTNhMWRmNjkzNWViMGI4MTAyNzczZWI5ZDNlNDVlMjdkNmRl
11
+ OGNlZjY3ZjJlODlmZmMwYmMzNDVjOGI0NTE5NDBkNDFhYTMxZmY=
12
12
  data.tar.gz: !binary |-
13
- NzZkYmU0ZTU4MDRlZmU1ODRhZjIyMTg5Yzg0ZTQzMmExZTQ1NjE3NjQwYmE5
14
- MGU2ZDk0YmNjM2I5MWI4M2I5NDQ2OTlkMWY0MTgwNzY5OTBjNzAyNDNiZWY2
15
- ODlkMjIwOGUyYTIyZmM5ZjQwMTMyYmEzMTA2MDEwMmM5NGM2ZTA=
13
+ NTMwNDhjMDdjOWNiYWQ3M2E5NGM1ZTNhYjI3MDhjNGNkOTNhNGQ2MjRlNTJi
14
+ NzY1NjBmZDU4OWI0NDcyNzFhY2MzNTE2NjFkMGJhNzAyYTUxYWE5NmZkZDJm
15
+ NjUyYTNhY2ZjOTI1MTE3ZjhmODY5MmU1NTBmMzUzOTBkMWFiYmE=
@@ -0,0 +1,32 @@
1
+ .rvmrc
2
+ *.gem
3
+ *.rbc
4
+ *.swp
5
+ *.tmproj
6
+ *~
7
+ .\#*
8
+ tags
9
+ /pkg
10
+ /doc
11
+ Gemfile.lock
12
+ nbproject/*
13
+ *.gem
14
+ .idea
15
+ .project
16
+ .bundle
17
+ .config
18
+ .yardoc
19
+ _yardoc
20
+ coverage
21
+ doc/
22
+ lib/bundler/man
23
+ pkg
24
+ rdoc
25
+
26
+
27
+ .DS_Store
28
+ .ruby-version
29
+ .env
30
+ *.pem
31
+ !service_management/azure/test/fixtures/management_certificate.pem
32
+ *.publishsettings
@@ -0,0 +1,19 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.0.0
5
+ - 2.1.5
6
+ - 2.2.0
7
+ - 2.3.0
8
+ script:
9
+ - bundle install && bundle exec rake test:unit
10
+ - if [ "$INTEG_RECORDED" == "true" ] ; then bundle exec rake test:recorded ; fi
11
+ deploy:
12
+ provider: rubygems
13
+ api_key:
14
+ secure: VXi28DFUnQ7tYuvOwwfs4Og0/Wkfq4GWMtU9Wjgn6VuYMuRMzMD34acIpgqCDW4dVLlsCtvx1MIZLvaHe0F5nOJP1LZ88IW8bDEa2dSRMhXXKGf/CF9sOhMxK9uoThMp7FHMSttfasudooIsrQn9FExdCs5s7ndDQ+gOD/QHKjk=
15
+ gem: azure
16
+ on:
17
+ tags: true
18
+ repo: Azure/azure-sdk-for-ruby
19
+ branch: asm
@@ -0,0 +1,134 @@
1
+ ## 2016.9.1 - Azure Gems @version 0.7.6
2
+ * Fixing Service Bus authorization with SAS [#425](https://github.com/Azure/azure-sdk-for-ruby/commit/09ab24e511889d41a1fef4755217baa595a279f5)
3
+ * Adding require for azure/core and autoload Auth::SharedAccessSigner [#443](https://github.com/Azure/azure-sdk-for-ruby/pull/443)
4
+ * Blacklist strict-transport-security, it crashes the JSON parser when receiving Service Bus messages [#432](https://github.com/Azure/azure-sdk-for-ruby/pull/432)
5
+ * Replace uuid gem with SecureRandom [#394](https://github.com/Azure/azure-sdk-for-ruby/commit/1d25e563c6c21aaa42cb77ce08bba1303656700b)
6
+
7
+ ## 2016.5.2 - Azure Gems @version 0.7.5
8
+ * Require azure/core before extending serialization class with it [#383](https://github.com/Azure/azure-sdk-for-ruby/pull/383)
9
+
10
+ ## 2016.4.18 - Azure Gems @version 0.7.4
11
+ * Signing key must be provided (ArgumentError) [#367](https://github.com/Azure/azure-sdk-for-ruby/issues/367)
12
+ * Can not upload file with spaces [#360](https://github.com/Azure/azure-sdk-for-ruby/issues/360)
13
+ * Updating gem to consume 'azure-core' [gem](https://rubygems.org/gems/azure-core), [Git repo](https://github.com/Azure/azure-ruby-asm-core)
14
+
15
+ ## 2016.4.12 - Azure Gems @version 0.7.3
16
+ * Support for VCR recorded test enabled
17
+ * Following Issues were addressed [April Release Closed Issues](https://github.com/Azure/azure-sdk-for-ruby/issues?q=milestone%3A%22April+Release%22+is%3Aclosed)
18
+
19
+ ## 2016.03.11 Azure::ARM Gems @version 0.2.1
20
+ * fix the require for module_definition via [#327](https://github.com/Azure/azure-sdk-for-ruby/issues/327)
21
+
22
+ ## 2016.03.11 Azure::ARM Gems @version 0.2.0
23
+ * azure_mgmt_compute version 0.2.0
24
+ * http://www.rubydoc.info/gems/azure_mgmt_compute
25
+ * added scale sets
26
+ * warn on vm_size unknown
27
+ * azure_mgmt_network version 0.2.0
28
+ * added express route
29
+ * added route tables
30
+ * breaking change: public_ip_addresses became public_ipaddresses
31
+ * azure_mgmt_resource version 0.2.0
32
+ * added policy_assignments and policy_definitions
33
+ * updated to the latest api_version (2015-11-01)
34
+ * azure_mgmt_storage version 0.2.0
35
+ * update to the latest api_version (2015-06-15)
36
+ * azure_mgmt_cdn version 0.2.0
37
+ * [Azure CDN management SDK](https://azure.microsoft.com/en-us/services/cdn/)
38
+ * initial release: http://www.rubydoc.info/gems/azure_mgmt_cdn
39
+ * azure_mgmt_authorization version 0.2.0
40
+ * [Azure Role Based Authorization management SDK](https://azure.microsoft.com/en-us/documentation/articles/role-based-access-control-configure/)
41
+ * initial release: http://www.rubydoc.info/gems/azure_mgmt_authorization
42
+ * azure_mgmt_features version 0.2.0
43
+ * [Azure Feature Exposure Control management SDK](https://msdn.microsoft.com/en-us/library/azure/mt592690.aspx)
44
+ * initial release: http://www.rubydoc.info/gems/azure_mgmt_features
45
+ * azure_mgmt_graph version 0.2.0
46
+ * [Azure Active Directory Graph SDK](https://msdn.microsoft.com/en-us/library/azure/hh974476.aspx)
47
+ * initial release: http://www.rubydoc.info/gems/azure_mgmt_graph
48
+ * azure_mgmt_locks version 0.2.0
49
+ * [Azure Resource Management Locks SDK](https://msdn.microsoft.com/en-us/library/azure/mt204563.aspx)
50
+ * initial release: http://www.rubydoc.info/gems/azure_mgmt_locks
51
+ * azure_mgmt_notification_hubs
52
+ * [Azure Notification Hubs Management SDK](https://azure.microsoft.com/en-us/documentation/services/notification-hubs/)
53
+ * initial release: http://www.rubydoc.info/gems/azure_mgmt_notification_hubs
54
+ * azure_mgmt_redis version 0.2.0
55
+ * [Azure Redis Management SDK](https://azure.microsoft.com/en-us/services/cache/)
56
+ * initial release: http://www.rubydoc.info/gems/azure_mgmt_redis
57
+ * azure_mgmt_scheduler version 0.2.0
58
+ * [Azure Scheduler Management SDK](https://azure.microsoft.com/en-us/services/scheduler/)
59
+ * initial release: http://www.rubydoc.info/gems/azure_mgmt_scheduler
60
+ * azure_mgmt_search version 0.2.0
61
+ * [Azure Search Management SDK](https://azure.microsoft.com/en-us/services/search/)
62
+ * initial release: http://www.rubydoc.info/gems/azure_mgmt_search
63
+ * azure_mgmt_sql version 0.2.0
64
+ * [Azure SQL Management SDK](https://azure.microsoft.com/en-us/services/sql-database/)
65
+ * initial release: http://www.rubydoc.info/gems/azure_mgmt_sql
66
+ * azure_mgmt_subscriptions version 0.2.0
67
+ * [Azure Subscriptions Management SDK](https://azure.microsoft.com/en-us/services/sql-database/)
68
+ * initial release: http://www.rubydoc.info/gems/azure_mgmt_subscriptions
69
+ * azure_mgmt_web version 0.2.0
70
+ * [Azure WebApp Managment SDK](https://azure.microsoft.com/en-us/services/app-service/web/)
71
+ * initial release: http://www.rubydoc.info/gems/azure_mgmt_web
72
+
73
+ ## 2015.8.28 - Azure version 0.7.1
74
+ * Documentation updates to the readme
75
+ * Content encoding adapted for Blobs in the case of IO or String
76
+ * Make sure that auto_generated certificate is uploaded with add_role for Cloud Services
77
+ * Fix issue of autoloading VirtualMachineDiskManagementService
78
+
79
+ ## 2015.05.06 - Azure version 0.7.0.pre
80
+ * Upgraded ASM versioning to 2014-06-01
81
+ * Added the ability to use personal vm images not just gallery images
82
+ * Namespaced all of the things so there is no leakage
83
+ * Added proper support for .pfx
84
+ * Added bin to transform .publishsettings files to .pfx files
85
+ * Added support for Azure.config.management_certificate as string
86
+ * Added ms-blob-content-disposition support, bump blob `x-ms-version` header to `2013-08-15`
87
+ * Fixed KeepAlive and timeout for blobs
88
+ * VM sizes are available -- we just warn if they are not in our list
89
+ * Support for nokogiri on windows
90
+ * Ability to delete a staging deployment of a cloud service
91
+ * Peek_lock fixed for service bus
92
+ * Support for creating shared access signatures
93
+
94
+
95
+ ## 2014.05.06 - Azure version 0.6.4
96
+ * Upgraded Service Management Versioning to 2014-04-01
97
+ * Created separate API for add role
98
+ * Logical Unit Number(lun) is optional argument in API add_data_disk
99
+ * Cloud service should delete only if there are no other VMs/Deployments in the cloud service
100
+ * Added more sizes(Basic_A0, Basic_A1, Basic_A2, Basic_A3, Basic_A4) options for Virtual Machine and Cloud Service.
101
+
102
+ ## 2014.03.28 - Azure version 0.6.3
103
+ * Added get_cloud_service_properties method, which returns all cloud service properties (embed-detail=true), including info about all VMs
104
+ * Added winrm_http_port and winrm_https_port to get_virtual_machine method to allow the users to configure custom ports for winrm-http and winrm-https
105
+ * Checks if any ports are in use before adding a role in the existing cloud service
106
+ * Auto generate public port for add role.
107
+ * Fix issue https://github.com/Azure/azure-sdk-for-ruby/issues/130
108
+
109
+ ## 2014.03.15 - Azure version 0.6.2
110
+ * Restart Virtual Machine
111
+ * Add disk to Virtual Machine
112
+ * Add/Update Virtual Machine endpoints
113
+ * Delete Virtual Machine endpoint
114
+
115
+ ## 2014.02.18 - Azure version 0.6.1
116
+ * Fixed http redirection error
117
+ * Add a new role to existing deployment
118
+ * Add support for including VMs in availability sets
119
+
120
+ ## 2013.12.02 - Azure version 0.6.0
121
+ * Add the following service management API
122
+ * Virtual Machine
123
+ * Virtual Machine Image
124
+ * Virtual Network
125
+ * Cloud Service
126
+ * Storage
127
+ * Sql Database
128
+ * Location and Affinity Group
129
+
130
+ ## 2013.04.25 - Azure version 0.5.0
131
+ * First release
132
+ * Ruby 1.9.3 and 2.0 support
133
+ * Storage support: Blob, Table and Queue
134
+ * Service Bus support: Queue, Topic/Subscription
@@ -0,0 +1,567 @@
1
+ # Microsoft Azure SDK for Ruby - ASM
2
+ [![Build Status](https://travis-ci.org/Azure/azure-sdk-for-ruby.png?branch=asm)](https://travis-ci.org/Azure/azure-sdk-for-ruby) [![Gem Version](https://badge.fury.io/rb/azure.svg)](https://badge.fury.io/rb/azure)
3
+
4
+ This project provides a Ruby package for Azure Service Management, which makes it easy to access and manage Microsoft Azure Services like Storage, Service Bus and Virtual Machines.
5
+ * **Azure Service Management (ASM) or Classic**: Supported by most existing Azure resources.
6
+
7
+ If you're looking for **Azure Resource Management (ARM)**, preview version of the Ruby SDK is available [here](https://github.com/Azure/azure-sdk-for-ruby)
8
+
9
+ Information on Azure deployment models: [https://azure.microsoft.com/en-us/documentation/articles/azure-classic-rm/](https://azure.microsoft.com/en-us/documentation/articles/azure-classic-rm/)
10
+
11
+ ## Azure Service Management
12
+ * Cloud Service Management
13
+ * [SQL Database Server Management](https://github.com/Azure/azure-sdk-for-ruby/tree/asm#sql)
14
+ * Storage Account Management
15
+ * [Virtual Network Management](https://github.com/Azure/azure-sdk-for-ruby/tree/asm#vnets)
16
+
17
+ ## Azure Services
18
+ * [Storage](https://github.com/Azure/azure-sdk-for-ruby/tree/asm#storage)
19
+ Azure Storage is now availabe in its own preview gem and GitHub [repo](https://github.com/Azure/azure-storage-ruby)
20
+ * [Service Bus](https://github.com/Azure/azure-sdk-for-ruby/tree/asm#usage)
21
+ * [Relays](https://github.com/Azure/azure-sdk-for-ruby/tree/asm#relays)
22
+ * [Topics](https://github.com/Azure/azure-sdk-for-ruby/tree/asm#topics)
23
+ * Queues
24
+
25
+ # Supported Ruby Versions
26
+
27
+ * Ruby 2+
28
+
29
+ Note: x64 Ruby for Windows is known to have some compatibility issues.
30
+
31
+ # Getting Started with Azure Service Management
32
+
33
+ ## Install the rubygem package
34
+
35
+ You can install the azure rubygem package directly.
36
+
37
+ ```bash
38
+ gem install azure
39
+ ```
40
+ :warning: Azure storage is moving into its own azure-storage [gem](https://rubygems.org/gems/azure-storage) and [GitHub repo](https://github.com/Azure/azure-storage-ruby). It's in preview today.
41
+
42
+ ## Setup Connection
43
+
44
+ You can use this SDK against the Microsoft Azure Services in the cloud, or against the local Storage Emulator if you are on Windows. Service Bus and Microsoft Azure Service Management emulation are not supported. Of course, to use the Microsoft Azure Services in the cloud, you need to first [create a Microsoft Azure account](http://www.azure.com/en-us/pricing/free-trial/). After that, you can get the information you need to configure Storage and Service Bus from the [Microsoft Azure Portal](https://manage.windowsazure.com).
45
+
46
+ There are two ways you can set up the connections:
47
+
48
+ 1. [via code](#via-code)
49
+ 2. [via environment variables](#via-environment-variables)
50
+
51
+ <a name="via-code"></a>
52
+ ### Via Code
53
+ * Against Microsoft Azure Services in the cloud
54
+
55
+ ```ruby
56
+
57
+ require "azure"
58
+
59
+ Azure.storage_account_name = "<your azure storage account name>"
60
+ Azure.storage_access_key = "<your azure storage access key>"
61
+
62
+ # Configure these 3 properties to use Service Bus
63
+ Azure.sb_namespace = "<your azure service bus namespace>"
64
+ Azure.sb_access_key = "<your azure service bus access key>"
65
+ Azure.sb_issuer = "<your azure service bus issuer>"
66
+
67
+ # Configure these 3 properties to use Service Management. We support passwordless pfx & pem cert formats.
68
+ Azure.management_certificate = "<path to your *.pem or *.pfx>"
69
+ Azure.subscription_id = "<your Subscriptionid>"
70
+
71
+ # Configure a ca_cert.pem file if you are having issues with ssl peer verification
72
+ Azure.ca_file = "./ca_file.pem"
73
+
74
+ # Or create a specific instance of an Azure.client, which will inherit your default configuration settings.
75
+ client = Azure.client(storage_account_name: "your account name", storage_access_key: "your access key")
76
+
77
+ ```
78
+
79
+ * Against local Emulator (Windows Only)
80
+
81
+ ```ruby
82
+
83
+ require "azure"
84
+
85
+ # Configure these 2 properties to use local Storage Emulator
86
+ Azure.storage_account_name = "devstoreaccount1"
87
+ Azure.storage_access_key = "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw=="
88
+
89
+ Azure.storage_blob_host = "http://127.0.0.1:10000/devstoreaccount1"
90
+ Azure.storage_queue_host = "http://127.0.0.1:10001/devstoreaccount1"
91
+ Azure.storage_table_host = "http://127.0.0.1:10002/devstoreaccount1"
92
+
93
+ # For Azure Government make sure to provide the full URI to the endpoint
94
+ # End point mapping at https://azure.microsoft.com/en-us/documentation/articles/azure-government-developer-guide/
95
+
96
+ # Local Service Bus Emulator is not supported
97
+ # Local Service Management emulation is not supported
98
+
99
+ ```
100
+
101
+ <a name="via-environment-variables"></a>
102
+ ### Via Environment Variables
103
+
104
+ * Against Microsoft Azure Services in the cloud
105
+
106
+ * Storage
107
+
108
+ ```bash
109
+ AZURE_STORAGE_ACCOUNT = <your azure storage account name>
110
+ AZURE_STORAGE_ACCESS_KEY = <your azure storage access key>
111
+ ```
112
+ * Service Bus
113
+
114
+ ```bash
115
+ AZURE_SERVICEBUS_NAMESPACE = <your azure service bus namespace>
116
+ AZURE_SERVICEBUS_ACCESS_KEY = <your azure service bus access key>
117
+ AZURE_SERVICEBUS_ISSUER = <your azure service bus issuer>
118
+ ```
119
+ * Service Management
120
+
121
+ ```bash
122
+ AZURE_MANAGEMENT_CERTIFICATE = <path to *.pem or *.pfx>
123
+ AZURE_SUBSCRIPTION_ID = <your subscription ID>
124
+ AZURE_MANAGEMENT_ENDPOINT = <The endpoint URL of Microsoft Azure management service>
125
+ AZURE_SQL_DATABASE_MANAGEMENT_ENDPOINT = <SQL Database Management Endpoint>
126
+ AZURE_SQL_DATABASE_AUTHENTICATION_MODE = <:management_certificate or :sql_server>
127
+ ```
128
+ * [SSL Certificate File](https://gist.github.com/fnichol/867550)
129
+
130
+ ```bash
131
+ SSL_CERT_FILE=<path to *.pem>
132
+ ```
133
+ * Against local Emulator (Windows Only)
134
+
135
+ * Storage
136
+
137
+ ```bash
138
+ AZURE_STORAGE_ACCOUNT = devstoreaccount1
139
+ AZURE_STORAGE_ACCESS_KEY = Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==
140
+ AZURE_STORAGE_BLOB_HOST = http://127.0.0.1:10000/devstoreaccount1
141
+ AZURE_STORAGE_QUEUE_HOST = http://127.0.0.1:10001/devstoreaccount1
142
+ AZURE_STORAGE_TABLE_HOST = http://127.0.0.1:10002/devstoreaccount1
143
+ ```
144
+ * Service Bus: not supported
145
+
146
+ * Service Management: not supported
147
+
148
+ # Usage
149
+
150
+ <a name="storage"></a>
151
+ ## Storage
152
+
153
+ ### Setup your Storage Credentials
154
+
155
+ ```ruby
156
+
157
+ # Require the azure rubygem
158
+ require "azure"
159
+
160
+ # Add your default storage credentials
161
+ Azure.storage_account_name = "your account name"
162
+ Azure.storage_access_key = "your access key"
163
+
164
+ # Or create a specific instance of an Azure.client
165
+ client = Azure.client(storage_account_name: "your account name", storage_access_key: "your access key")
166
+
167
+ default_blobs = Azure.blobs # uses the Azure.storage_account_name and Azure.storage_access_key
168
+
169
+ blobs = client.blobs # uses the client.storage_account_name and client.storage_access_key
170
+
171
+ ```
172
+ Azure storage is available its own azure-storage [gem](https://rubygems.org/gems/azure-storage) and [GitHub repo](https://github.com/Azure/azure-storage-ruby)
173
+
174
+ <a name="relays"></a>
175
+ ### Relay
176
+
177
+ ```ruby
178
+
179
+ # Require the azure rubygem
180
+ require "azure"
181
+
182
+ # Create an azure service bus object
183
+ service_bus = Azure.service_bus
184
+
185
+ # Create a relay endpoint with just the endpoint name
186
+ relay1 = service_bus.create_relay("test-relay-1", { :relay_type => "Http" })
187
+
188
+ # Create a relay endpoint with a relay object
189
+ relay2 = Azure::ServiceBus::Relay.new("test-relay-2")
190
+ relay2.requires_client_authorization = false
191
+ relay2 = service_bus.create_relay(relay2)
192
+
193
+ # Delete a relay endpoint
194
+ service_bus.delete_relay("test-relay2")
195
+
196
+ ```
197
+
198
+ <a name="topics"></a>
199
+ ### Topics
200
+
201
+ ```ruby
202
+
203
+ # Require the azure rubygem
204
+ require "azure"
205
+
206
+ # Create an azure service bus object
207
+ service_bus = Azure.service_bus
208
+
209
+ # Create a topic with just the topic name
210
+ topic1 = service_bus.create_topic("test-topic-1")
211
+
212
+ # Create a topic with a topic object
213
+ topic2 = Azure::ServiceBus::Topic.new("test-topic-2")
214
+ topic2.max_size_in_megabytes = 2048
215
+ topic2 = service_bus.create_topic(topic2)
216
+
217
+ # Create a subscription
218
+ subscription = Azure::ServiceBus::Subscription.new("test-subscription-1")
219
+ subscription.topic = topic1.name
220
+ subscription = service_bus.create_subscription(subscription)
221
+
222
+ # Send a topic message with just the message body
223
+ azure_service_bus.send_topic_message(topic1, "test topic message")
224
+
225
+ # Send a topic message with a brokered message object
226
+ message = Azure::ServiceBus::BrokeredMessage.new("another test topic message")
227
+ message.correlation_id = "test-correlation-id-1"
228
+ service_bus.send_topic_message(topic1, message)
229
+
230
+ # Receive a subscription message
231
+ message = service_bus.receive_subscription_message(topic1.name, subscription.name)
232
+
233
+ # Delete a subscription message
234
+ service_bus.delete_subscription_message(message)
235
+
236
+ # Delete a subscription
237
+ service_bus.delete_subscription(subscription)
238
+
239
+ # Delete a topic
240
+ service_bus.delete_topic(topic1)
241
+
242
+ ```
243
+
244
+ <a name="vms"></a>
245
+ ## Virtual Machine Management
246
+
247
+ ```ruby
248
+
249
+ # Require the azure rubygem
250
+ require 'azure'
251
+
252
+ # Configure these properties
253
+ Azure.management_certificate = "path to *.pem or *.pfx file"
254
+ Azure.subscription_id = "your subscription id"
255
+
256
+ # Create a virtual machine service object
257
+ vm_management = Azure.vm_management
258
+
259
+ # Get a list of existing virtual machines in your subscription
260
+ vm_management.list_virtual_machines
261
+
262
+ # API to shutdown Virtual Machine
263
+ vm_management.shutdown_virtual_machine('vm_name', 'cloud_service_name')
264
+
265
+ # API to start Virtual Machine
266
+ vm_management.start_virtual_machine('vm_name', 'cloud_service_name')
267
+
268
+ # API to restart Virtual Machine
269
+ vm_management.restart_virtual_machine('vm_name', 'cloud_service_name')
270
+
271
+ # API for add disk to Virtual Machine
272
+ options = {
273
+ :disk_label => 'disk-label',
274
+ :disk_size => 100, #In GB
275
+ :import => false,
276
+ :disk_name => 'Disk name' #Required when import is true
277
+ }
278
+ vm_management.add_data_disk('vm_name', 'cloud_service_name', options)
279
+
280
+ # API to add/update Virtual Machine endpoints
281
+ endpoint1 = {
282
+ :name => 'ep-1',
283
+ :public_port => 996,
284
+ :local_port => 998,
285
+ :protocol => 'TCP',
286
+ }
287
+ endpoint2 = {
288
+ :name => 'ep-2',
289
+ :public_port => 997,
290
+ :local_port => 997,
291
+ :protocol => 'TCP',
292
+ :load_balancer_name => ‘lb-ep2’,
293
+ :load_balancer => {:protocol => 'http', :path => 'hello'}
294
+ }
295
+ vm_management.update_endpoints('vm_name', 'cloud_service_name', endpoint1, endpoint2)
296
+
297
+ # API to delete Virtual Machine endpoint
298
+ vm_management.delete_endpoint('vm_name', 'cloud_service_name', 'endpoint_name')
299
+
300
+ # API to delete Virtual Machine
301
+ options = {
302
+ :delete_vhd => true
303
+ }
304
+ vm_management.delete_virtual_machine('vm_name', 'cloud_service_name', options)
305
+
306
+ # API to start deployment
307
+ params = {
308
+ :vm_name => 'vm_name',
309
+ :vm_user => 'azureuser',
310
+ :image => '5112500ae3b842c8b9c604889f8753c3__OpenLogic-CentOS-63APR20130415',
311
+ :password => 'Password',
312
+ :location => 'West US'
313
+ }
314
+ options = {
315
+ :storage_account_name => 'storage_suse',
316
+ :cloud_service_name => 'cloud_service_name',
317
+ :deployment_name =>'vm_name',
318
+ :tcp_endpoints => '80,3389:3390',
319
+ :private_key_file => './private_key.key', # required for ssh
320
+ :ssh_port => 2222,
321
+ :vm_size => 'Small', # Use any Azure VM size
322
+ :affinity_group_name => 'affinity1',
323
+ :virtual_network_name => 'xplattestvnet',
324
+ :subnet_name => 'subnet1',
325
+ :availability_set_name => 'availabiltyset1',
326
+ :reserved_ip_name => 'reservedipname'
327
+ }
328
+ vm_management.create_virtual_machine(params,options)
329
+
330
+ # API usage to add new roles under cloud service creating VM
331
+ # API add_role create multiple roles under the same cloud service. Atleast a single deployment should be created under a hosted service.
332
+ params = {
333
+ :vm_name => 'vm_name',
334
+ :cloud_service_name => 'cloud_service_name',
335
+ :vm_user => 'azureuser',
336
+ :image => 'a699494373c04fc0bc8f2bb1389d6106__Win2K8R2SP1-Datacenter-201305.01-en.us-127GB.vhd',
337
+ :password => 'ComplexPassword',
338
+ }
339
+ options = {
340
+ :storage_account_name => 'storage_suse',
341
+ :winrm_transport => ['https','http'], # Currently http(s) is supported.
342
+ :tcp_endpoints => '80,3389:3390',
343
+ :private_key_file => './private_key.key', # Required for winrm(https) certificate.
344
+ :winrm_https_port => 5999,
345
+ :winrm_http_port => 6999, # Used to open different powershell port
346
+ :vm_size => 'Small', # Use any Azure VM size
347
+ :availability_set_name => 'availabiltyset'
348
+ }
349
+ vm_management.add_role(params, options)
350
+
351
+ ```
352
+
353
+ <a name="images"></a>
354
+ ## List Images
355
+
356
+ ```ruby
357
+
358
+ # Get a list of available virtual machine images
359
+ vm_image_management = Azure.vm_image_management
360
+ vm_image_management.list_virtual_machine_images
361
+
362
+ ```
363
+
364
+ <a name="base-mgmt"></a>
365
+ ## Base Management
366
+
367
+ <a name="locations"></a>
368
+ ```ruby
369
+
370
+ # Get a list of available regional data center locations
371
+ base_management = Azure.base_management
372
+ base_management.list_locations
373
+
374
+ ```
375
+
376
+ <a name="affinity"></a>
377
+ ### Affinity Group Management
378
+
379
+ ```ruby
380
+
381
+ # Require the azure rubygem
382
+ require 'azure'
383
+
384
+ # Create a affinity group service object
385
+ base_management = Azure.base_management
386
+
387
+ # Get a list of affinity group that are provisioned for a subscription.
388
+ base_management.list_affinity_groups
389
+
390
+ # API to delete affinity group
391
+ base_management.delete_affinity_group('affinity-group-name')
392
+
393
+ # API to add a new affinity group to a subscription
394
+ options = {:description => 'Some Description'}
395
+ base_management.create_affinity_group('affinity-group-name', 'West US', 'Label Name', options)
396
+
397
+ # API to update affinity group
398
+ options = {:description => 'Some Description'}
399
+ base_management.update_affinity_group('affinity-group-name', 'Label Name', options)
400
+
401
+ # API to list properties associated with the specified affinity group
402
+ base_management.get_affinity_group('affinity-group-name')
403
+
404
+ ```
405
+
406
+ <a name="sql"></a>
407
+ ## SQL Database Server Management
408
+
409
+ ```ruby
410
+
411
+ # Require the azure rubygem
412
+ require 'azure'
413
+
414
+ # Configure these properties
415
+ Azure.management_certificate = "path to *.pem or *.pfx file"
416
+ Azure.subscription_id = "your subscription id"
417
+
418
+ # Create a database server service object
419
+ sql_db_service = Azure.sql_database_management
420
+
421
+ # Get a list of SQL Database servers that are provisioned for a subscription.
422
+ sql_db_service.list_servers
423
+
424
+ # API to delete SQL Database server
425
+ sql_db_service.delete_server('server_name')
426
+
427
+ # API to adds a new SQL Database server to a subscription
428
+ sql_db_service.create_server('admin-login', 'ComplexPassword', 'West US')
429
+
430
+ # API to sets the administrative password of a SQL Database server for a subscription
431
+ sql_db_service.reset_password('server-name', 'NewPassword')
432
+
433
+ # Get a list of all the server-level firewall rules for a SQL Database server that belongs to a subscription
434
+ sql_db_service.list_sql_server_firewall_rules("server-name")
435
+
436
+ # API to adds a new server-level firewall rule or updates an existing server-level firewall rule for a SQL Database server with requester’s IP address.
437
+ sql_db_service.delete_sql_server_firewall_rule("server-name", "rule-name")
438
+
439
+ # API to add/updates server-level firewall rule for a SQL Database server that belongs to a subscription
440
+ ip_range = {:start_ip_address => "0.0.0.1", :end_ip_address => "0.0.0.5"}
441
+ sql_db_service.set_sql_server_firewall_rule("server-name", "rule-name", ip_range)
442
+
443
+ # If ip_range was not specified in the above api then the IP of the machine from where the api is being called would be set as the rule.
444
+ # To toggle between the option to allow Microsoft Azure services to access db server similar to azure portal just set the fire wall rule
445
+ # with iprange to be 0.0.0.0 as start and end.Remove the rule to unset this option.
446
+
447
+ ```
448
+
449
+ <a name="vnets"></a>
450
+ ## Virtual Network Management
451
+
452
+ ```ruby
453
+
454
+ # Require the azure rubygem
455
+ require 'azure'
456
+
457
+ # Create a virtual network service object
458
+ vnet = Azure.network_management
459
+
460
+ # API to get a list of virtual networks created for a subscription.
461
+ vnet.list_virtual_networks
462
+
463
+ # API to configure virtual network with required and optional parameters
464
+ address_space = ['172.16.0.0/12', '10.0.0.0/8', '192.168.0.0/24']
465
+ subnets = [{:name => 'subnet-1', :ip_address=>'172.16.0.0', :cidr=>12}, {:name => 'subnet-2', :ip_address=>'10.0.0.0', :cidr=>8}]
466
+ dns_servers = [{:name => 'dns-1', :ip_address=>'1.2.3.4'}, {:name => 'dns-2', :ip_address=>'8.7.6.5'}]
467
+ options = {:subnet => subnets, :dns => dns_servers}
468
+ vnet.set_network_configuration('virtual-network-name', 'location_name', address_space, options)
469
+
470
+ # API to configure virtual network from xml file that can be exported from management portal and customized to add or delete vnet
471
+ vnetxml = './customnetwork.xml'
472
+ vnet.set_network_configuration(vnetxml)
473
+
474
+ ```
475
+
476
+ # Getting Started with Certificates
477
+
478
+ Currently the sdk supports *.pem or *.pfx (passwordless pfx) for service management operations. Following are the steps discussed on various cert operations.
479
+
480
+ ## Get Started with Publish Settings
481
+
482
+ * To create a pfx from the publishsettings, simply download the publishsettings file for your subscription
483
+ [https://manage.windowsazure.com/publishsettings](https://manage.windowsazure.com/publishsettings/index?client=powershell). Make sure you have this gem installed and
484
+ run `pfxer transform --in [path to your .publishsettings file]`. This will create a .pfx from your publish settings file which can
485
+ be supplied as a cert parameter for Service Management Commands.
486
+
487
+ ## Get Started with OpenSSL
488
+
489
+ * Using the following openssl commands to create a cert and upload to Azure Management
490
+ * Generate public and private `openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout cert.pem -out cert.pem`
491
+ * Generate public .cer for Azure upload `openssl x509 -inform pem -in cert.pem -outform der -out mgmt.cer`
492
+ * Upload the `mgmt.cer` to Azure Management through [https://management.azure.com](https://management.azure.com)
493
+ * Use cert.pem as your cert parameter for Service Management Commands.
494
+
495
+ # Contribute Code or Provide Feedback
496
+
497
+ 1. Fork it
498
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
499
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
500
+ 4. Push to the branch (`git push origin my-new-feature`)
501
+ 5. Create new Pull Request
502
+
503
+ ## Development Environment Setup
504
+
505
+ ### Download Source Code
506
+
507
+ To get the source code of the SDK via **git** just type:
508
+
509
+ ```bash
510
+ git clone https://github.com/Azure/azure-sdk-for-ruby.git
511
+ cd ./azure-sdk-for-ruby
512
+ git remote add upstream https://github.com/Azure/azure-sdk-for-ruby.git
513
+ git checkout -b asm upstream/asm
514
+ ```
515
+ Run bundler to install all the gem dependencies:
516
+
517
+ ```bash
518
+ bundle install
519
+ ```
520
+
521
+ ### Setup the Environment for Integration Tests
522
+
523
+ If you would like to run the integration test suite, you will need to setup environment variables which will be used
524
+ during the integration tests. These tests will use these credentials to run live tests against Azure with the provided
525
+ credentials (you will be charged for usage, so verify the clean up scripts did their job at the end of a test run).
526
+
527
+ The root of the project contains a .env_sample file. This dot file is a sample of the actual environment vars needed to
528
+ run the integration tests.
529
+
530
+ Do the following to prepare your environment for integration tests:
531
+
532
+ * Copy .env_sample to .env **relative to root of the project dir**
533
+ * Update .env with your credentials **.env is in the .gitignore, so should only reside locally**
534
+
535
+ Azure Service Management integration tests use VCR, so they are recorded and can be easily played back without
536
+ consuming any Azure live resources.
537
+
538
+ ### Run Tests
539
+
540
+ You can use the following commands to run:
541
+
542
+ * All the tests: ``rake test``. **This will run integration tests if you have .env file or env vars setup**
543
+ * A specific suite of tests: ``rake test:unit``, ``rake test:integration``, ``rake test:integration:blob``, etc.
544
+ * one particular test file: ``ruby -I"lib:test" "<path of the test file>"``
545
+
546
+ To run VCR tests:
547
+ * Set the following environment variable ``INTEG_RECORDED = true``, then run ``rake test:recorded``
548
+
549
+ ### Generate Documentation
550
+
551
+ Running the command ``yard`` will generate the API documentation in the `./doc` directory.
552
+
553
+ ## Provide Feedback
554
+
555
+ If you encounter any bugs with the library please file an issue in the [Issues](https://github.com/Azure/azure-sdk-for-ruby/issues) section of the project. Please make sure to label the issues with either arm or asm to help us expedite the process.
556
+
557
+ # Maintainers
558
+
559
+ * [David Justice](https://github.com/devigned)
560
+
561
+ # Azure CLI Tooling
562
+
563
+ For documentation on [Azure PowerShell](http://github.com/azure/azure-powershell).
564
+ For documentation on [Azure CLI](http://github.com/azure/azure-xplat-cli).
565
+
566
+ ---
567
+ This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
@@ -40,7 +40,6 @@ Gem::Specification.new do |s|
40
40
  s.add_runtime_dependency('nokogiri', '~> 1.6')
41
41
  s.add_runtime_dependency('systemu', '~> 2.6')
42
42
  s.add_runtime_dependency('thor', '~> 0.19')
43
- s.add_runtime_dependency('uuid', '~> 2.0')
44
43
 
45
44
  s.add_development_dependency('dotenv', '~> 2.0')
46
45
  s.add_development_dependency('minitest', '~> 5')
@@ -22,6 +22,7 @@ require 'rexml/document'
22
22
  require 'addressable/uri'
23
23
  require 'faraday'
24
24
  require 'faraday_middleware'
25
+ require 'azure/core'
25
26
 
26
27
  module Azure
27
28
  autoload :Client, 'azure/client'
@@ -75,6 +76,11 @@ module Azure
75
76
  autoload :SqlFilter, 'azure/service_bus/sql_filter'
76
77
  autoload :TrueFilter, 'azure/service_bus/true_filter'
77
78
  autoload :CorrelationFilter, 'azure/service_bus/correlation_filter'
79
+
80
+ module Auth
81
+ autoload :SharedAccessSigner, 'azure/service_bus/auth/shared_access_signer'
82
+ end
83
+
78
84
  end
79
85
 
80
86
  module SqlDatabaseManagement
@@ -14,7 +14,7 @@ module Azure
14
14
  # @param key [String] The service bus SAS key encoded in Base64. Defaults to the one in the global configuration.
15
15
  # @param expiry_offset [Integer] The number of seconds from the time of signature that the SAS token will expire. Defaults to 30 minutes.
16
16
  def initialize(key_name=Azure.sb_sas_key_name, key=Azure.sb_sas_key, expiry_offset = 60*5)
17
- super(key)
17
+ @access_key = key
18
18
  @key_name, @expiry_offset = key_name, expiry_offset
19
19
  end
20
20
 
@@ -93,6 +93,7 @@ module Azure
93
93
  connection
94
94
  content-type
95
95
  content-length
96
+ strict-transport-security
96
97
  )
97
98
 
98
99
  props = response.headers.reject do |k, _|
@@ -12,7 +12,7 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
  #--------------------------------------------------------------------------
15
- require 'uuid'
15
+ require 'securerandom'
16
16
 
17
17
  require 'azure/table/serialization'
18
18
  require 'azure/table/table_service'
@@ -54,9 +54,8 @@ module Azure
54
54
  @operations = []
55
55
  @entity_keys = []
56
56
  @table_service = Azure::Table::TableService.new
57
- uuid = UUID.new
58
- @batch_id = "batch_" + uuid.generate
59
- @changeset_id = "changeset_" + uuid.generate
57
+ @batch_id = "batch_" + SecureRandom.uuid
58
+ @changeset_id = "changeset_" + SecureRandom.uuid
60
59
 
61
60
  self.instance_eval(&block) if block_given?
62
61
  end
@@ -17,7 +17,7 @@ module Azure
17
17
  class Version
18
18
  MAJOR = 0 unless defined? MAJOR
19
19
  MINOR = 7 unless defined? MINOR
20
- UPDATE = 5 unless defined? UPDATE
20
+ UPDATE = 6 unless defined? UPDATE
21
21
  PRE = nil unless defined? PRE
22
22
 
23
23
  class << self
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: azure
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.5
4
+ version: 0.7.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Microsoft Corporation
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-05-02 00:00:00.000000000 Z
12
+ date: 2016-09-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: addressable
@@ -143,20 +143,6 @@ dependencies:
143
143
  - - ~>
144
144
  - !ruby/object:Gem::Version
145
145
  version: '0.19'
146
- - !ruby/object:Gem::Dependency
147
- name: uuid
148
- requirement: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - ~>
151
- - !ruby/object:Gem::Version
152
- version: '2.0'
153
- type: :runtime
154
- prerelease: false
155
- version_requirements: !ruby/object:Gem::Requirement
156
- requirements:
157
- - - ~>
158
- - !ruby/object:Gem::Version
159
- version: '2.0'
160
146
  - !ruby/object:Gem::Dependency
161
147
  name: dotenv
162
148
  requirement: !ruby/object:Gem::Requirement
@@ -277,8 +263,12 @@ extensions: []
277
263
  extra_rdoc_files: []
278
264
  files:
279
265
  - .env_sample
266
+ - .gitignore
267
+ - .travis.yml
268
+ - ChangeLog.md
280
269
  - Gemfile
281
270
  - LICENSE.txt
271
+ - README.md
282
272
  - Rakefile
283
273
  - azure.gemspec
284
274
  - bin/pfxer