lib/azure/armrest/resource_group_based_service.rb
# Create a resource +name+ within the resource group +rgroup+, or the
# resource group that was specified in the configuration, along with
# a hash of appropriate +options+.
#
# Returns an instance of the object that was created if possible,
# otherwise nil is returned.
#
# Note that this is an asynchronous operation. You can check the current
# status of the resource by inspecting the :response_headers instance and
# polling either the :azure_asyncoperation or :location URL.
#
# The +options+ hash keys are automatically converted to camelCase for
# flexibility, so :createOption and :create_option will both work
# when creating a virtual machine, for example.
#


Returns an instance of the object that was created if possible,
otherwise nil is returned.

Note that this is an asynchronous operation. You can check the current
status of the resource by inspecting the :response_headers instance and
polling either the :azure_asyncoperation or :location URL.

The +options+ hash keys are automatically converted to camelCase for
flexibility, so :createOption and :create_option will both work
when creating a virtual machine, for example.
Returns an instance of the object that was created if possible otherwise nil is returned . Note that this is an asynchronous operation . You can check the current status of the resource by inspecting the : response_headers instance and polling either the : azure_asyncoperation or : location URL . The + options + hash keys are automatically converted to camelCase for flexibility so : createOption and : create_option will both work when creating a virtual machine for example .
def create(name, rgroup = configuration.resource_group, options = {})
        validate_resource_group(rgroup)
        validate_resource(name)
        url = build_url(rgroup, name)
        url = yield(url) || url if block_given?
        body = transform_create_options(options).to_json
        response = rest_put(url, body)
        headers = Azure::Armrest::ResponseHeaders.new(response.headers)
        headers.response_code = response.code
        if response.body.empty?
          obj = get(name, rgroup)
        else
          obj = model_class.new(response.body)
        end
        obj.response_headers = headers
        obj.response_code = headers.response_code
        obj
      end
def create ( name , rgroup = configuration . resource_group , options = { } ) validate_resource_group ( rgroup ) validate_resource ( name ) url = build_url ( rgroup , name ) url = yield ( url ) || url if block_given? body = transform_create_options ( options ) . to_json response = rest_put ( url , body ) headers = Azure :: Armrest :: ResponseHeaders . new ( response . headers ) headers . response_code = response . code if response . body . empty? obj = get ( name , rgroup ) else obj = model_class . new ( response . body ) end obj . response_headers = headers obj . response_code = headers . response_code obj end
Create a resource +name+ within the resource group +rgroup+, or the
resource group that was specified in the configuration, along with
a hash of appropriate +options+.
Create a resource + name + within the resource group + rgroup + or the resource group that was specified in the configuration along with a hash of appropriate + options + .
name
<not_specific>
rgroup
<not_specific>
configuration
<not_specific>
resource_group
<not_specific>
options
<not_specific>