Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change get_template to return a string #266

Merged
merged 1 commit into from Mar 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion lib/azure/armrest/model/base_model.rb
Expand Up @@ -180,7 +180,6 @@ def add_accessor_methods(method, key)
# Initial class definitions. Reopen these classes as needed.

class AvailabilitySet < BaseModel; end
class DeploymentTemplate < BaseModel; end
class Event < BaseModel; end
class ImageVersion < BaseModel; end
class Offer < BaseModel; end
Expand Down
7 changes: 2 additions & 5 deletions lib/azure/armrest/template_deployment_service.rb
Expand Up @@ -38,16 +38,13 @@ def get_deployment_operation(op_id, deploy_name, resource_group = configuration.
TemplateDeploymentOperation.new(response)
end

# Returns the json template as an object for the given deployment.
#
# If you want the plain JSON text then call .to_json on the returned object.
# Returns the raw json template for the given deployment as a string.
#
def get_template(deploy_name, resource_group = configuration.resource_group)
validate_resource_group(resource_group)
validate_resource(deploy_name)
url = build_url(resource_group, deploy_name, 'exportTemplate')
response = JSON.parse(rest_post(url))['template']
DeploymentTemplate.new(response)
JSON.parse(rest_post(url))['template'].to_json
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should remove DeploymentTemplate from base_model.rb.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bzwei I thought about it, but thought it might be nice for people who do want to convert it. Or do you think that will just lead to confusion?

end

# Delete a deployment and all associated resources that were generated by the
Expand Down