Module: Latitude::API::Operations::Create
- Included in:
- Resources::APIKey, Resources::ElasticIP, Resources::Firewall, Resources::Firewall::Assignment, Resources::KubernetesCluster, Resources::Project, Resources::Project::SSHKey, Resources::Project::UserData, Resources::SSHKey, Resources::Server, Resources::Storage::Filesystem, Resources::Storage::Volume, Resources::Tag, Resources::Team, Resources::UserData, Resources::VPNSession, Resources::VirtualMachine, Resources::VirtualNetwork
- Defined in:
- lib/latitude/api/operations/create.rb
Instance Method Summary collapse
Instance Method Details
#create(params = {}, opts = {}) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/latitude/api/operations/create.rb', line 7 def create(params = {}, opts = {}) params = params.dup path_params = extract_path_params(params, path_param_keys) body = JSONAPI.encode(type: resource_type, attributes: params) parsed = execute_request( method: :post, path: class_url(path_params: path_params), body: body, opts: opts, ) construct_from(parsed, opts: opts, path_params: path_params) end |