query
stringlengths
7
9.55k
document
stringlengths
10
363k
metadata
dict
negatives
sequencelengths
0
101
negative_scores
sequencelengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Delete Tier1 policy service instance Delete Tier1 policy service instance
def delete_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_0 ...' end # verify the required parameter 'tier_1_id' is set if @api_client.config.client_side_validation && tier_1_id.nil? fail ArgumentError, "Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_0" end # verify the required parameter 'locale_service_id' is set if @api_client.config.client_side_validation && locale_service_id.nil? fail ArgumentError, "Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_0" end # verify the required parameter 'service_instance_id' is set if @api_client.config.client_side_validation && service_instance_id.nil? fail ArgumentError, "Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_0" end # resource path local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#delete_tier1_policy_service_instance_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete\n ensure_service!\n service.delete_instance path\n true\n end", "def delete\n self.class.delete_service_instance(@service_name, @name)\n end", "def delete_instance instance_id\n instances.delete_instance name: instance_path(instance_id)\n end", "def delete_vm_instance(name, namespace)\n @conn.vminstances.destroy(name, namespace)\n end", "def delete\n ensure_service!\n service.delete_table instance_id, name\n true\n end", "def delete\n execute_prlctl('delete', @uuid)\n end", "def delete_pvm_instance(instance_id)\n delete(\"cloud-instances/#{guid}/pvm-instances/#{instance_id}\")\n end", "def delete_policy(auto_scaling_group_name, policy_name)\n request({\n 'Action' => 'DeletePolicy',\n 'AutoScalingGroupName' => auto_scaling_group_name,\n 'PolicyName' => policy_name,\n :parser => Fog::Parsers::AWS::AutoScaling::Basic.new\n })\n end", "def delete(instance) # rubocop:disable Metrics/AbcSize\n authcookie = ComputeBase.new\n authcookie = authcookie.authenticate(id_domain, user, passwd, restendpoint)\n url = restendpoint + @function + instance\n uri = URI.parse(url)\n http = Net::HTTP.new(uri.host, uri.port, @proxy_addr, @proxy_port) # Creates a http object\n http.use_ssl = true # When using https\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Delete.new(uri.request_uri)\n request.add_field 'accept', 'application/oracle-compute-v3+json'\n request.add_field 'Cookie', authcookie\n http.request(request)\n end", "def delete_policy_dns_forwarder_on_tier1(tier_1_id, opts = {})\n delete_policy_dns_forwarder_on_tier1_with_http_info(tier_1_id, opts)\n nil\n end", "def delete_instance instance_id\n execute do\n instances.delete_instance(\n instance_path(instance_id)\n )\n end\n end", "def delete_policy(name)\n client.delete(\"/v1/sys/policy/#{encode_path(name)}\")\n return true\n end", "def delete\n stop\n [ @resource['instances_dir'] + \"/\" + @resource[:name],\n @resource['instances_dir'] + \"/\" + \"_\" + @resource[:name]\n ].each do |dir|\n FileUtils.rm_rf(dir) if File.directory?(dir)\n end\n end", "def destroy\n Puppet.debug(\"Calling destroy method of security_policy_cloakingprovider: \")\nend", "def destroy\n @instance = @provider.instances.find(params[:id])\n InstanceOperations.terminate_instances(@provider.connect!, @instance)\n @instance.destroy\n redirect_to cloud_provider_path(@provider) \n end", "def delete_tier1_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#delete_tier1_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def destroy\n requires :id\n \n service.delete_nat_gateway(id)\n true\n end", "def delete_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_byod_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_byod_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#delete_tier1_byod_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_policy_EC2\n $iam.client.delete_role_policy(\n :role_name => 'ec2-start-stop',\n :policy_name => 'ec2-start-stop')\n \n redirect_to iams_path, notice: 'Deleted Role: ec2-start-stop' \n end", "def destroy_instance(credentials, id)\n safely do\n terremark_client = new_client(credentials)\n return terremark_client.delete_vapp(id)\n end\nend", "def delete_policy(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DeletePolicy'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\targs[:scheme] = 'https'\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :policy_name\n\t\t\targs[:query]['PolicyName'] = optional[:policy_name]\n\t\tend\n\t\tself.run(args)\n\tend", "def destroy\n debug(\"#{self.class}::destroy\")\n\n #Retrieval of key\n if ((defined? $key) && !(($key.nil?) || ($key.empty?)))\n Puppet.debug('INFO: key already provided as a command parameter ' + $key)\n\n elsif (!($name.to_s.empty?) )\n\n #Retrieve key\n uriAttributeMap1 = {}\n uriAttributeMap1[:name] = $name\n resourceType = \"storage-service-levels\"\n $key = self.retrieveKeyOfObjectType('/api/1.0/slo/storage-service-levels', resourceType, uriAttributeMap1)\n\n end\n\n\n apiUri = '/api/1.0/slo/storage-service-levels/'+$key\n resourceType = \"storageservicelevel\"\n\n if(transport.http_delete_request(apiUri ,resourceType))\n if(resource[:name] != null)\n puts \"#{resourceType} : #{resource[:name]} successfully deleted\"\n\t\t\telse\n\t\t\t puts \" #{resourceType} successfully deleted\"\n\t\t\tend\n else\n if(resource[:name] != null)\n puts \" #{resourceType} : #{resource[:name]} deletion failed\"\n\t\t else\n\t\t\t puts \" #{resourceType} deletion failed\"\n\t\t end\n end\n\nend", "def delete\n results = submit_cmd('delete app instance',:db, \" -env #{self.belongs_to.env} -app_instance #{self.name}\")\n\n\t if ( results.to_s =~ /failure/i || results.to_s =~ /error/i)\n\t \t raise \"update attribute failed\" \n\t else\n\t \t self.belongs_to.appTemplates.delete(self)\n\t end\n\n end", "def delete_policy_dns_forwarder_on_tier1_0(tier_1_id, opts = {})\n delete_policy_dns_forwarder_on_tier1_0_with_http_info(tier_1_id, opts)\n nil\n end", "def destroy\n Puppet.debug(self.class.to_s.split('::').last + ': Calling destroy method : ')\n\n response, status_code, headers = Puppet::Provider::Cudawaf.delete('SecurityPolicy', @resource[:name], {})\n @property_hash.clear\n [response, status_code, headers]\n end", "def delete_tier1_policy_service_instance_0(tier_1_id, locale_service_id, service_instance_id, opts = {})\n delete_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts)\n nil\n end", "def delete\n @service.delete(self)\n end", "def delete_policy\n\n group = $iam.groups[params[:name]]\n\n AWS.config(\n :access_key_id => ENV[\"S3_ACCESS_KEY\"], \n :secret_access_key => ENV[\"S3_SECRET_KEY\"])\n\n policy_name = 's3-read-write' \n\n $iam.client.delete_group_policy(\n :group_name => group.name,\n :policy_name => policy_name)\n\n redirect_to \"/show_group/#{group.name}\", notice: 'Deleted s3-read-write policy from the Group'\n \n end", "def remove(policy, name = nil)\n service = @state.delete(policy, name)\n\n logger.info \"remove policy=#{policy} with config=#{name}: #{service}\"\n\n begin\n service.stop\n rescue => error\n raise ServiceError, \"stop: #{error}\"\n end\n end", "def destroy\n @payment_tier.destroy\n respond_to do |format|\n format.html { redirect_to payment_tiers_url, notice: 'Payment tier was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_byod_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_byod_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#delete_tier1_byod_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_tier1_byod_policy_service_instance(tier_1_id, locale_service_id, service_instance_id, opts = {})\n delete_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts)\n nil\n end", "def delete_tier1_byod_policy_service_instance_0(tier_1_id, locale_service_id, service_instance_id, opts = {})\n delete_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts)\n nil\n end", "def destroy\n audit(@service_template, \"destroy\", @service_template.name)\n authorize @service_template\n\n @service_template.destroy\n respond_to do |format|\n format.html { redirect_to service_templates_url, notice: 'Service template was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @load_balancer_policy = LoadBalancerPolicy.find(params[:id])\n @load_balancer_policy.destroy\n\n respond_to do |format|\n format.html { redirect_to(load_balancer_policies_url) }\n format.xml { head :ok }\n end\n end", "def delete\n @service.delete(self)\n end", "def destroy\n destroy_helper(@pay_period, pay_periods_url, \"Pay period\")\n end", "def destroy\n @policy = Policy.find(params[:id])\n @policy.destroy\n\n respond_to do |format|\n format.html { redirect_to motor_policies_url }\n format.json { head :no_content }\n end\n end", "def destroy\n authenticate_user!\n authorize! :index, @user, :message => 'Not authorized as an administrator.'\n \n @key_policy_maker = KeyPolicyMaker.find(params[:id])\n @key_policy_maker.destroy\n\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :no_content }\n end\n end", "def destroy; delete end", "def delete_class_from_path\n destroy_instance_for_course(params[:instance_id])\n end", "def destroy\n delete_file\n @policy.destroy\n respond_to do |format|\n format.html { redirect_to policies_url, notice: 'Policy was successfully destroyed.' }\n # format.json { head :no_content }\n end\n end", "def destroy\n @new_policy = NewPolicy.find(params[:id])\n @new_policy.destroy\n\n respond_to do |format|\n format.html { redirect_to new_policies_url }\n format.json { head :no_content }\n end\n end", "def destroy!\n destroy_instance(_id)\n end", "def resource_delete klass, resource_name\n\t\t\t\[email protected] do\n\t\t\t\t\tproviders.each do |p|\n\t\t\t\t\t\tnext unless p.class_exist?(klass.name)\n\t\t\t\t\t\tp.resource_delete klass.name, resource_name\t\t\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend", "def destroy\n @karteikarte = Karteikarte.find(params[:id])\n\n @karteikarten = Karteikarte.find(:all, :conditions => { :person_id => @karteikarte.person_id })\n if @karteikarten.length == 1\n @person = Person.find(:first, :conditions => { :id => @karteikarte.person_id })\n @person.destroy\n end\n\n @karteikarten.clear\n @karteikarten = Karteikarte.find(:all, :conditions => { :tier_id => @karteikarte.tier_id })\n if @karteikarten.length == 1\n @tier = Tier.find(:first, :conditions => { :id => @karteikarte.tier_id })\n @tier.destroy\n end\n\n @karteikarte.destroy\n\n redirect_to(karteikarten_path)\n end", "def destroy_backend\n Rails.logger.info \"Removing tenant #{self.name} with tenant id #{self.uuid}.\"\n\n Rails.logger.info \"Undeploying all instances for tenant #{self.name}...\"\n # Delete all instances\n if self.instances.count > 0\n success = self.instances.each {|i| i.undeploy }\n if success\n Rails.logger.info \"Removed all instances for tenant #{self.name}.\"\n else\n Rails.logger.error \"Could not remove instance during project deletion:\"\n Rails.logger.error \"Instance: #{i.name} #{i.id} #{i.uuid}\"\n return false\n end\n end\n\n compute_c = get_connection(\"compute\")\n network_c = get_connection(\"network\")\n identity_c = get_connection(\"identity\")\n\n # Unallocate floating ips\n floating_ips = compute_c.get_floating_ips\n floating_ips.each do |ip|\n Rails.logger.info \"Deleting floating ip #{ip.ip} with id #{ip.id}\"\n compute_c.delete_floating_ip(ip.id)\n end\n\n routers = network_c.list_routers.select {|router| router.tenant_id == self.uuid}\n subnets = network_c.list_subnets.select {|subnet| subnet.tenant_id == self.uuid}\n networks = network_c.list_networks.select {|network| network.tenant_id == self.uuid}\n\n # Clear all router gateways\n routers.each do |router|\n Rails.logger.info \"Clearing router gateway for #{router.name} with id #{router.id}.\"\n # Remove gateway from the router\n network_c.update_router(router.id, {\"external_gateway_info\" => {}})\n end\n\n # loop through each network\n # For each router, remove any subnet interfaces\n networks.each do |network|\n subnets.select {|subnet| subnet.network_id == network.id}.each do |subnet|\n routers.each do |router|\n begin\n Rails.logger.info \"Attempting to remove router interface for subnet #{subnet.name} with id #{subnet.id} from router #{router.name} with id #{router.id}.\"\n network_c.remove_router_interface(router.id, subnet.id)\n Rails.logger.info \"Successfully removed router interface for subnet #{subnet.name}.\"\n rescue => e\n Rails.logger.error \"Tried to remove router interface for subnet #{subnet.name} with id #{subnet.id} from router #{router.name} with id #{router.id}.\"\n end\n end\n end\n end\n\n # Delete all subnets\n subnets.each do |subnet|\n Rails.logger.info \"Deleting subnet #{subnet.name} with id #{subnet.id}\"\n network_c.delete_subnet(subnet.id)\n end\n\n # Delete all routers\n routers.each do |router|\n Rails.logger.info \"Deleting router #{router.name} with id #{router.id}\"\n network_c.delete_router(router.id)\n end\n\n # Delete all networks\n networks.each do |network|\n Rails.logger.info \"Deleting network #{network.name} with id #{network.id}\"\n network_c.delete_network(network.id)\n end\n\n # Finally, delete the tenant\n Rails.logger.info \"Deleting tenant #{self.name} with id #{self.uuid}\"\n identity_c.delete_tenant(self.uuid)\n\n Rails.logger.info \"Removal of tenant #{self.name} on the OpenStack backend succeeded.\"\n end", "def destroy\n @service.destroy\n end", "def destroy\n @service.destroy\n end", "def destroy\n @service.destroy\n end", "def delete_tier1_policy_service_instance(tier_1_id, locale_service_id, service_instance_id, opts = {})\n delete_tier1_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts)\n nil\n end", "def delete_LTI_tool_provider_registration(tp_id)\n path = \"/d2l/api/le/#{$le_ver}/lti/tp/#{tp_id}\"\n _delete(path)\nend", "def destroy\n load_points_entry_type\n authorize! :destroy, @points_entry_type\n destroy_points_entry_type\n end", "def destroy_schema\n Apartment::Tenant.drop tenant\n end", "def destroy_schema\n Apartment::Tenant.drop tenant\n end", "def destroy\r\n AlnTermination.find_all_by_aln_path_id(self.aln_path_id, :readonly => false).each {|t| do_remove_from_termination(t)}\r\n super\r\n end", "def delete\n Fission::Action::VM::Deleter.new(self).delete\n end", "def destroy\n @policy_template.destroy\n respond_to do |format|\n format.html { redirect_to policy_templates_url, notice: 'Policy template was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n fail('Destroying fip pool is not supported using contrail api')\n end", "def destroy(inst)\n self.class.destroy inst\n end", "def destroy\n @taxi_sevice.destroy\n respond_to do |format|\n format.html { redirect_to taxi_sevices_url, notice: 'Taxi sevice was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_tier1_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.delete_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.delete_tier1\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#delete_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def destroy\n # Shutdown pool if active\n service.pool_action uuid, :destroy if active?\n # If this is a persistent domain we need to undefine it\n service.pool_action uuid, :undefine if persistent?\n end", "def destroy_service\n delete_monit_config\n super\n end", "def delete_instance(instance_name)\n return if !configured? || !instance_exists?(instance_name)\n\n @service.delete_instance(@gcp_config['project'], @gcp_config['zone'], instance_name)\n rescue StandardError => e\n @logger.error(e.message)\n end", "def destroy\n requires :customer_gateway_id\n \n service.delete_customer_gateway(customer_gateway_id)\n true\n end", "def destroy\n @priv_policy.destroy\n respond_to do |format|\n format.html { redirect_to priv_policies_url, notice: 'Priv policy was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy_instance(instance)\n tenant = @identity.find_tenant(instance.tenant_id)\n fog_options = @fog_options[:storage].merge(:hp_tenant_id => tenant.id)\n\n storage = VCAP::Services::Swift::Storage.new(@logger, fog_options)\n storage.delete_account\n\n @logger.debug \"Account meta data (should be 'Recently deleted'): \" + storage.get_account_meta_data.body.to_s\n\n @identity.delete_users_by_tenant_id(instance.tenant_id, @fog_options[:name_suffix])\n @identity.delete_tenant(instance.tenant_id)\n raise SwiftError.new(SwiftError::SWIFT_DESTROY_INSTANCE_FAILED, instance.inspect) unless instance.destroy\n end", "def destroy_service\n # Disable automatically destroys the service with Runit.\n directory \"/var/log/#{new_resource.service_name}\" do\n action :delete\n recursive true\n end\n end", "def service_delete(name)\n\t\tif session_has_services_depend?\n\t\t\tmeterpreter_service_delete(name)\n\t\telse\n\t\t\tshell_service_delete(name)\n\t\tend\n\tend", "def delete_tier1_policy_service_instance_endpoint_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#delete_tier1_policy_service_instance_endpoint_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def destroy\n RubyLokaliseApi::Generics::DeletedResource.new(\n reinit_endpoint.do_delete.content\n )\n end", "def destroy\n @policy.destroy\n respond_to do |format|\n format.html { redirect_to policies_url, notice: 'Policy was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @policy.destroy\n respond_to do |format|\n format.html { redirect_to policies_url, notice: 'Policy was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @policy.destroy\n respond_to do |format|\n format.html { redirect_to policies_url, notice: 'Policy was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete\n \n end", "def stop\n service.pool_action uuid, :destroy\n end", "def destroy(_ = nil)\n OneProvisionLogger.info('(Destroy skipped)')\n end", "def destroy\n Puppet.debug(\"Calling destroy method of security_policy_parameter_protectionprovider: \")\n end", "def delete_tier1_policy_service_instance_endpoint_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#delete_tier1_policy_service_instance_endpoint\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_services\n self.services.each do |service|\n if ServiceCatalographer::Auth.allow_user_to_curate_thing?(self.submitter, service)\n service.destroy\n end\n end\n end", "def destroy\n prudent_destroy(@payment)\n end", "def delete_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.delete_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.delete_tier1_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#delete_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_server\n super\n end", "def delete\n ensure_service!\n service.delete_schema name\n true\n end", "def delete_kubernetes_version_policy(moid, opts = {})\n delete_kubernetes_version_policy_with_http_info(moid, opts)\n nil\n end", "def destroy(provision, tf)\n Terraform.p_load\n\n terraform = Terraform.singleton(@provider, tf)\n terraform.destroy_network(provision, @one.id)\n end", "def destroy\n @vip_service.destroy\n respond_to do |format|\n format.html { redirect_to(admin_vip_services_url) }\n format.xml { head :ok }\n end\n website.add_log(user: current_user, action: \"Deleted a amx vip service: #{@vip_service.name}\")\n end", "def destroy\n @admission.destroy\n end", "def delete\n ensure_service!\n service.delete_backup instance_id, backup_id\n true\n end", "def destroy\n audit(@tenure, current_user)\n @tenure.destroy\n \n\n head :no_content\n end", "def destroy\n @policy.destroy\n respond_to do |format|\n format.html { redirect_to policys_url }\n format.json { render json: { status: 200 } }\n end\n end", "def delete_policy_dns_forwarder_on_tier1_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.delete_policy_dns_forwarder_on_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.delete_policy_dns_forwarder_on_tier1\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/dns-forwarder'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi#delete_policy_dns_forwarder_on_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def destroy\n Puppet.debug \"starting with destroy #{self.class.to_s}\"\n dns_service = get_dns_service(get_fqdn)\n if dns_service != nil\n dnsrecord = dns_service.get_record(get_fqdn, get_type)\n dns_service.remove_record(dnsrecord.hash_id)\n end\n Puppet.debug \"done with destroy #{self.class.to_s}\"\n end", "def terminate\n self.destroy\n end", "def delete_accounts\n end", "def destroy\n @payment.destroy\n end", "def destroy\n @payment.destroy\n end", "def deleteInstance(iController, ioInstance)\n # Clean up everything that was registered before destruction\n ioInstance.unregisterAll\n # Wait for any timer event that has to finish\n ioInstance.killTimers\n # Quit everything\n ioInstance.destroy\n end", "def destroy\n @nagios_service_escalation_template = NagiosServiceEscalationTemplate.find(params[:id])\n @nagios_service_escalation_template.destroy\n\n respond_to do |format|\n format.html { redirect_to(nagios_service_escalation_templates_url) }\n format.xml { head :ok }\n end\n end" ]
[ "0.65392697", "0.6370457", "0.6169827", "0.61428994", "0.6132486", "0.60245675", "0.60216844", "0.5935967", "0.58969474", "0.5885702", "0.58853835", "0.5871486", "0.586544", "0.583564", "0.5834902", "0.58341914", "0.57823515", "0.5774709", "0.5746717", "0.57459164", "0.5739586", "0.5731538", "0.5728451", "0.57283217", "0.5710284", "0.57061356", "0.5696145", "0.5678274", "0.56741124", "0.5672743", "0.5669423", "0.5661796", "0.5659003", "0.5656909", "0.5654432", "0.5647228", "0.5640615", "0.5633079", "0.5620918", "0.56053025", "0.5599899", "0.5569069", "0.556715", "0.5566192", "0.5565581", "0.5565404", "0.55579895", "0.55481815", "0.55481815", "0.55481815", "0.55437976", "0.5540723", "0.5539259", "0.5535094", "0.5535094", "0.55349827", "0.5520871", "0.5519122", "0.55026895", "0.5500019", "0.5493306", "0.5488918", "0.5484405", "0.5481205", "0.5479947", "0.5473777", "0.547373", "0.5473124", "0.5469222", "0.54606897", "0.5460053", "0.5460002", "0.5455892", "0.5455892", "0.5455892", "0.54372764", "0.5435928", "0.54296476", "0.5426719", "0.5418722", "0.5416363", "0.5414574", "0.5411488", "0.5409077", "0.54028434", "0.5402067", "0.5401145", "0.5400103", "0.5398495", "0.5385508", "0.53814006", "0.5377643", "0.537452", "0.5374335", "0.5372875", "0.53693986", "0.53568614", "0.53568614", "0.53557837", "0.5355531" ]
0.58118004
16
Delete Tier1 service instance endpoint Delete Tier1 service instance endpoint
def delete_tier1_policy_service_instance_endpoint(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, opts = {}) delete_tier1_policy_service_instance_endpoint_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, opts) nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete\n self.class.delete_service_instance(@service_name, @name)\n end", "def delete\n ensure_service!\n service.delete_instance path\n true\n end", "def delete endpoint\n do_request :delete, endpoint\n end", "def delete_instance instance_id\n instances.delete_instance name: instance_path(instance_id)\n end", "def destroy\n requires :id\n \n service.delete_nat_gateway(id)\n true\n end", "def delete(instance) # rubocop:disable Metrics/AbcSize\n authcookie = ComputeBase.new\n authcookie = authcookie.authenticate(id_domain, user, passwd, restendpoint)\n url = restendpoint + @function + instance\n uri = URI.parse(url)\n http = Net::HTTP.new(uri.host, uri.port, @proxy_addr, @proxy_port) # Creates a http object\n http.use_ssl = true # When using https\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Delete.new(uri.request_uri)\n request.add_field 'accept', 'application/oracle-compute-v3+json'\n request.add_field 'Cookie', authcookie\n http.request(request)\n end", "def delete\n ensure_service!\n service.delete_table instance_id, name\n true\n end", "def delete\n @service.delete(self)\n end", "def destroy\n @service.destroy\n end", "def destroy\n @service.destroy\n end", "def destroy\n @service.destroy\n end", "def delete_server\n super\n end", "def delete\n @service.delete(self)\n end", "def destroy\n @instance = @provider.instances.find(params[:id])\n InstanceOperations.terminate_instances(@provider.connect!, @instance)\n @instance.destroy\n redirect_to cloud_provider_path(@provider) \n end", "def delete_tier1_policy_service_instance_endpoint_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#delete_tier1_policy_service_instance_endpoint_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def destroy\n @end_service.destroy\n head :no_content\n end", "def delete_tier1_policy_service_instance_endpoint_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#delete_tier1_policy_service_instance_endpoint\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def destroy\n @vip_service.destroy\n respond_to do |format|\n format.html { redirect_to(admin_vip_services_url) }\n format.xml { head :ok }\n end\n website.add_log(user: current_user, action: \"Deleted a amx vip service: #{@vip_service.name}\")\n end", "def delete\n \n end", "def destroy_backend\n Rails.logger.info \"Removing tenant #{self.name} with tenant id #{self.uuid}.\"\n\n Rails.logger.info \"Undeploying all instances for tenant #{self.name}...\"\n # Delete all instances\n if self.instances.count > 0\n success = self.instances.each {|i| i.undeploy }\n if success\n Rails.logger.info \"Removed all instances for tenant #{self.name}.\"\n else\n Rails.logger.error \"Could not remove instance during project deletion:\"\n Rails.logger.error \"Instance: #{i.name} #{i.id} #{i.uuid}\"\n return false\n end\n end\n\n compute_c = get_connection(\"compute\")\n network_c = get_connection(\"network\")\n identity_c = get_connection(\"identity\")\n\n # Unallocate floating ips\n floating_ips = compute_c.get_floating_ips\n floating_ips.each do |ip|\n Rails.logger.info \"Deleting floating ip #{ip.ip} with id #{ip.id}\"\n compute_c.delete_floating_ip(ip.id)\n end\n\n routers = network_c.list_routers.select {|router| router.tenant_id == self.uuid}\n subnets = network_c.list_subnets.select {|subnet| subnet.tenant_id == self.uuid}\n networks = network_c.list_networks.select {|network| network.tenant_id == self.uuid}\n\n # Clear all router gateways\n routers.each do |router|\n Rails.logger.info \"Clearing router gateway for #{router.name} with id #{router.id}.\"\n # Remove gateway from the router\n network_c.update_router(router.id, {\"external_gateway_info\" => {}})\n end\n\n # loop through each network\n # For each router, remove any subnet interfaces\n networks.each do |network|\n subnets.select {|subnet| subnet.network_id == network.id}.each do |subnet|\n routers.each do |router|\n begin\n Rails.logger.info \"Attempting to remove router interface for subnet #{subnet.name} with id #{subnet.id} from router #{router.name} with id #{router.id}.\"\n network_c.remove_router_interface(router.id, subnet.id)\n Rails.logger.info \"Successfully removed router interface for subnet #{subnet.name}.\"\n rescue => e\n Rails.logger.error \"Tried to remove router interface for subnet #{subnet.name} with id #{subnet.id} from router #{router.name} with id #{router.id}.\"\n end\n end\n end\n end\n\n # Delete all subnets\n subnets.each do |subnet|\n Rails.logger.info \"Deleting subnet #{subnet.name} with id #{subnet.id}\"\n network_c.delete_subnet(subnet.id)\n end\n\n # Delete all routers\n routers.each do |router|\n Rails.logger.info \"Deleting router #{router.name} with id #{router.id}\"\n network_c.delete_router(router.id)\n end\n\n # Delete all networks\n networks.each do |network|\n Rails.logger.info \"Deleting network #{network.name} with id #{network.id}\"\n network_c.delete_network(network.id)\n end\n\n # Finally, delete the tenant\n Rails.logger.info \"Deleting tenant #{self.name} with id #{self.uuid}\"\n identity_c.delete_tenant(self.uuid)\n\n Rails.logger.info \"Removal of tenant #{self.name} on the OpenStack backend succeeded.\"\n end", "def delete()\n @client.make_request(:delete, @client.concat_user_path(\"#{DOMAIN_PATH}/#{domain_id}/endpoints/#{id}\"))[0]\n end", "def destroy\n requires :customer_gateway_id\n \n service.delete_customer_gateway(customer_gateway_id)\n true\n end", "def delete_instance instance_id\n execute do\n instances.delete_instance(\n instance_path(instance_id)\n )\n end\n end", "def delete_virtual_server\n super\n end", "def destroy_service\n delete_monit_config\n super\n end", "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def destroy\n debug(\"#{self.class}::destroy\")\n\n #Retrieval of key\n if ((defined? $key) && !(($key.nil?) || ($key.empty?)))\n Puppet.debug('INFO: key already provided as a command parameter ' + $key)\n\n elsif (!($name.to_s.empty?) )\n\n #Retrieve key\n uriAttributeMap1 = {}\n uriAttributeMap1[:name] = $name\n resourceType = \"storage-service-levels\"\n $key = self.retrieveKeyOfObjectType('/api/1.0/slo/storage-service-levels', resourceType, uriAttributeMap1)\n\n end\n\n\n apiUri = '/api/1.0/slo/storage-service-levels/'+$key\n resourceType = \"storageservicelevel\"\n\n if(transport.http_delete_request(apiUri ,resourceType))\n if(resource[:name] != null)\n puts \"#{resourceType} : #{resource[:name]} successfully deleted\"\n\t\t\telse\n\t\t\t puts \" #{resourceType} successfully deleted\"\n\t\t\tend\n else\n if(resource[:name] != null)\n puts \" #{resourceType} : #{resource[:name]} deletion failed\"\n\t\t else\n\t\t\t puts \" #{resourceType} deletion failed\"\n\t\t end\n end\n\nend", "def delete_pvm_instance(instance_id)\n delete(\"cloud-instances/#{guid}/pvm-instances/#{instance_id}\")\n end", "def service_delete(name)\n\t\tif session_has_services_depend?\n\t\t\tmeterpreter_service_delete(name)\n\t\telse\n\t\t\tshell_service_delete(name)\n\t\tend\n\tend", "def destroy\n RubyLokaliseApi::Generics::DeletedResource.new(\n reinit_endpoint.do_delete.content\n )\n end", "def service_group_delete(a10, name)\n a10.send(:axapi, 'slb.service_group.delete', 'post', {name: name, format: 'json'})\nend", "def delete!\n server.delete(name)\n end", "def destroy\n @endpoint.destroy\n respond_to do |format|\n format.html { redirect_to root_url, notice: 'Endpoint was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def stop\n service.pool_action uuid, :destroy\n end", "def delete\n execute_prlctl('delete', @uuid)\n end", "def delete(id)\n @service.delete(id)\n end", "def delete\n stop\n [ @resource['instances_dir'] + \"/\" + @resource[:name],\n @resource['instances_dir'] + \"/\" + \"_\" + @resource[:name]\n ].each do |dir|\n FileUtils.rm_rf(dir) if File.directory?(dir)\n end\n end", "def delete_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#delete_tier1_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def destroy\n return if @name.nil?\n delete_rest \"vservers/#{@name}\"\n end", "def delete(service_instance_guid)\n service_instance = @client.service_instance(service_instance_guid)\n service_instance.service_bindings.each do |s|\n s.delete!\n end\n\n service_instance.delete!\n end", "def destroy\n @serv = Serv.find(params[:id])\n if @serv.mngbl\n #Remueve el MR a través de una llamada al webservice del núcleo\n http = Net::HTTP.new(\"192.168.119.163\",9999)\n post_params = {'ip' => @serv.conn.ip, 'port' => @serv.conn.port}\n request = Net::HTTP::Delete.new(\"/mbs/#{@serv.domain}/#{@serv.name}\")\n request.set_form_data(post_params)\n begin\n response = http.request(request)\n rescue Errno::ECONNREFUSED\n end\n end\n @serv.destroy\n\n respond_to do |format|\n format.html { redirect_to servs_url, notice: t('servs.delete.notice') }\n format.json { head :no_content }\n end\n end", "def destroy; delete end", "def delete\n start { |connection| connection.request http :Delete }\n end", "def delete\n results = submit_cmd('delete app instance',:db, \" -env #{self.belongs_to.env} -app_instance #{self.name}\")\n\n\t if ( results.to_s =~ /failure/i || results.to_s =~ /error/i)\n\t \t raise \"update attribute failed\" \n\t else\n\t \t self.belongs_to.appTemplates.delete(self)\n\t end\n\n end", "def delete_tier1_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#delete_tier1_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def destroy\n @loadbalancer = Loadbalancer.find(params[:id])\n checkaccountobject(\"loadbalancers\",@loadbalancer)\n @loadbalancer.send_delete\n\n respond_to do |format|\n format.html { redirect_to loadbalancers_url }\n format.json { head :ok }\n end\n end", "def destroy\n audit(@service_template, \"destroy\", @service_template.name)\n authorize @service_template\n\n @service_template.destroy\n respond_to do |format|\n format.html { redirect_to service_templates_url, notice: 'Service template was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @nagios_service_escalation_template = NagiosServiceEscalationTemplate.find(params[:id])\n @nagios_service_escalation_template.destroy\n\n respond_to do |format|\n format.html { redirect_to(nagios_service_escalation_templates_url) }\n format.xml { head :ok }\n end\n end", "def delete_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_byod_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_byod_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#delete_tier1_byod_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete\n \n end", "def destroy\n @taxi_sevice.destroy\n respond_to do |format|\n format.html { redirect_to taxi_sevices_url, notice: 'Taxi sevice was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n \n keystone.delete_tenant(keystone.get_tenant(params[:id])[:id])\n\n respond_to do |format|\n format.html { redirect_to tenants_url }\n format.json { head :ok }\n end\n end", "def delete\n svc = Service.find_by_label(params[:label])\n raise CloudError.new(CloudError::SERVICE_NOT_FOUND) unless svc\n raise CloudError.new(CloudError::FORBIDDEN) unless svc.verify_auth_token(@service_auth_token)\n\n svc.destroy\n\n render :json => {}\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n \n end", "def destroy\n \n end", "def delete_tier1_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.delete_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.delete_tier1\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#delete_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_endpoint(vm_name, cloud_service_name, endpoint_name)\n vm = get_virtual_machine(vm_name, cloud_service_name)\n if vm\n path = \"/services/hostedservices/#{vm.cloud_service_name}/deployments/#{vm.deployment_name}/roles/#{vm_name}\"\n endpoints = vm.tcp_endpoints + vm.udp_endpoints\n endpoints.delete_if { |ep| endpoint_name.downcase == ep[:name].downcase }\n body = Serialization.update_role_to_xml(endpoints, vm)\n request = client.management_request(:put, path, body: body)\n Azure::Loggerx.info \"Deleting virtual machine endpoint #{endpoint_name} ...\"\n request.call\n else\n Azure::Loggerx.error \"Cannot find virtual machine \\\"#{vm_name}\\\" under cloud service \\\"#{cloud_service_name}\\\".\"\n end\n end", "def destroy\n @idti_service.destroy\n respond_to do |format|\n format.html { redirect_to idti_services_url, notice: 'Idti service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def del_service(wspace, address, proto, port, comm='')\n\n\t\thost = get_host(:workspace => wspace, :address => address)\n\t\treturn unless host\n\n\t\thost.services.all(:conditions => {:proto => proto, :port => port}).each { |s| s.destroy }\n\tend", "def destroy\n fail('Destroying fip pool is not supported using contrail api')\n end", "def destroy\r\n\r\n end", "def delete\n super \"/templates/#{template_id}.json\", {}\n end", "def delete\n\n end", "def delete_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_byod_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_byod_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#delete_tier1_byod_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def destroy\n @servicetype = Servicetype.find(params[:id])\n @servicetype.destroy\n\n respond_to do |format|\n format.html { redirect_to servicetypes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @servicetype = Servicetype.find(params[:id])\n @servicetype.destroy\n\n respond_to do |format|\n format.html { redirect_to servicetypes_url }\n format.json { head :no_content }\n end\n end", "def delete\n end", "def delete_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.delete_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.delete_tier1_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#delete_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def destroy\n @server_instance = ServerInstance.find(params[:id])\n @server_instance.destroy\n\n respond_to do |format|\n format.html { redirect_to server_instances_url }\n format.json { head :no_content }\n end\n end", "def destroy_instance(credentials, id)\n safely do\n terremark_client = new_client(credentials)\n return terremark_client.delete_vapp(id)\n end\nend", "def destroy; end", "def destroy; end", "def destroy; end", "def destroy; end", "def destroy; end", "def destroy; end", "def destroy; end", "def destroy; end", "def destroy; end", "def destroy; end", "def delete_accounts\n end", "def delete_instance request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_delete_instance_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "def destroy\n @approximate_service = ApproximateService.find(params[:id])\n @approximate_service.destroy\n\n respond_to do |format|\n format.html { redirect_to(approximate_services_url) }\n format.xml { head :ok }\n end\n end", "def running_delete\n base_delete(params, \"Running\")\n end", "def delete_vm_instance(name, namespace)\n @conn.vminstances.destroy(name, namespace)\n end", "def delete\n end", "def delete\n end", "def delete\n end", "def delete\n end", "def delete\n end", "def delete\n end", "def delete\n end", "def destroy\n @client.delete( name )\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def destroy\n @instance_fault = InstanceFault.find(params[:id])\n @instance_fault.destroy\n\n respond_to do |format|\n format.html { redirect_to instance_faults_url }\n format.json { head :no_content }\n end\n end", "def destroy \r\n\r\n end", "def delete(options={})\n DNSimple::Client.delete \"templates/#{id}\", options\n end" ]
[ "0.69459134", "0.69426256", "0.66297525", "0.63652927", "0.63462526", "0.6313143", "0.62876856", "0.62580794", "0.6239327", "0.6239327", "0.6239327", "0.6234806", "0.62201583", "0.615115", "0.61015517", "0.60904086", "0.6065493", "0.5996408", "0.59692955", "0.5960244", "0.5954344", "0.59477156", "0.5933981", "0.5928449", "0.59249353", "0.59150004", "0.5896784", "0.58962584", "0.58939725", "0.58886325", "0.5880045", "0.5876183", "0.58709615", "0.5867351", "0.58650917", "0.5862373", "0.5852977", "0.5849175", "0.5847667", "0.58370733", "0.5832615", "0.58196414", "0.5813575", "0.580387", "0.58027357", "0.5794387", "0.57846737", "0.5782348", "0.5779622", "0.576865", "0.57680047", "0.5766754", "0.5764765", "0.5763112", "0.5756143", "0.5756143", "0.575593", "0.5752664", "0.5752222", "0.5745434", "0.574357", "0.5742205", "0.5738524", "0.5734232", "0.5728177", "0.5722865", "0.5722865", "0.57212675", "0.5720566", "0.57191855", "0.57137054", "0.57134473", "0.57134473", "0.57134473", "0.57134473", "0.57134473", "0.57134473", "0.57134473", "0.57134473", "0.57134473", "0.57134473", "0.57081807", "0.5705768", "0.57007605", "0.56955284", "0.56955045", "0.5695293", "0.5695293", "0.5695293", "0.5695293", "0.5695293", "0.5695293", "0.5695293", "0.5693609", "0.5687934", "0.5687934", "0.5687934", "0.5687934", "0.56878155", "0.56825864", "0.56818956" ]
0.0
-1
Delete Tier1 service instance endpoint Delete Tier1 service instance endpoint
def delete_tier1_policy_service_instance_endpoint_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint ...' end # verify the required parameter 'tier_1_id' is set if @api_client.config.client_side_validation && tier_1_id.nil? fail ArgumentError, "Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint" end # verify the required parameter 'locale_service_id' is set if @api_client.config.client_side_validation && locale_service_id.nil? fail ArgumentError, "Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint" end # verify the required parameter 'service_instance_id' is set if @api_client.config.client_side_validation && service_instance_id.nil? fail ArgumentError, "Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint" end # verify the required parameter 'service_instance_endpoint_id' is set if @api_client.config.client_side_validation && service_instance_endpoint_id.nil? fail ArgumentError, "Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint" end # resource path local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#delete_tier1_policy_service_instance_endpoint\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete\n self.class.delete_service_instance(@service_name, @name)\n end", "def delete\n ensure_service!\n service.delete_instance path\n true\n end", "def delete endpoint\n do_request :delete, endpoint\n end", "def delete_instance instance_id\n instances.delete_instance name: instance_path(instance_id)\n end", "def destroy\n requires :id\n \n service.delete_nat_gateway(id)\n true\n end", "def delete(instance) # rubocop:disable Metrics/AbcSize\n authcookie = ComputeBase.new\n authcookie = authcookie.authenticate(id_domain, user, passwd, restendpoint)\n url = restendpoint + @function + instance\n uri = URI.parse(url)\n http = Net::HTTP.new(uri.host, uri.port, @proxy_addr, @proxy_port) # Creates a http object\n http.use_ssl = true # When using https\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Delete.new(uri.request_uri)\n request.add_field 'accept', 'application/oracle-compute-v3+json'\n request.add_field 'Cookie', authcookie\n http.request(request)\n end", "def delete\n ensure_service!\n service.delete_table instance_id, name\n true\n end", "def delete\n @service.delete(self)\n end", "def destroy\n @service.destroy\n end", "def destroy\n @service.destroy\n end", "def destroy\n @service.destroy\n end", "def delete_server\n super\n end", "def delete\n @service.delete(self)\n end", "def destroy\n @instance = @provider.instances.find(params[:id])\n InstanceOperations.terminate_instances(@provider.connect!, @instance)\n @instance.destroy\n redirect_to cloud_provider_path(@provider) \n end", "def delete_tier1_policy_service_instance_endpoint_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#delete_tier1_policy_service_instance_endpoint_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def destroy\n @end_service.destroy\n head :no_content\n end", "def destroy\n @vip_service.destroy\n respond_to do |format|\n format.html { redirect_to(admin_vip_services_url) }\n format.xml { head :ok }\n end\n website.add_log(user: current_user, action: \"Deleted a amx vip service: #{@vip_service.name}\")\n end", "def delete\n \n end", "def destroy_backend\n Rails.logger.info \"Removing tenant #{self.name} with tenant id #{self.uuid}.\"\n\n Rails.logger.info \"Undeploying all instances for tenant #{self.name}...\"\n # Delete all instances\n if self.instances.count > 0\n success = self.instances.each {|i| i.undeploy }\n if success\n Rails.logger.info \"Removed all instances for tenant #{self.name}.\"\n else\n Rails.logger.error \"Could not remove instance during project deletion:\"\n Rails.logger.error \"Instance: #{i.name} #{i.id} #{i.uuid}\"\n return false\n end\n end\n\n compute_c = get_connection(\"compute\")\n network_c = get_connection(\"network\")\n identity_c = get_connection(\"identity\")\n\n # Unallocate floating ips\n floating_ips = compute_c.get_floating_ips\n floating_ips.each do |ip|\n Rails.logger.info \"Deleting floating ip #{ip.ip} with id #{ip.id}\"\n compute_c.delete_floating_ip(ip.id)\n end\n\n routers = network_c.list_routers.select {|router| router.tenant_id == self.uuid}\n subnets = network_c.list_subnets.select {|subnet| subnet.tenant_id == self.uuid}\n networks = network_c.list_networks.select {|network| network.tenant_id == self.uuid}\n\n # Clear all router gateways\n routers.each do |router|\n Rails.logger.info \"Clearing router gateway for #{router.name} with id #{router.id}.\"\n # Remove gateway from the router\n network_c.update_router(router.id, {\"external_gateway_info\" => {}})\n end\n\n # loop through each network\n # For each router, remove any subnet interfaces\n networks.each do |network|\n subnets.select {|subnet| subnet.network_id == network.id}.each do |subnet|\n routers.each do |router|\n begin\n Rails.logger.info \"Attempting to remove router interface for subnet #{subnet.name} with id #{subnet.id} from router #{router.name} with id #{router.id}.\"\n network_c.remove_router_interface(router.id, subnet.id)\n Rails.logger.info \"Successfully removed router interface for subnet #{subnet.name}.\"\n rescue => e\n Rails.logger.error \"Tried to remove router interface for subnet #{subnet.name} with id #{subnet.id} from router #{router.name} with id #{router.id}.\"\n end\n end\n end\n end\n\n # Delete all subnets\n subnets.each do |subnet|\n Rails.logger.info \"Deleting subnet #{subnet.name} with id #{subnet.id}\"\n network_c.delete_subnet(subnet.id)\n end\n\n # Delete all routers\n routers.each do |router|\n Rails.logger.info \"Deleting router #{router.name} with id #{router.id}\"\n network_c.delete_router(router.id)\n end\n\n # Delete all networks\n networks.each do |network|\n Rails.logger.info \"Deleting network #{network.name} with id #{network.id}\"\n network_c.delete_network(network.id)\n end\n\n # Finally, delete the tenant\n Rails.logger.info \"Deleting tenant #{self.name} with id #{self.uuid}\"\n identity_c.delete_tenant(self.uuid)\n\n Rails.logger.info \"Removal of tenant #{self.name} on the OpenStack backend succeeded.\"\n end", "def delete()\n @client.make_request(:delete, @client.concat_user_path(\"#{DOMAIN_PATH}/#{domain_id}/endpoints/#{id}\"))[0]\n end", "def destroy\n requires :customer_gateway_id\n \n service.delete_customer_gateway(customer_gateway_id)\n true\n end", "def delete_instance instance_id\n execute do\n instances.delete_instance(\n instance_path(instance_id)\n )\n end\n end", "def delete_virtual_server\n super\n end", "def destroy_service\n delete_monit_config\n super\n end", "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def destroy\n debug(\"#{self.class}::destroy\")\n\n #Retrieval of key\n if ((defined? $key) && !(($key.nil?) || ($key.empty?)))\n Puppet.debug('INFO: key already provided as a command parameter ' + $key)\n\n elsif (!($name.to_s.empty?) )\n\n #Retrieve key\n uriAttributeMap1 = {}\n uriAttributeMap1[:name] = $name\n resourceType = \"storage-service-levels\"\n $key = self.retrieveKeyOfObjectType('/api/1.0/slo/storage-service-levels', resourceType, uriAttributeMap1)\n\n end\n\n\n apiUri = '/api/1.0/slo/storage-service-levels/'+$key\n resourceType = \"storageservicelevel\"\n\n if(transport.http_delete_request(apiUri ,resourceType))\n if(resource[:name] != null)\n puts \"#{resourceType} : #{resource[:name]} successfully deleted\"\n\t\t\telse\n\t\t\t puts \" #{resourceType} successfully deleted\"\n\t\t\tend\n else\n if(resource[:name] != null)\n puts \" #{resourceType} : #{resource[:name]} deletion failed\"\n\t\t else\n\t\t\t puts \" #{resourceType} deletion failed\"\n\t\t end\n end\n\nend", "def delete_pvm_instance(instance_id)\n delete(\"cloud-instances/#{guid}/pvm-instances/#{instance_id}\")\n end", "def service_delete(name)\n\t\tif session_has_services_depend?\n\t\t\tmeterpreter_service_delete(name)\n\t\telse\n\t\t\tshell_service_delete(name)\n\t\tend\n\tend", "def destroy\n RubyLokaliseApi::Generics::DeletedResource.new(\n reinit_endpoint.do_delete.content\n )\n end", "def service_group_delete(a10, name)\n a10.send(:axapi, 'slb.service_group.delete', 'post', {name: name, format: 'json'})\nend", "def delete!\n server.delete(name)\n end", "def destroy\n @endpoint.destroy\n respond_to do |format|\n format.html { redirect_to root_url, notice: 'Endpoint was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def stop\n service.pool_action uuid, :destroy\n end", "def delete\n execute_prlctl('delete', @uuid)\n end", "def delete(id)\n @service.delete(id)\n end", "def delete\n stop\n [ @resource['instances_dir'] + \"/\" + @resource[:name],\n @resource['instances_dir'] + \"/\" + \"_\" + @resource[:name]\n ].each do |dir|\n FileUtils.rm_rf(dir) if File.directory?(dir)\n end\n end", "def delete_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#delete_tier1_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def destroy\n return if @name.nil?\n delete_rest \"vservers/#{@name}\"\n end", "def delete(service_instance_guid)\n service_instance = @client.service_instance(service_instance_guid)\n service_instance.service_bindings.each do |s|\n s.delete!\n end\n\n service_instance.delete!\n end", "def destroy\n @serv = Serv.find(params[:id])\n if @serv.mngbl\n #Remueve el MR a través de una llamada al webservice del núcleo\n http = Net::HTTP.new(\"192.168.119.163\",9999)\n post_params = {'ip' => @serv.conn.ip, 'port' => @serv.conn.port}\n request = Net::HTTP::Delete.new(\"/mbs/#{@serv.domain}/#{@serv.name}\")\n request.set_form_data(post_params)\n begin\n response = http.request(request)\n rescue Errno::ECONNREFUSED\n end\n end\n @serv.destroy\n\n respond_to do |format|\n format.html { redirect_to servs_url, notice: t('servs.delete.notice') }\n format.json { head :no_content }\n end\n end", "def destroy; delete end", "def delete\n start { |connection| connection.request http :Delete }\n end", "def delete\n results = submit_cmd('delete app instance',:db, \" -env #{self.belongs_to.env} -app_instance #{self.name}\")\n\n\t if ( results.to_s =~ /failure/i || results.to_s =~ /error/i)\n\t \t raise \"update attribute failed\" \n\t else\n\t \t self.belongs_to.appTemplates.delete(self)\n\t end\n\n end", "def delete_tier1_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#delete_tier1_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def destroy\n @loadbalancer = Loadbalancer.find(params[:id])\n checkaccountobject(\"loadbalancers\",@loadbalancer)\n @loadbalancer.send_delete\n\n respond_to do |format|\n format.html { redirect_to loadbalancers_url }\n format.json { head :ok }\n end\n end", "def destroy\n audit(@service_template, \"destroy\", @service_template.name)\n authorize @service_template\n\n @service_template.destroy\n respond_to do |format|\n format.html { redirect_to service_templates_url, notice: 'Service template was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @nagios_service_escalation_template = NagiosServiceEscalationTemplate.find(params[:id])\n @nagios_service_escalation_template.destroy\n\n respond_to do |format|\n format.html { redirect_to(nagios_service_escalation_templates_url) }\n format.xml { head :ok }\n end\n end", "def delete_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_byod_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_byod_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#delete_tier1_byod_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete\n \n end", "def destroy\n @taxi_sevice.destroy\n respond_to do |format|\n format.html { redirect_to taxi_sevices_url, notice: 'Taxi sevice was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n \n keystone.delete_tenant(keystone.get_tenant(params[:id])[:id])\n\n respond_to do |format|\n format.html { redirect_to tenants_url }\n format.json { head :ok }\n end\n end", "def delete\n svc = Service.find_by_label(params[:label])\n raise CloudError.new(CloudError::SERVICE_NOT_FOUND) unless svc\n raise CloudError.new(CloudError::FORBIDDEN) unless svc.verify_auth_token(@service_auth_token)\n\n svc.destroy\n\n render :json => {}\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n \n end", "def destroy\n \n end", "def delete_tier1_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.delete_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.delete_tier1\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#delete_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_endpoint(vm_name, cloud_service_name, endpoint_name)\n vm = get_virtual_machine(vm_name, cloud_service_name)\n if vm\n path = \"/services/hostedservices/#{vm.cloud_service_name}/deployments/#{vm.deployment_name}/roles/#{vm_name}\"\n endpoints = vm.tcp_endpoints + vm.udp_endpoints\n endpoints.delete_if { |ep| endpoint_name.downcase == ep[:name].downcase }\n body = Serialization.update_role_to_xml(endpoints, vm)\n request = client.management_request(:put, path, body: body)\n Azure::Loggerx.info \"Deleting virtual machine endpoint #{endpoint_name} ...\"\n request.call\n else\n Azure::Loggerx.error \"Cannot find virtual machine \\\"#{vm_name}\\\" under cloud service \\\"#{cloud_service_name}\\\".\"\n end\n end", "def destroy\n @idti_service.destroy\n respond_to do |format|\n format.html { redirect_to idti_services_url, notice: 'Idti service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def del_service(wspace, address, proto, port, comm='')\n\n\t\thost = get_host(:workspace => wspace, :address => address)\n\t\treturn unless host\n\n\t\thost.services.all(:conditions => {:proto => proto, :port => port}).each { |s| s.destroy }\n\tend", "def destroy\n fail('Destroying fip pool is not supported using contrail api')\n end", "def destroy\r\n\r\n end", "def delete\n super \"/templates/#{template_id}.json\", {}\n end", "def delete\n\n end", "def delete_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_byod_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_byod_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#delete_tier1_byod_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def destroy\n @servicetype = Servicetype.find(params[:id])\n @servicetype.destroy\n\n respond_to do |format|\n format.html { redirect_to servicetypes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @servicetype = Servicetype.find(params[:id])\n @servicetype.destroy\n\n respond_to do |format|\n format.html { redirect_to servicetypes_url }\n format.json { head :no_content }\n end\n end", "def delete\n end", "def delete_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.delete_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.delete_tier1_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#delete_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def destroy\n @server_instance = ServerInstance.find(params[:id])\n @server_instance.destroy\n\n respond_to do |format|\n format.html { redirect_to server_instances_url }\n format.json { head :no_content }\n end\n end", "def destroy_instance(credentials, id)\n safely do\n terremark_client = new_client(credentials)\n return terremark_client.delete_vapp(id)\n end\nend", "def destroy; end", "def destroy; end", "def destroy; end", "def destroy; end", "def destroy; end", "def destroy; end", "def destroy; end", "def destroy; end", "def destroy; end", "def destroy; end", "def delete_accounts\n end", "def delete_instance request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_delete_instance_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "def destroy\n @approximate_service = ApproximateService.find(params[:id])\n @approximate_service.destroy\n\n respond_to do |format|\n format.html { redirect_to(approximate_services_url) }\n format.xml { head :ok }\n end\n end", "def running_delete\n base_delete(params, \"Running\")\n end", "def delete_vm_instance(name, namespace)\n @conn.vminstances.destroy(name, namespace)\n end", "def delete\n end", "def delete\n end", "def delete\n end", "def delete\n end", "def delete\n end", "def delete\n end", "def delete\n end", "def destroy\n @client.delete( name )\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def destroy\n @instance_fault = InstanceFault.find(params[:id])\n @instance_fault.destroy\n\n respond_to do |format|\n format.html { redirect_to instance_faults_url }\n format.json { head :no_content }\n end\n end", "def destroy \r\n\r\n end", "def delete(options={})\n DNSimple::Client.delete \"templates/#{id}\", options\n end" ]
[ "0.69459134", "0.69426256", "0.66297525", "0.63652927", "0.63462526", "0.6313143", "0.62876856", "0.62580794", "0.6239327", "0.6239327", "0.6239327", "0.6234806", "0.62201583", "0.615115", "0.61015517", "0.60904086", "0.5996408", "0.59692955", "0.5960244", "0.5954344", "0.59477156", "0.5933981", "0.5928449", "0.59249353", "0.59150004", "0.5896784", "0.58962584", "0.58939725", "0.58886325", "0.5880045", "0.5876183", "0.58709615", "0.5867351", "0.58650917", "0.5862373", "0.5852977", "0.5849175", "0.5847667", "0.58370733", "0.5832615", "0.58196414", "0.5813575", "0.580387", "0.58027357", "0.5794387", "0.57846737", "0.5782348", "0.5779622", "0.576865", "0.57680047", "0.5766754", "0.5764765", "0.5763112", "0.5756143", "0.5756143", "0.575593", "0.5752664", "0.5752222", "0.5745434", "0.574357", "0.5742205", "0.5738524", "0.5734232", "0.5728177", "0.5722865", "0.5722865", "0.57212675", "0.5720566", "0.57191855", "0.57137054", "0.57134473", "0.57134473", "0.57134473", "0.57134473", "0.57134473", "0.57134473", "0.57134473", "0.57134473", "0.57134473", "0.57134473", "0.57081807", "0.5705768", "0.57007605", "0.56955284", "0.56955045", "0.5695293", "0.5695293", "0.5695293", "0.5695293", "0.5695293", "0.5695293", "0.5695293", "0.5693609", "0.5687934", "0.5687934", "0.5687934", "0.5687934", "0.56878155", "0.56825864", "0.56818956" ]
0.6065493
16
Delete Tier1 service instance endpoint Delete Tier1 service instance endpoint
def delete_tier1_policy_service_instance_endpoint_0(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, opts = {}) delete_tier1_policy_service_instance_endpoint_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, opts) nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete\n self.class.delete_service_instance(@service_name, @name)\n end", "def delete\n ensure_service!\n service.delete_instance path\n true\n end", "def delete endpoint\n do_request :delete, endpoint\n end", "def delete_instance instance_id\n instances.delete_instance name: instance_path(instance_id)\n end", "def destroy\n requires :id\n \n service.delete_nat_gateway(id)\n true\n end", "def delete(instance) # rubocop:disable Metrics/AbcSize\n authcookie = ComputeBase.new\n authcookie = authcookie.authenticate(id_domain, user, passwd, restendpoint)\n url = restendpoint + @function + instance\n uri = URI.parse(url)\n http = Net::HTTP.new(uri.host, uri.port, @proxy_addr, @proxy_port) # Creates a http object\n http.use_ssl = true # When using https\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Delete.new(uri.request_uri)\n request.add_field 'accept', 'application/oracle-compute-v3+json'\n request.add_field 'Cookie', authcookie\n http.request(request)\n end", "def delete\n ensure_service!\n service.delete_table instance_id, name\n true\n end", "def delete\n @service.delete(self)\n end", "def destroy\n @service.destroy\n end", "def destroy\n @service.destroy\n end", "def destroy\n @service.destroy\n end", "def delete_server\n super\n end", "def delete\n @service.delete(self)\n end", "def destroy\n @instance = @provider.instances.find(params[:id])\n InstanceOperations.terminate_instances(@provider.connect!, @instance)\n @instance.destroy\n redirect_to cloud_provider_path(@provider) \n end", "def delete_tier1_policy_service_instance_endpoint_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#delete_tier1_policy_service_instance_endpoint_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def destroy\n @end_service.destroy\n head :no_content\n end", "def delete_tier1_policy_service_instance_endpoint_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#delete_tier1_policy_service_instance_endpoint\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def destroy\n @vip_service.destroy\n respond_to do |format|\n format.html { redirect_to(admin_vip_services_url) }\n format.xml { head :ok }\n end\n website.add_log(user: current_user, action: \"Deleted a amx vip service: #{@vip_service.name}\")\n end", "def delete\n \n end", "def destroy_backend\n Rails.logger.info \"Removing tenant #{self.name} with tenant id #{self.uuid}.\"\n\n Rails.logger.info \"Undeploying all instances for tenant #{self.name}...\"\n # Delete all instances\n if self.instances.count > 0\n success = self.instances.each {|i| i.undeploy }\n if success\n Rails.logger.info \"Removed all instances for tenant #{self.name}.\"\n else\n Rails.logger.error \"Could not remove instance during project deletion:\"\n Rails.logger.error \"Instance: #{i.name} #{i.id} #{i.uuid}\"\n return false\n end\n end\n\n compute_c = get_connection(\"compute\")\n network_c = get_connection(\"network\")\n identity_c = get_connection(\"identity\")\n\n # Unallocate floating ips\n floating_ips = compute_c.get_floating_ips\n floating_ips.each do |ip|\n Rails.logger.info \"Deleting floating ip #{ip.ip} with id #{ip.id}\"\n compute_c.delete_floating_ip(ip.id)\n end\n\n routers = network_c.list_routers.select {|router| router.tenant_id == self.uuid}\n subnets = network_c.list_subnets.select {|subnet| subnet.tenant_id == self.uuid}\n networks = network_c.list_networks.select {|network| network.tenant_id == self.uuid}\n\n # Clear all router gateways\n routers.each do |router|\n Rails.logger.info \"Clearing router gateway for #{router.name} with id #{router.id}.\"\n # Remove gateway from the router\n network_c.update_router(router.id, {\"external_gateway_info\" => {}})\n end\n\n # loop through each network\n # For each router, remove any subnet interfaces\n networks.each do |network|\n subnets.select {|subnet| subnet.network_id == network.id}.each do |subnet|\n routers.each do |router|\n begin\n Rails.logger.info \"Attempting to remove router interface for subnet #{subnet.name} with id #{subnet.id} from router #{router.name} with id #{router.id}.\"\n network_c.remove_router_interface(router.id, subnet.id)\n Rails.logger.info \"Successfully removed router interface for subnet #{subnet.name}.\"\n rescue => e\n Rails.logger.error \"Tried to remove router interface for subnet #{subnet.name} with id #{subnet.id} from router #{router.name} with id #{router.id}.\"\n end\n end\n end\n end\n\n # Delete all subnets\n subnets.each do |subnet|\n Rails.logger.info \"Deleting subnet #{subnet.name} with id #{subnet.id}\"\n network_c.delete_subnet(subnet.id)\n end\n\n # Delete all routers\n routers.each do |router|\n Rails.logger.info \"Deleting router #{router.name} with id #{router.id}\"\n network_c.delete_router(router.id)\n end\n\n # Delete all networks\n networks.each do |network|\n Rails.logger.info \"Deleting network #{network.name} with id #{network.id}\"\n network_c.delete_network(network.id)\n end\n\n # Finally, delete the tenant\n Rails.logger.info \"Deleting tenant #{self.name} with id #{self.uuid}\"\n identity_c.delete_tenant(self.uuid)\n\n Rails.logger.info \"Removal of tenant #{self.name} on the OpenStack backend succeeded.\"\n end", "def delete()\n @client.make_request(:delete, @client.concat_user_path(\"#{DOMAIN_PATH}/#{domain_id}/endpoints/#{id}\"))[0]\n end", "def destroy\n requires :customer_gateway_id\n \n service.delete_customer_gateway(customer_gateway_id)\n true\n end", "def delete_instance instance_id\n execute do\n instances.delete_instance(\n instance_path(instance_id)\n )\n end\n end", "def delete_virtual_server\n super\n end", "def destroy_service\n delete_monit_config\n super\n end", "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def delete_pvm_instance(instance_id)\n delete(\"cloud-instances/#{guid}/pvm-instances/#{instance_id}\")\n end", "def destroy\n debug(\"#{self.class}::destroy\")\n\n #Retrieval of key\n if ((defined? $key) && !(($key.nil?) || ($key.empty?)))\n Puppet.debug('INFO: key already provided as a command parameter ' + $key)\n\n elsif (!($name.to_s.empty?) )\n\n #Retrieve key\n uriAttributeMap1 = {}\n uriAttributeMap1[:name] = $name\n resourceType = \"storage-service-levels\"\n $key = self.retrieveKeyOfObjectType('/api/1.0/slo/storage-service-levels', resourceType, uriAttributeMap1)\n\n end\n\n\n apiUri = '/api/1.0/slo/storage-service-levels/'+$key\n resourceType = \"storageservicelevel\"\n\n if(transport.http_delete_request(apiUri ,resourceType))\n if(resource[:name] != null)\n puts \"#{resourceType} : #{resource[:name]} successfully deleted\"\n\t\t\telse\n\t\t\t puts \" #{resourceType} successfully deleted\"\n\t\t\tend\n else\n if(resource[:name] != null)\n puts \" #{resourceType} : #{resource[:name]} deletion failed\"\n\t\t else\n\t\t\t puts \" #{resourceType} deletion failed\"\n\t\t end\n end\n\nend", "def service_delete(name)\n\t\tif session_has_services_depend?\n\t\t\tmeterpreter_service_delete(name)\n\t\telse\n\t\t\tshell_service_delete(name)\n\t\tend\n\tend", "def destroy\n RubyLokaliseApi::Generics::DeletedResource.new(\n reinit_endpoint.do_delete.content\n )\n end", "def service_group_delete(a10, name)\n a10.send(:axapi, 'slb.service_group.delete', 'post', {name: name, format: 'json'})\nend", "def delete!\n server.delete(name)\n end", "def destroy\n @endpoint.destroy\n respond_to do |format|\n format.html { redirect_to root_url, notice: 'Endpoint was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def stop\n service.pool_action uuid, :destroy\n end", "def delete\n execute_prlctl('delete', @uuid)\n end", "def delete(id)\n @service.delete(id)\n end", "def delete\n stop\n [ @resource['instances_dir'] + \"/\" + @resource[:name],\n @resource['instances_dir'] + \"/\" + \"_\" + @resource[:name]\n ].each do |dir|\n FileUtils.rm_rf(dir) if File.directory?(dir)\n end\n end", "def destroy\n return if @name.nil?\n delete_rest \"vservers/#{@name}\"\n end", "def delete_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#delete_tier1_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete(service_instance_guid)\n service_instance = @client.service_instance(service_instance_guid)\n service_instance.service_bindings.each do |s|\n s.delete!\n end\n\n service_instance.delete!\n end", "def destroy\n @serv = Serv.find(params[:id])\n if @serv.mngbl\n #Remueve el MR a través de una llamada al webservice del núcleo\n http = Net::HTTP.new(\"192.168.119.163\",9999)\n post_params = {'ip' => @serv.conn.ip, 'port' => @serv.conn.port}\n request = Net::HTTP::Delete.new(\"/mbs/#{@serv.domain}/#{@serv.name}\")\n request.set_form_data(post_params)\n begin\n response = http.request(request)\n rescue Errno::ECONNREFUSED\n end\n end\n @serv.destroy\n\n respond_to do |format|\n format.html { redirect_to servs_url, notice: t('servs.delete.notice') }\n format.json { head :no_content }\n end\n end", "def destroy; delete end", "def delete\n start { |connection| connection.request http :Delete }\n end", "def delete\n results = submit_cmd('delete app instance',:db, \" -env #{self.belongs_to.env} -app_instance #{self.name}\")\n\n\t if ( results.to_s =~ /failure/i || results.to_s =~ /error/i)\n\t \t raise \"update attribute failed\" \n\t else\n\t \t self.belongs_to.appTemplates.delete(self)\n\t end\n\n end", "def delete_tier1_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#delete_tier1_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def destroy\n @loadbalancer = Loadbalancer.find(params[:id])\n checkaccountobject(\"loadbalancers\",@loadbalancer)\n @loadbalancer.send_delete\n\n respond_to do |format|\n format.html { redirect_to loadbalancers_url }\n format.json { head :ok }\n end\n end", "def destroy\n audit(@service_template, \"destroy\", @service_template.name)\n authorize @service_template\n\n @service_template.destroy\n respond_to do |format|\n format.html { redirect_to service_templates_url, notice: 'Service template was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @nagios_service_escalation_template = NagiosServiceEscalationTemplate.find(params[:id])\n @nagios_service_escalation_template.destroy\n\n respond_to do |format|\n format.html { redirect_to(nagios_service_escalation_templates_url) }\n format.xml { head :ok }\n end\n end", "def delete_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_byod_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_byod_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#delete_tier1_byod_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete\n \n end", "def destroy\n @taxi_sevice.destroy\n respond_to do |format|\n format.html { redirect_to taxi_sevices_url, notice: 'Taxi sevice was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n \n keystone.delete_tenant(keystone.get_tenant(params[:id])[:id])\n\n respond_to do |format|\n format.html { redirect_to tenants_url }\n format.json { head :ok }\n end\n end", "def delete\n svc = Service.find_by_label(params[:label])\n raise CloudError.new(CloudError::SERVICE_NOT_FOUND) unless svc\n raise CloudError.new(CloudError::FORBIDDEN) unless svc.verify_auth_token(@service_auth_token)\n\n svc.destroy\n\n render :json => {}\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n \n end", "def destroy\n \n end", "def delete_tier1_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.delete_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.delete_tier1\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#delete_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def destroy\n @idti_service.destroy\n respond_to do |format|\n format.html { redirect_to idti_services_url, notice: 'Idti service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_endpoint(vm_name, cloud_service_name, endpoint_name)\n vm = get_virtual_machine(vm_name, cloud_service_name)\n if vm\n path = \"/services/hostedservices/#{vm.cloud_service_name}/deployments/#{vm.deployment_name}/roles/#{vm_name}\"\n endpoints = vm.tcp_endpoints + vm.udp_endpoints\n endpoints.delete_if { |ep| endpoint_name.downcase == ep[:name].downcase }\n body = Serialization.update_role_to_xml(endpoints, vm)\n request = client.management_request(:put, path, body: body)\n Azure::Loggerx.info \"Deleting virtual machine endpoint #{endpoint_name} ...\"\n request.call\n else\n Azure::Loggerx.error \"Cannot find virtual machine \\\"#{vm_name}\\\" under cloud service \\\"#{cloud_service_name}\\\".\"\n end\n end", "def del_service(wspace, address, proto, port, comm='')\n\n\t\thost = get_host(:workspace => wspace, :address => address)\n\t\treturn unless host\n\n\t\thost.services.all(:conditions => {:proto => proto, :port => port}).each { |s| s.destroy }\n\tend", "def destroy\n fail('Destroying fip pool is not supported using contrail api')\n end", "def destroy\r\n\r\n end", "def delete\n super \"/templates/#{template_id}.json\", {}\n end", "def delete\n\n end", "def delete_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_byod_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_byod_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#delete_tier1_byod_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def destroy\n @servicetype = Servicetype.find(params[:id])\n @servicetype.destroy\n\n respond_to do |format|\n format.html { redirect_to servicetypes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @servicetype = Servicetype.find(params[:id])\n @servicetype.destroy\n\n respond_to do |format|\n format.html { redirect_to servicetypes_url }\n format.json { head :no_content }\n end\n end", "def delete\n end", "def destroy\n @server_instance = ServerInstance.find(params[:id])\n @server_instance.destroy\n\n respond_to do |format|\n format.html { redirect_to server_instances_url }\n format.json { head :no_content }\n end\n end", "def delete_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.delete_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.delete_tier1_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#delete_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def destroy; end", "def destroy; end", "def destroy; end", "def destroy; end", "def destroy; end", "def destroy; end", "def destroy; end", "def destroy; end", "def destroy; end", "def destroy; end", "def destroy_instance(credentials, id)\n safely do\n terremark_client = new_client(credentials)\n return terremark_client.delete_vapp(id)\n end\nend", "def delete_accounts\n end", "def delete_instance request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_delete_instance_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "def destroy\n @approximate_service = ApproximateService.find(params[:id])\n @approximate_service.destroy\n\n respond_to do |format|\n format.html { redirect_to(approximate_services_url) }\n format.xml { head :ok }\n end\n end", "def running_delete\n base_delete(params, \"Running\")\n end", "def delete_vm_instance(name, namespace)\n @conn.vminstances.destroy(name, namespace)\n end", "def delete\n end", "def delete\n end", "def delete\n end", "def delete\n end", "def delete\n end", "def delete\n end", "def delete\n end", "def destroy\n @client.delete( name )\n end", "def destroy\n @instance_fault = InstanceFault.find(params[:id])\n @instance_fault.destroy\n\n respond_to do |format|\n format.html { redirect_to instance_faults_url }\n format.json { head :no_content }\n end\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def destroy \r\n\r\n end", "def delete(options={})\n DNSimple::Client.delete \"templates/#{id}\", options\n end" ]
[ "0.6946954", "0.6943312", "0.6631016", "0.6367239", "0.6347225", "0.6314414", "0.62890327", "0.6258767", "0.6240179", "0.6240179", "0.6240179", "0.62361693", "0.62209016", "0.61527526", "0.6099607", "0.60916257", "0.6063585", "0.59976673", "0.5970206", "0.5960316", "0.59547156", "0.59481907", "0.59359634", "0.59296715", "0.59252024", "0.5915633", "0.5898039", "0.5896582", "0.58945733", "0.5889263", "0.58808994", "0.58776355", "0.5872352", "0.5867907", "0.58653235", "0.5863107", "0.58536685", "0.58488107", "0.5847511", "0.58379155", "0.58341515", "0.5820708", "0.5815116", "0.58052135", "0.5801057", "0.5795133", "0.57851523", "0.5783601", "0.57782125", "0.576963", "0.57689464", "0.5767009", "0.5766273", "0.5764165", "0.5757495", "0.5757495", "0.57539237", "0.57534474", "0.5752524", "0.5746094", "0.5744716", "0.5743642", "0.57385427", "0.5735623", "0.5726782", "0.572412", "0.572412", "0.57224613", "0.5722045", "0.5718577", "0.57146734", "0.57146734", "0.57146734", "0.57146734", "0.57146734", "0.57146734", "0.57146734", "0.57146734", "0.57146734", "0.57146734", "0.5714625", "0.5708763", "0.5707726", "0.5701221", "0.5698048", "0.569698", "0.5696613", "0.5696613", "0.5696613", "0.5696613", "0.5696613", "0.5696613", "0.5696613", "0.5695178", "0.5689994", "0.568944", "0.568944", "0.568944", "0.568944", "0.5683899", "0.56818765" ]
0.0
-1
Delete Tier1 service instance endpoint Delete Tier1 service instance endpoint
def delete_tier1_policy_service_instance_endpoint_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint_0 ...' end # verify the required parameter 'tier_1_id' is set if @api_client.config.client_side_validation && tier_1_id.nil? fail ArgumentError, "Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint_0" end # verify the required parameter 'locale_service_id' is set if @api_client.config.client_side_validation && locale_service_id.nil? fail ArgumentError, "Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint_0" end # verify the required parameter 'service_instance_id' is set if @api_client.config.client_side_validation && service_instance_id.nil? fail ArgumentError, "Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint_0" end # verify the required parameter 'service_instance_endpoint_id' is set if @api_client.config.client_side_validation && service_instance_endpoint_id.nil? fail ArgumentError, "Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint_0" end # resource path local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#delete_tier1_policy_service_instance_endpoint_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete\n self.class.delete_service_instance(@service_name, @name)\n end", "def delete\n ensure_service!\n service.delete_instance path\n true\n end", "def delete endpoint\n do_request :delete, endpoint\n end", "def delete_instance instance_id\n instances.delete_instance name: instance_path(instance_id)\n end", "def destroy\n requires :id\n \n service.delete_nat_gateway(id)\n true\n end", "def delete(instance) # rubocop:disable Metrics/AbcSize\n authcookie = ComputeBase.new\n authcookie = authcookie.authenticate(id_domain, user, passwd, restendpoint)\n url = restendpoint + @function + instance\n uri = URI.parse(url)\n http = Net::HTTP.new(uri.host, uri.port, @proxy_addr, @proxy_port) # Creates a http object\n http.use_ssl = true # When using https\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Delete.new(uri.request_uri)\n request.add_field 'accept', 'application/oracle-compute-v3+json'\n request.add_field 'Cookie', authcookie\n http.request(request)\n end", "def delete\n ensure_service!\n service.delete_table instance_id, name\n true\n end", "def delete\n @service.delete(self)\n end", "def destroy\n @service.destroy\n end", "def destroy\n @service.destroy\n end", "def destroy\n @service.destroy\n end", "def delete_server\n super\n end", "def delete\n @service.delete(self)\n end", "def destroy\n @instance = @provider.instances.find(params[:id])\n InstanceOperations.terminate_instances(@provider.connect!, @instance)\n @instance.destroy\n redirect_to cloud_provider_path(@provider) \n end", "def destroy\n @end_service.destroy\n head :no_content\n end", "def delete_tier1_policy_service_instance_endpoint_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_endpoint\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#delete_tier1_policy_service_instance_endpoint\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def destroy\n @vip_service.destroy\n respond_to do |format|\n format.html { redirect_to(admin_vip_services_url) }\n format.xml { head :ok }\n end\n website.add_log(user: current_user, action: \"Deleted a amx vip service: #{@vip_service.name}\")\n end", "def delete\n \n end", "def destroy_backend\n Rails.logger.info \"Removing tenant #{self.name} with tenant id #{self.uuid}.\"\n\n Rails.logger.info \"Undeploying all instances for tenant #{self.name}...\"\n # Delete all instances\n if self.instances.count > 0\n success = self.instances.each {|i| i.undeploy }\n if success\n Rails.logger.info \"Removed all instances for tenant #{self.name}.\"\n else\n Rails.logger.error \"Could not remove instance during project deletion:\"\n Rails.logger.error \"Instance: #{i.name} #{i.id} #{i.uuid}\"\n return false\n end\n end\n\n compute_c = get_connection(\"compute\")\n network_c = get_connection(\"network\")\n identity_c = get_connection(\"identity\")\n\n # Unallocate floating ips\n floating_ips = compute_c.get_floating_ips\n floating_ips.each do |ip|\n Rails.logger.info \"Deleting floating ip #{ip.ip} with id #{ip.id}\"\n compute_c.delete_floating_ip(ip.id)\n end\n\n routers = network_c.list_routers.select {|router| router.tenant_id == self.uuid}\n subnets = network_c.list_subnets.select {|subnet| subnet.tenant_id == self.uuid}\n networks = network_c.list_networks.select {|network| network.tenant_id == self.uuid}\n\n # Clear all router gateways\n routers.each do |router|\n Rails.logger.info \"Clearing router gateway for #{router.name} with id #{router.id}.\"\n # Remove gateway from the router\n network_c.update_router(router.id, {\"external_gateway_info\" => {}})\n end\n\n # loop through each network\n # For each router, remove any subnet interfaces\n networks.each do |network|\n subnets.select {|subnet| subnet.network_id == network.id}.each do |subnet|\n routers.each do |router|\n begin\n Rails.logger.info \"Attempting to remove router interface for subnet #{subnet.name} with id #{subnet.id} from router #{router.name} with id #{router.id}.\"\n network_c.remove_router_interface(router.id, subnet.id)\n Rails.logger.info \"Successfully removed router interface for subnet #{subnet.name}.\"\n rescue => e\n Rails.logger.error \"Tried to remove router interface for subnet #{subnet.name} with id #{subnet.id} from router #{router.name} with id #{router.id}.\"\n end\n end\n end\n end\n\n # Delete all subnets\n subnets.each do |subnet|\n Rails.logger.info \"Deleting subnet #{subnet.name} with id #{subnet.id}\"\n network_c.delete_subnet(subnet.id)\n end\n\n # Delete all routers\n routers.each do |router|\n Rails.logger.info \"Deleting router #{router.name} with id #{router.id}\"\n network_c.delete_router(router.id)\n end\n\n # Delete all networks\n networks.each do |network|\n Rails.logger.info \"Deleting network #{network.name} with id #{network.id}\"\n network_c.delete_network(network.id)\n end\n\n # Finally, delete the tenant\n Rails.logger.info \"Deleting tenant #{self.name} with id #{self.uuid}\"\n identity_c.delete_tenant(self.uuid)\n\n Rails.logger.info \"Removal of tenant #{self.name} on the OpenStack backend succeeded.\"\n end", "def delete()\n @client.make_request(:delete, @client.concat_user_path(\"#{DOMAIN_PATH}/#{domain_id}/endpoints/#{id}\"))[0]\n end", "def destroy\n requires :customer_gateway_id\n \n service.delete_customer_gateway(customer_gateway_id)\n true\n end", "def delete_instance instance_id\n execute do\n instances.delete_instance(\n instance_path(instance_id)\n )\n end\n end", "def delete_virtual_server\n super\n end", "def destroy_service\n delete_monit_config\n super\n end", "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def destroy\n debug(\"#{self.class}::destroy\")\n\n #Retrieval of key\n if ((defined? $key) && !(($key.nil?) || ($key.empty?)))\n Puppet.debug('INFO: key already provided as a command parameter ' + $key)\n\n elsif (!($name.to_s.empty?) )\n\n #Retrieve key\n uriAttributeMap1 = {}\n uriAttributeMap1[:name] = $name\n resourceType = \"storage-service-levels\"\n $key = self.retrieveKeyOfObjectType('/api/1.0/slo/storage-service-levels', resourceType, uriAttributeMap1)\n\n end\n\n\n apiUri = '/api/1.0/slo/storage-service-levels/'+$key\n resourceType = \"storageservicelevel\"\n\n if(transport.http_delete_request(apiUri ,resourceType))\n if(resource[:name] != null)\n puts \"#{resourceType} : #{resource[:name]} successfully deleted\"\n\t\t\telse\n\t\t\t puts \" #{resourceType} successfully deleted\"\n\t\t\tend\n else\n if(resource[:name] != null)\n puts \" #{resourceType} : #{resource[:name]} deletion failed\"\n\t\t else\n\t\t\t puts \" #{resourceType} deletion failed\"\n\t\t end\n end\n\nend", "def delete_pvm_instance(instance_id)\n delete(\"cloud-instances/#{guid}/pvm-instances/#{instance_id}\")\n end", "def service_delete(name)\n\t\tif session_has_services_depend?\n\t\t\tmeterpreter_service_delete(name)\n\t\telse\n\t\t\tshell_service_delete(name)\n\t\tend\n\tend", "def destroy\n RubyLokaliseApi::Generics::DeletedResource.new(\n reinit_endpoint.do_delete.content\n )\n end", "def service_group_delete(a10, name)\n a10.send(:axapi, 'slb.service_group.delete', 'post', {name: name, format: 'json'})\nend", "def delete!\n server.delete(name)\n end", "def destroy\n @endpoint.destroy\n respond_to do |format|\n format.html { redirect_to root_url, notice: 'Endpoint was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def stop\n service.pool_action uuid, :destroy\n end", "def delete\n execute_prlctl('delete', @uuid)\n end", "def delete(id)\n @service.delete(id)\n end", "def delete\n stop\n [ @resource['instances_dir'] + \"/\" + @resource[:name],\n @resource['instances_dir'] + \"/\" + \"_\" + @resource[:name]\n ].each do |dir|\n FileUtils.rm_rf(dir) if File.directory?(dir)\n end\n end", "def delete_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#delete_tier1_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def destroy\n return if @name.nil?\n delete_rest \"vservers/#{@name}\"\n end", "def delete(service_instance_guid)\n service_instance = @client.service_instance(service_instance_guid)\n service_instance.service_bindings.each do |s|\n s.delete!\n end\n\n service_instance.delete!\n end", "def destroy\n @serv = Serv.find(params[:id])\n if @serv.mngbl\n #Remueve el MR a través de una llamada al webservice del núcleo\n http = Net::HTTP.new(\"192.168.119.163\",9999)\n post_params = {'ip' => @serv.conn.ip, 'port' => @serv.conn.port}\n request = Net::HTTP::Delete.new(\"/mbs/#{@serv.domain}/#{@serv.name}\")\n request.set_form_data(post_params)\n begin\n response = http.request(request)\n rescue Errno::ECONNREFUSED\n end\n end\n @serv.destroy\n\n respond_to do |format|\n format.html { redirect_to servs_url, notice: t('servs.delete.notice') }\n format.json { head :no_content }\n end\n end", "def destroy; delete end", "def delete\n start { |connection| connection.request http :Delete }\n end", "def delete\n results = submit_cmd('delete app instance',:db, \" -env #{self.belongs_to.env} -app_instance #{self.name}\")\n\n\t if ( results.to_s =~ /failure/i || results.to_s =~ /error/i)\n\t \t raise \"update attribute failed\" \n\t else\n\t \t self.belongs_to.appTemplates.delete(self)\n\t end\n\n end", "def delete_tier1_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#delete_tier1_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def destroy\n @loadbalancer = Loadbalancer.find(params[:id])\n checkaccountobject(\"loadbalancers\",@loadbalancer)\n @loadbalancer.send_delete\n\n respond_to do |format|\n format.html { redirect_to loadbalancers_url }\n format.json { head :ok }\n end\n end", "def destroy\n audit(@service_template, \"destroy\", @service_template.name)\n authorize @service_template\n\n @service_template.destroy\n respond_to do |format|\n format.html { redirect_to service_templates_url, notice: 'Service template was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @nagios_service_escalation_template = NagiosServiceEscalationTemplate.find(params[:id])\n @nagios_service_escalation_template.destroy\n\n respond_to do |format|\n format.html { redirect_to(nagios_service_escalation_templates_url) }\n format.xml { head :ok }\n end\n end", "def delete_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_byod_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_byod_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#delete_tier1_byod_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete\n \n end", "def destroy\n @taxi_sevice.destroy\n respond_to do |format|\n format.html { redirect_to taxi_sevices_url, notice: 'Taxi sevice was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n \n keystone.delete_tenant(keystone.get_tenant(params[:id])[:id])\n\n respond_to do |format|\n format.html { redirect_to tenants_url }\n format.json { head :ok }\n end\n end", "def delete\n svc = Service.find_by_label(params[:label])\n raise CloudError.new(CloudError::SERVICE_NOT_FOUND) unless svc\n raise CloudError.new(CloudError::FORBIDDEN) unless svc.verify_auth_token(@service_auth_token)\n\n svc.destroy\n\n render :json => {}\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n \n end", "def destroy\n \n end", "def delete_tier1_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.delete_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.delete_tier1\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#delete_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_endpoint(vm_name, cloud_service_name, endpoint_name)\n vm = get_virtual_machine(vm_name, cloud_service_name)\n if vm\n path = \"/services/hostedservices/#{vm.cloud_service_name}/deployments/#{vm.deployment_name}/roles/#{vm_name}\"\n endpoints = vm.tcp_endpoints + vm.udp_endpoints\n endpoints.delete_if { |ep| endpoint_name.downcase == ep[:name].downcase }\n body = Serialization.update_role_to_xml(endpoints, vm)\n request = client.management_request(:put, path, body: body)\n Azure::Loggerx.info \"Deleting virtual machine endpoint #{endpoint_name} ...\"\n request.call\n else\n Azure::Loggerx.error \"Cannot find virtual machine \\\"#{vm_name}\\\" under cloud service \\\"#{cloud_service_name}\\\".\"\n end\n end", "def destroy\n @idti_service.destroy\n respond_to do |format|\n format.html { redirect_to idti_services_url, notice: 'Idti service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def del_service(wspace, address, proto, port, comm='')\n\n\t\thost = get_host(:workspace => wspace, :address => address)\n\t\treturn unless host\n\n\t\thost.services.all(:conditions => {:proto => proto, :port => port}).each { |s| s.destroy }\n\tend", "def destroy\n fail('Destroying fip pool is not supported using contrail api')\n end", "def destroy\r\n\r\n end", "def delete\n super \"/templates/#{template_id}.json\", {}\n end", "def delete\n\n end", "def delete_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_byod_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_byod_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#delete_tier1_byod_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def destroy\n @servicetype = Servicetype.find(params[:id])\n @servicetype.destroy\n\n respond_to do |format|\n format.html { redirect_to servicetypes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @servicetype = Servicetype.find(params[:id])\n @servicetype.destroy\n\n respond_to do |format|\n format.html { redirect_to servicetypes_url }\n format.json { head :no_content }\n end\n end", "def delete\n end", "def delete_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.delete_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.delete_tier1_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#delete_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def destroy\n @server_instance = ServerInstance.find(params[:id])\n @server_instance.destroy\n\n respond_to do |format|\n format.html { redirect_to server_instances_url }\n format.json { head :no_content }\n end\n end", "def destroy_instance(credentials, id)\n safely do\n terremark_client = new_client(credentials)\n return terremark_client.delete_vapp(id)\n end\nend", "def destroy; end", "def destroy; end", "def destroy; end", "def destroy; end", "def destroy; end", "def destroy; end", "def destroy; end", "def destroy; end", "def destroy; end", "def destroy; end", "def delete_accounts\n end", "def delete_instance request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_delete_instance_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "def destroy\n @approximate_service = ApproximateService.find(params[:id])\n @approximate_service.destroy\n\n respond_to do |format|\n format.html { redirect_to(approximate_services_url) }\n format.xml { head :ok }\n end\n end", "def running_delete\n base_delete(params, \"Running\")\n end", "def delete_vm_instance(name, namespace)\n @conn.vminstances.destroy(name, namespace)\n end", "def delete\n end", "def delete\n end", "def delete\n end", "def delete\n end", "def delete\n end", "def delete\n end", "def delete\n end", "def destroy\n @client.delete( name )\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def destroy\n @instance_fault = InstanceFault.find(params[:id])\n @instance_fault.destroy\n\n respond_to do |format|\n format.html { redirect_to instance_faults_url }\n format.json { head :no_content }\n end\n end", "def destroy \r\n\r\n end", "def delete(options={})\n DNSimple::Client.delete \"templates/#{id}\", options\n end" ]
[ "0.69459134", "0.69426256", "0.66297525", "0.63652927", "0.63462526", "0.6313143", "0.62876856", "0.62580794", "0.6239327", "0.6239327", "0.6239327", "0.6234806", "0.62201583", "0.615115", "0.60904086", "0.6065493", "0.5996408", "0.59692955", "0.5960244", "0.5954344", "0.59477156", "0.5933981", "0.5928449", "0.59249353", "0.59150004", "0.5896784", "0.58962584", "0.58939725", "0.58886325", "0.5880045", "0.5876183", "0.58709615", "0.5867351", "0.58650917", "0.5862373", "0.5852977", "0.5849175", "0.5847667", "0.58370733", "0.5832615", "0.58196414", "0.5813575", "0.580387", "0.58027357", "0.5794387", "0.57846737", "0.5782348", "0.5779622", "0.576865", "0.57680047", "0.5766754", "0.5764765", "0.5763112", "0.5756143", "0.5756143", "0.575593", "0.5752664", "0.5752222", "0.5745434", "0.574357", "0.5742205", "0.5738524", "0.5734232", "0.5728177", "0.5722865", "0.5722865", "0.57212675", "0.5720566", "0.57191855", "0.57137054", "0.57134473", "0.57134473", "0.57134473", "0.57134473", "0.57134473", "0.57134473", "0.57134473", "0.57134473", "0.57134473", "0.57134473", "0.57081807", "0.5705768", "0.57007605", "0.56955284", "0.56955045", "0.5695293", "0.5695293", "0.5695293", "0.5695293", "0.5695293", "0.5695293", "0.5695293", "0.5693609", "0.5687934", "0.5687934", "0.5687934", "0.5687934", "0.56878155", "0.56825864", "0.56818956" ]
0.61015517
14
Read all Tier1 BYOD service instance objects under a tier1 Read all Tier1 BYOD service instance objects under a tier1
def list_tier1_byod_policy_service_instances(tier_1_id, locale_service_id, opts = {}) data, _status_code, _headers = list_tier1_byod_policy_service_instances_with_http_info(tier_1_id, locale_service_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_all_policy_service_instances_for_tier1_with_http_info(tier_1_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstanceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_all_policy_service_instances_for_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1(tier_1_id, opts = {})\n data, _status_code, _headers = read_tier1_with_http_info(tier_1_id, opts)\n data\n end", "def read_tier1_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#read_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#read_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_all_policy_service_instances_for_tier1_0_with_http_info(tier_1_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1_0\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstanceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_all_policy_service_instances_for_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def all_instances\n Puppet.debug(\"all_instances - cached instances is: #{cached_instances}\")\n Puppet.debug(\"all_instances - cached instances object id: #{cached_instances.object_id}\")\n # return cache if it has been created, this means that this function will only need\n # to be loaded once, returning all instances that exist of this resource in vsphere\n # then, we can lookup our version by name/id/whatever. This saves a TON of processing\n return cached_instances unless cached_instances.nil?\n\n # Want to return an array of instances\n # each hash should have the same properties as the properties\n # of this \"type\"\n # remember the keys should be symbols, aka :ntp_servers not 'ntp_servers'\n # This is a tracking hash which will contain info about each host and NTP server relationships\n cmd = <<-EOF\n $ntp_servers_hash = @{}\n $hosts = #{powercli_get_online_hosts}\n foreach($h in $hosts) {\n $servers = Get-VMHostNtpServer -VMHost $h\n if ($servers) {\n $ntp_servers_hash[$h.Name] = @($servers)\n } else {\n $ntp_servers_hash[$h.Name] = @()\n }\n }\n $ntp_servers_hash | ConvertTo-Json\n EOF\n\n ntpservers_stdout = powercli_connect_exec(cmd)[:stdout]\n # json parse expects a json string, powershell does not stdout with quotes\n # we might be able to remove this line because powershell exits with a viable ruby array already:\n # [\n # \"time1.dev.encore.tech\",\n # \"time2.dev.encore.tech\"\n # ]\n # what happens if this returns null??\n ntpservers_hash = JSON.parse(ntpservers_stdout)\n\n # create instance hash - this contains info about ONE host at a time\n # the values should match the data \"shape\" (ie have the same fields) as our\n # type.\n # the key, should be the title/namevar so we can do a lookup in our\n # read_instance function\n cached_instances_set({})\n ntpservers_hash.each do |esx_host, ntp_servers_array|\n cached_instances[esx_host] = {\n ensure: :present,\n esx_host: esx_host,\n ntp_servers: ntp_servers_array,\n }\n end\n Puppet.debug(\"all_instances - cached instances is at end: #{cached_instances}\")\n Puppet.debug(\"all_instances - cached instances object_id at end: #{cached_instances.object_id}\")\n cached_instances\n end", "def read_all_policy_service_instances_for_tier1(tier_1_id, locale_service_id, opts = {})\n data, _status_code, _headers = read_all_policy_service_instances_for_tier1_with_http_info(tier_1_id, locale_service_id, opts)\n data\n end", "def read_tier1_0(tier_1_id, opts = {})\n data, _status_code, _headers = read_tier1_0_with_http_info(tier_1_id, opts)\n data\n end", "def read_facts_xinetd_services(srvs, type = 'std')\n xinetd_services = {}\n\n srvs.each do |srv|\n srv_name = \"srv_#{srv}\"\n xinetd_services[srv_name] = check_xinetd_service(srv, type)\n end\n\n xinetd_services\nend", "def services\n related_objects_by_type(\"Service\")\n end", "def read_all_policy_service_instances_for_tier1_0(tier_1_id, locale_service_id, opts = {})\n data, _status_code, _headers = read_all_policy_service_instances_for_tier1_0_with_http_info(tier_1_id, locale_service_id, opts)\n data\n end", "def list_tier1(opts = {})\n data, _status_code, _headers = list_tier1_with_http_info(opts)\n data\n end", "def list_tier1_locale_services_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services_0\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServicesListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#list_tier1_locale_services_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_byod_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_tier1_locale_services_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServicesListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#list_tier1_locale_services\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_byod_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_locale_services_with_http_info(tier_1_id, locale_services_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#read_tier1_locale_services\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_tier1_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.list_tier1 ...'\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.list_tier1, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.list_tier1, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s'\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1ListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#list_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n @idti_services = IdtiService.all\n end", "def read_tier1_locale_services_0_with_http_info(tier_1_id, locale_services_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#read_tier1_locale_services_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_byod_policy_service_instance_0(tier_1_id, locale_service_id, service_instance_id, opts = {})\n data, _status_code, _headers = read_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts)\n data\n end", "def read_service_payments\r\n read_service_payment while peek == 'SVC'\r\n self\r\n end", "def index\n @item_tiers = ItemTier.all\n end", "def read_tier1_byod_policy_service_instance(tier_1_id, locale_service_id, service_instance_id, opts = {})\n data, _status_code, _headers = read_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts)\n data\n end", "def load_tier\n if id = tier_param_id\n @tier = Tier.find_by_permalink_and_region_and_active(id)\n @tier_class = @tier.class if @tier\n end\n end", "def load_tier\n if id = tier_param_id\n @tier = Tier.find_by_permalink_and_region_and_active(id)\n @tier_class = @tier.class if @tier\n end\n end", "def index\n @tb_servicios = TbServicio.all\n end", "def load_records\n native_instance(true)\n native_instance.top(limit) if limit.present?\n Array(service.native_instance.execute)\n end", "def services\n\t\tService.find(:all)\n\tend", "def list_tier1_byod_policy_service_instances_with_http_info(tier_1_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstanceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#list_tier1_byod_policy_service_instances\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_vms\n end", "def read_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_tier1_0_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.list_tier1_0 ...'\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.list_tier1_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.list_tier1_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/tier-1s'\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1ListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#list_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_tier1_byod_policy_service_instances_0_with_http_info(tier_1_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances_0\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstanceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#list_tier1_byod_policy_service_instances_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_service_types()\n types = []\n @client.services.each do |type|\n types << type.label\n end\n\n types\n end", "def load_tier\n if id = params[:tier_id]\n @tier = Tier.find_by_permalink_and_region_and_active(id)\n end\n end", "def list_tier1_byod_policy_service_instances_0(tier_1_id, locale_service_id, opts = {})\n data, _status_code, _headers = list_tier1_byod_policy_service_instances_0_with_http_info(tier_1_id, locale_service_id, opts)\n data\n end", "def all(params=nil)\n instance = ConektaObject.new\n url = Util.types[self.class_name.downcase].url\n requestor = Requestor.new\n response = requestor.request(:get, url)\n instance.load_from(response)\n instance\n end", "def read_tier1_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def instances\n Egi::Fedcloud::Vmhound::Log.info \"[#{self.class}] Retrieving active instances\"\n fetch_instances\n end", "def get_records(type)\n if @action == 'initial_run'\n @logger.info \"Getting all records from SalesForce for #{type}\"\n records = get_all_sobjects(type)\n else\n @logger.info \"Getting records for yesterday from SalesForce for #{type}\"\n records = @client.materialize(type)\n \n datetime = DateTime.now\n datetime = datetime -= 1\n records.query(\"lastmodifieddate >= #{datetime}\")\n end\n end", "def tier\n @tier_cache || self.tiers[0]\n end", "def import_my_tier_pricing_from_tci(markdown_pct = -20.0, create_other_tier_records = true)\n\t\t# first, check to see if we are a TCI record\n\t\ttci_name = Distributor.tci_distributor_name\n\n\t\tmy_warehouse = Warehouse.find_by_id(self.warehouse_id)\n\t\tif !my_warehouse\n\t\t\tmessage = \"WarehouseTier record id: #{self.id} - trying to run import_my_tier_pricing_from_tci but there is no TCI Warehouse with ID=#{self.warehouse_id}\"\n\n\t\t\t# create a super user notification\n\t\t\tNotification.create_super_user_notification(message, \"TCI Pricing Import Error\", 120000, Time.now + 3.days, 5, \"error\")\n\n\t\t\treturn false, message\n\t\tend\n\n\t\temail_log = []\n\n\t\temail_log << \"Importing TCI base pricing data for Warehouse=#{my_warehouse.name} (#{my_warehouse.city}, #{my_warehouse.state})\"\n\t\temail_log << \"\"\n\t\temail_log << \"Tier name is #{self.tier_name}:\"\n\n\t\ttci = TCIInterface.new\n\n\t\ttotal_added = 0\n\t\ttotal_updated = 0\n\t\ttotal_not_updated = 0\n\n\t\tTireSize.find(:all).each do |size|\n\t\t\t\tsearch_size = size.sizestr.scan(/(\\d*)\\/*(\\d*)R*(\\d*)/).join('')\n\n\t\t\t\ttire_manufacturer_ids = TireManufacturer.all.map{|m| m.id}\n\t\t\t\n\t\t client = Savon.client(wsdl: \"http://www.tcitips.com/Websales/cfc/TCi_SearchSizeTIPS.cfc?wsdl\",\n\t\t \t\t\t\t\t\tlogger: Rails.logger)\n\t\t response = \"\"\n\t\t (0..5).each do |i|\n\t\t \tbegin\n\t\t \t\tresponse = client.call :search_by_size, \n\t\t \t :message => { \n\t\t param_User: '4330167',\n\t\t param_Pass: 'd73nfsyd',\n\t\t param_Size: search_size#,\n\t\t #param_Brand: 7\n\t\t #param_QuoteBack: '',\n\t\t }\n\t \t\t\t\trescue HTTPClient::ConnectTimeoutError => e \n\t \t\t\t\t\t# ignore...\n\t \t\t\t\t\tresponse = \"\"\n\t \t\t\t\t\tsleep(5)\n\t \t\t\t\t\tnext\n\t \t\t\t\trescue SocketError => e \n\t \t\t\t\t\tresponse = \"\"\n\t \t\t\t\t\tsleep(5)\n\t \t\t\t\t\tnext\n\t\t\t\t\trescue Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError,\n \t\t\t\t\tNet::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError => e\n\t \t\t\t\t\tresponse = \"\"\n\t \t\t\t\t\tsleep(5)\n\t \t\t\t\t\tnext\n\t \t\t\t\trescue Exception => e\n\t \t\t\t\t\tthrow e\n\t \t\t\t\tend\n\t \t\t\tend\n\t \t\t\tif response.to_s == \"\"\n\t \t\t\t\tputs \"There seem to have been a lot of timeouts...try later\"\n\t \t\t\t\temail_log << \"There seem to have been a lot of timeouts...try later\"\n\t \t\t\t\tbreak\n\t \t\t\tend\n\t\t doc = REXML::Document.new(response.to_xml.to_s)\n\t\t #puts \"*** DOC: #{doc}\"\n\t\t doc.elements.each('//tire') do |tire|\n\t\t #puts \"***TIRE IS A #{tire.class}\"\n\t\t tciPN = tire.get_elements('tciPN').first.text\n\t\t manuPN = tire.get_elements('manuPN').first.text\n\t\t tire_vendor = tire.get_elements('vendor').first.text\n\n\t\t tipsmainprice = tire.get_elements('tipsmainprice').first.text\n\t\t tipsdiscprice = tire.get_elements('tipsdiscprice').first.text\n\t\t price = tire.get_elements('price').first.text\n\n\t\t qty = tire.get_elements('invqty').first.text.to_i\n\n\t\t manus = tci.get_th_manu_id_from_tci_vendor_no(tire_vendor)\n\n\t\t if !manuPN.nil?\n\t\t\t manus.each do |manu_id|\n\t\t\t \tif tire_manufacturer_ids.include?(manu_id)\n\t\t\t\t \ttm = TireModel.find_by_tire_manufacturer_id_and_product_code(manu_id, manuPN)\n\n\t\t\t\t \t# some of the Pirelli models start with three zeros on the TCI site, but our\n\t\t\t\t \t# database doesn't have them.\n\t\t\t\t \ttm = TireModel.find_by_tire_manufacturer_id_and_product_code(manu_id, manuPN.sub(/^000/, '')) if tm.nil?\n\n\t\t\t\t \t# Maxxis may start with \"TP\"\n\t\t\t\t\t\t\t\ttm = TireModel.find_by_tire_manufacturer_id_and_product_code(manu_id, \"TP\" + manuPN, '') if tm.nil?\t\t \t\n\n\t\t\t\t \tif !tm.nil?\n\t\t\t\t \t\tputs \"#{tm.tire_manufacturer.name}\\t#{tm.description}\\t#{price}\\t#{tipsdiscprice}\\t#{tipsmainprice}\"\n\n\t\t\t\t \t\t# do we have an existing pricing record? if so, we might\n\t\t\t\t \t\t# want to update it if the price has changed. if not, create one.\n\t\t\t\t \t\tpricing_record = WarehousePrice.find_by_warehouse_id_and_warehouse_tier_id_and_tire_model_id(self.warehouse_id, self.id, tm.id)\n\t\t\t\t \t\tif !pricing_record\n\t\t\t\t \t\t\ttotal_added += 1\n\n\t\t\t\t \t\t\tbase_price_money = price.to_money\n\t\t\t\t \t\t\tmarked_down_price_money = base_price_money + (base_price_money * (markdown_pct / 100.00))\t\t \t\t\t\n\n\t\t\t\t \t\t\tpricing_record = WarehousePrice.new \n\t\t\t\t \t\t\tpricing_record.warehouse_id = self.warehouse_id \n\t\t\t\t \t\t\tpricing_record.warehouse_tier_id = self.id \n\t\t\t\t \t\t\tpricing_record.tire_model_id = tm.id \n\t\t\t\t \t\t\tpricing_record.base_price_warehouse_price_id = nil \n\t\t\t\t \t\t\tpricing_record.base_price = marked_down_price_money\n\t\t\t\t \t\t\tpricing_record.cost_pct_from_base = 0.0\n\t\t\t\t \t\t\tpricing_record.wholesale_price = marked_down_price_money\n\n\t\t\t\t \t\t\tpricing_record.save \n\t\t\t\t \t\telse\n\t\t\t\t \t\t\tif price.to_money == pricing_record.wholesale_price.to_money\n\t\t\t\t \t\t\t\ttotal_not_updated += 1\n\t\t\t\t \t\t\telse\n\t\t\t\t \t\t\t\ttotal_updated += 1\n\t\t\t\t \t\t\t\tpricing_record.wholesale_price = price\n\t\t\t\t \t\t\t\tpricing_record.save\n\t\t\t\t \t\t\tend\n\t\t\t\t \t\tend\n\t\t\t\t \tend\n\t\t\t\t end\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t \tend\n\t\tend\n\n\n\t\temail_log << \"\"\n\t\temail_log << \"Total added: #{total_added}\"\n\t\temail_log << \"Total updated: #{total_updated}\"\n\t\temail_log << \"Total not updated: #{total_not_updated}\"\n\n\t\tActionMailer::Base.delay.mail(:from => \"[email protected]\", \n\t\t\t:to => system_process_completion_email_address(), \n\t\t\t:subject => \"Imported TCI tier pricing data\", \n\t\t\t:body => email_log.join(\"\\n\"))\n\n\t\t# we now have the base prices imported, let's create tier prices for all other tiers\n\t\tif create_other_tier_records\n\t\t\tWarehouseTier.delay.create_tier_pricing_from_base(self.warehouse_id, \"base\")\n\t\tend\n\tend", "def main_services\n main_co.services\n end", "def query_for_services(type = nil, pool = nil)\n\n raise \"Type must not be nil if pool is nil\" if type.nil? && !pool.nil?\n\n @discovery_urls.each do |discovery_url|\n resource = \"/v1/service\"\n resource += \"/#{type}\" if ! type.nil?\n resource += \"/#{pool}\" if ! pool.nil?\n\n service_uri = URI.parse(discovery_url).merge(resource)\n\n @logger.debug(\"Get Request: #{service_uri.to_s}\")\n\n begin\n response = @client.get(service_uri.to_s, nil, nil)\n\n if response.status >= 200 && response.status <= 299\n service_data = JSON.parse(response.body)\n\n return service_data\n end\n\n @logger.error(\"#{service_uri.to_s}: Response Status #{response.status}\")\n @logger.error(response.body)\n\n rescue\n @logger.error(\"#{service_uri.to_s}: #{$!}\")\n end\n\n end\n\n raise \"Failed to get all services from any of [ #{@discovery_urls.join(\",\")} ]\"\n\n end", "def index\n @sermon_reflections = SermonReflection.all\n # @event_sermon_reflections = EventSermonReflection.all\n end", "def index\n @service_particulars = ServiceParticular.all\n @service_particular = ServiceParticular.new\n end", "def read_policy_dns_forwarder_on_tier1(tier_1_id, opts = {})\n data, _status_code, _headers = read_policy_dns_forwarder_on_tier1_with_http_info(tier_1_id, opts)\n data\n end", "def getReadings(sensor_type)\n\n @readings = Array.new\n\n @readings = DataReading.selectAllClientReadings(@client_id, sensor_type)\n\n\n\n end", "def read_policy_dns_forwarder_on_tier1_0(tier_1_id, opts = {})\n data, _status_code, _headers = read_policy_dns_forwarder_on_tier1_0_with_http_info(tier_1_id, opts)\n data\n end", "def get_all_sobjects(type)\n case type\n when 'Account'\n records = @client.materialize(type).query(\"Agents__c != ''\")\n when 'ccrmbasic__Email__c'\n records = @client.materialize(type).query(\"ccrmbasic__Contact__c != ''\")\n else\n records = @client.materialize(type).all\n end\n sobjects = records.dup.to_a\n while records.next_page?\n sobjects += records.next_page\n records = records.next_page\n end\n sobjects\n end", "def read_tier1_service_interface_with_http_info(tier_1_id, locale_service_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_service_interface\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n @therm_resources = ThermResource.all\n end", "def all_instances\n Puppet.debug(\"all_instances - cached instances is: #{cached_instances}\")\n Puppet.debug(\"all_instances - cached instances object id: #{cached_instances.object_id}\")\n # return cache if it has been created, this means that this function will only need\n # to be loaded once, returning all instances that exist of this resource in vsphere\n # then, we can lookup our version by name/id/whatever. This saves a TON of processing\n return cached_instances unless cached_instances.nil?\n\n # Fetch the current status of the portgroup\n cmd = <<-EOF\n $portgroup_hash = @{}\n $hosts = #{powercli_get_online_hosts}\n foreach($h in $hosts) {\n # We silently continue on errors otherwise PowerCLI creates an error if the\n # portgroup does not exist on the host which pollutes our $portgroup_hash return object\n $pg = Get-VirtualSwitch -Host $h -Standard -Name #{resource[:vswitch_name]} | Get-VirtualPortGroup -Name #{resource[:portgroup]} -ErrorAction SilentlyContinue\n if ($pg) {\n $obj_hash = @{}\n $obj_hash.Add('portgroup', $pg.Name)\n $obj_hash.Add('vlan', $pg.VLanId)\n $obj_hash.Add('vswitch_name', $pg.VirtualSwitchName)\n $portgroup_hash[$h.Name] = @($obj_hash)\n } else {\n # create empty hashtable\n $obj_hash = @{}\n $portgroup_hash[$h.Name] = @($obj_hash)\n }\n }\n $portgroup_hash | ConvertTo-Json\n EOF\n\n portgroups_stdout = powercli_connect_exec(cmd)[:stdout]\n\n unless portgroups_stdout.empty?\n portgroups_hash = JSON.parse(portgroups_stdout)\n cached_instances_set({})\n portgroups_hash.each do |esx_host, pg_array|\n # Extracting hash from array object\n pg_hash = pg_array[0]\n cached_instances[esx_host] = {\n ensure: :present,\n esx_host: esx_host,\n vswitch_name: pg_hash['vswitch_name'],\n vlan: pg_hash['vlan'],\n portgroup: pg_hash['portgroup'],\n }\n end\n end\n Puppet.debug(\"all_instances - cached instances is at end: #{cached_instances}\")\n Puppet.debug(\"all_instances - cached instances object_id at end: #{cached_instances.object_id}\")\n cached_instances\n end", "def read_tier1_service_interface_0_with_http_info(tier_1_id, locale_service_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_service_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def vault_objects(vault_id)\n request_get(\"/vault/#{vault_id}\")\n end", "def read(query)\n connect if @persevere.nil?\n query = Persevere.enhance(query)\n \n resources = Array.new\n tblname = query.model.storage_name\n \n json_query, headers = query.to_json_query\n \n path = \"/#{tblname}/#{json_query}\"\n DataMapper.logger.debug(\"--> PATH/QUERY/HEADERS: #{path} #{headers.inspect}\")\n \n response = @persevere.retrieve(path, headers)\n \n if response.code.match(/20?/)\n results = JSON.parse(response.body)\n results.each do |rsrc_hash|\n # Typecast attributes, DM expects them properly cast\n query.fields.each do |prop|\n object_reference = false\n pname = prop.field.to_s\n\n value = rsrc_hash[pname]\n # Dereference references\n unless value.nil?\n if prop.field == 'id'\n rsrc_hash[pname] = prop.typecast(value.to_s.match(/(#{tblname})?\\/?([a-zA-Z0-9_-]+$)/)[2])\n else\n rsrc_hash[pname] = prop.typecast(value)\n end\n end\n # Shift date/time objects to the correct timezone because persevere is UTC\n case prop \n when DateTime then rsrc_hash[pname] = value.new_offset(Rational(Time.now.getlocal.gmt_offset/3600, 24))\n when Time then rsrc_hash[pname] = value.getlocal\n end\n end\n end\n resources = query.model.load(results, query)\n end\n # We could almost elimate this if regexp was working in persevere.\n\n # This won't work if the RegExp is nested more then 1 layer deep.\n if query.conditions.class == DataMapper::Query::Conditions::AndOperation\n regexp_conds = query.conditions.operands.select do |obj| \n obj.is_a?(DataMapper::Query::Conditions::RegexpComparison) || \n ( obj.is_a?(DataMapper::Query::Conditions::NotOperation) && obj.operand.is_a?(DataMapper::Query::Conditions::RegexpComparison) )\n end\n regexp_conds.each{|cond| resources = resources.select{|resource| cond.matches?(resource)} }\n \n end\n\n # query.match_records(resources)\n resources\n end", "def services\n\t\tselect {|x| x.class == Service }\n\tend", "def fetch_instance(shortname = :all, options = {})\n return instances if instances && !options[:force]\n\n fetch_stack\n unless instance_list\n self.instance_list = self.instances =\n aws_client.describe_instances(stack_id: stack[:stack_id])[:instances]\n end\n\n if shortname != :all\n fetch_layer(shortname, force: true)\n self.instances = []\n\n layers.each do |layer|\n instance = aws_client.describe_instances(\n layer_id: layer[:layer_id])\n self.instances << instance[:instances]\n end\n\n self.instances.flatten!\n end\n end", "def read_all_policy_service_instances_for_tier0_with_http_info(tier_0_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.read_all_policy_service_instances_for_tier0 ...'\n end\n # verify the required parameter 'tier_0_id' is set\n if @api_client.config.client_side_validation && tier_0_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_0_id' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.read_all_policy_service_instances_for_tier0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.read_all_policy_service_instances_for_tier0\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.read_all_policy_service_instances_for_tier0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.read_all_policy_service_instances_for_tier0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-0s/{tier-0-id}/locale-services/{locale-service-id}/service-instances'.sub('{' + 'tier-0-id' + '}', tier_0_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstanceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi#read_all_policy_service_instances_for_tier0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def listserv\n listservs.first\n end", "def all\n @service.all\n end", "def get_trending_objects klass, options = {}\n options = options.reverse_merge(default_options)\n\n data = request_object.object_type.trending.send(klass).page(options[:page]).limit(options[:limit]).get\n return [] if data[\"trending\"].blank?\n return klass.classify.constantize.where(id: data[\"trending\"].map { |d| d[\"external_id\"] }) if options[:load]\n data[\"trending\"].map { |d| { type: d[\"object_type\"], id: d[\"external_id\"] } }\n end", "def fetch_databag_tenants\n db_tenants = Array.new\n chef_api_connect.search.query(:foundation, '*:*', start: 0).rows.each do |tenant|\n db_tenants << tenant['raw_data']['id']\n end\n return db_tenants\nend", "def read_tier1_interface_with_http_info(tier_1_id, locale_services_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}/interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1Interface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_interface\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def service_payment_info_loop\n segments = []\n @clp_05_amount = 0\n eob.service_payment_eobs.each_with_index do |service, index|\n service_klass = Output835.class_for(\"Service\", facility)\n Output835.log.info \"Applying class #{service_klass}\" if index == 0\n service_obj = service_klass.new(service, facility, payer, index, @element_seperator) if service\n service_segments = service_obj.generate\n segments += service_segments[0]\n @clp_05_amount += service_segments[1]\n end\n segments\n end", "def services\n unless @services\n rows = database.view(VIEW_NAME, reduce: false, key: [1, name])['rows'] rescue []\n ids = rows.map {|row| row['value'] }\n @services = Service.all.keys(ids).to_a\n end\n @services\n end", "def list_tier1_0(opts = {})\n data, _status_code, _headers = list_tier1_0_with_http_info(opts)\n data\n end", "def list_tier1_service_interfaces_with_http_info(tier_1_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_service_interfaces ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_service_interfaces\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_service_interfaces\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_service_interfaces, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_service_interfaces, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterfaceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#list_tier1_service_interfaces\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_policy_dns_forwarder_on_tier1_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/dns-forwarder'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyDnsForwarder')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi#read_policy_dns_forwarder_on_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_interface_0_with_http_info(tier_1_id, locale_services_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}/interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1Interface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_policy_dns_forwarder_on_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/dns-forwarder'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyDnsForwarder')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi#read_policy_dns_forwarder_on_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_all_taxes\n self.class.get(\"/aldebaran-taxes/v2/taxes\", :basic_auth => @auth)\n end", "def index\n @loan_servicers = LoanServicer.all\n end", "def index\n @servicos = Servico.all\n end", "def get_services(sObjectType, oParams)\n case sObjectType\n when :services\n # oParams[sObjectType] will provide the controller object.\n # This one can be interpreted only by controller code,\n # except if controller declares how to map with this object.\n # Processes can deal only process mapped data.\n # Currently there is no services process function. No need to map.\n services = oParams[:services]\n if !oParams[:list_services].is_a?(Array)\n service_to_find = [oParams[:list_services]]\n else\n service_to_find = oParams[:list_services]\n end\n # Search for service. Ex: Can be :Networking or network. I currently do\n # not know why...\n search_services = services.rh_get(:service_catalog)\n service = nil\n service_to_find.each do |sServiceElem|\n if search_services.key?(sServiceElem)\n service = sServiceElem\n break\n end\n end\n\n controller_error 'Unable to find services %s',\n service_to_find if service.nil?\n result = services.rh_get(:service_catalog, service).keys\n result.delete('name')\n result.each_index do |iIndex|\n result[iIndex] = result[iIndex].to_s if result[iIndex].is_a?(Symbol)\n end\n return result\n else\n controller_error \"'%s' is not a valid object for 'get_services'\",\n sObjectType\n end\n end", "def acquire_service_data\n if config[:tags] && config[:service]\n tags = config[:tags].split(',').to_set\n services = []\n Diplomat::Health.service(config[:service]).each do |s|\n if s['Service']['Tags'].to_set.superset? tags\n services.push(*s['Checks'])\n end\n end\n services\n elsif config[:nodename]\n data = []\n begin\n services = Diplomat::Node.get(config[:nodename]).Services\n rescue StandardError\n services = {}\n end\n services.each_value do |service|\n Diplomat::Health.checks(service['Service']).each do |check|\n data.push(check) if check.Node == config[:nodename]\n end\n end\n data\n elsif config[:all]\n Diplomat::Health.state('any')\n else\n Diplomat::Health.checks(config[:service])\n end\n end", "def index\n @tech_servs = TechServ.page(params[:page]).per(10)\n end", "def read_tier0_with_http_info(tier_0_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi.read_tier0 ...'\n end\n # verify the required parameter 'tier_0_id' is set\n if @api_client.config.client_side_validation && tier_0_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_0_id' when calling PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi.read_tier0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-0s/{tier-0-id}'.sub('{' + 'tier-0-id' + '}', tier_0_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier0')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi#read_tier0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def all\n data = []\n if @ec2_main.settings.openstack \n conn = @ec2_main.environment.connection\n if conn != nil\n begin \n x = conn.flavors.all\n x.each do |y|\n vcpu = nil\n begin \n vcpu = y.vcpus\n rescue\n vcpu = nil \n end\n if vcpu != nil \n data.push(\"#{y.id} (#{y.name} Mem: #{y.ram}MB Disk: #{y.disk}GB VCPU: #{y.vcpus}VCPUs)\")\n else\n data.push(\"#{y.id} (#{y.name} Mem: #{y.ram}MB Disk: #{y.disk}GB)\") \n end\n end\n rescue\n puts \"ERROR: getting all flavors #{$!}\"\n end\n else \n raise \"Connection Error\" \n end \n elsif @ec2_main.settings.google \n conn = @ec2_main.environment.connection\n if conn != nil\n begin \n response = conn.list_machine_types($google_zone)\n\t\t\t if response.status == 200\n\t x = response.body['items']\n\t x.each do |r|\n\t\t\t\t data.push(\"#{r['name']} ( Mem: #{r['memoryMb']}MB Disks: #{r['maximumPersistentDisks']} Disk Size: #{r['maximumPersistentDisksSizeGb']}GB CPUs: #{r['guestCpus']})\")\n \t end\n\t else\n\t \t data = []\n end\n rescue\n puts \"ERROR: getting all flavors #{$!}\"\n end\n else \n raise \"Connection Error\" \n end \t\t\n\t else \n data.push('t1.micro (EBS only Micro 32 or 64-bit, 613 MB, up to 2 compute unit)') \n data.push('m1.small (Small 32 or 64-bit, 1.7 GB, 1 compute unit)')\n data.push('m1.medium (Medium 32 or 64-bit, 3.75 GB, 2 compute unit)')\n data.push('m1.large (Large 64-bit, 7.5 GB, 4 compute unit)')\n data.push('m1.xlarge (Extra Large 64-bit, 15 GB, 8 compute unit)')\n data.push('m3.xlarge (EBS Only Extra Large 64-bit, 15 GB, 13 compute unit)')\n data.push('m3.2xlarge (EBS Only Extra Double Large 64-bit, 30 GB, 26 compute unit)')\n data.push('m2.xlarge (High Memory Extra Large 64-bit, 17.1 GB, 6.5 compute unit)')\n data.push('m2.2xlarge (High Memory Double Extra Large 64-bit, 34.2 GB, 13 compute unit)')\n data.push('m2.4xlarge (High Memory Quadruple Large 64-bit, 68.4 GB, 26 compute unit)')\n data.push('c1.medium (Compute optimized CPU Medium 32 or 64-bit, 1.7 GB, 5 compute unit)')\n data.push('c1.xlarge (Compute optimized CPU Extra Large 64-bit, 7 GB, 20 compute unit)')\n data.push('c3.xlarge (Compute optimized Extra Large 64-bit, 3.75 GB, 7 compute unit)')\n data.push('c3.2xlarge (Compute optimized Double Extra Large 64-bit, 7 GB, 14 compute unit)')\n data.push('c3.4xlarge (Compute optimized Quadruple Large 64-bit, 15 GB, 28 compute unit)')\t\n data.push('c3.8xlarge (Compute optimized Eight Large 64-bit, 30 GB, 55 compute unit)')\n data.push('i2.xlarge\t\t (High I/O 1x800 GB SSD, 30.5 GB, 14 compute unit)')\n data.push('i2.2xlarge\t\t (High I/O 2x800 GB SSD, 61 GB, 27 compute unit)')\n data.push('i2.4xlarge\t\t (High I/O 4x800 GB SSD, 122 GB, 53 compute unit)')\n data.push('i2.8xlarge\t \t (High I/O 8x800 GB SSD, 244 GB, 104 compute unit)')\t\t \n data.push('cc1.4xlarge (Cluster Compute Quadruple Extra Large 64-bit, 23 GB, 33.5 compute unit. 10GBit network)')\n data.push('cc2.8xlarge (Cluster Compute Eight Extra Large 64-bit, 60.5 GB, 88 compute unit. 10GBit network)')\n\t\t data.push('g2.2xlarge (Cluster GPU Quadruple Extra Large 64-bit, 15 GB, 26compute unit.)') \n data.push('cg1.4xlarge (Cluster GPU Quadruple Extra Large 64-bit, 22 GB, 33.5 compute unit. 10GBit network)') \n data.push('hi1.4xlarge (High I/O Quadruple Extra Large 64-bit, 60.5 GB, 2x1024GB SSD, 35 compute unit. 10GBit network)')\n\t\t data.push('hs1.8xlarge (High I/O Quadruple Extra Large 64-bit, 117 GB, 24x2048GB SSD, 35 compute unit. 10GBit network)')\n \t\t\n end \n return data\n end", "def read_tier1_policy_service_instance_endpoint_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInstanceEndpoint')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance_endpoint_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n @invoice_services = InvoiceService.all\n end", "def list_tier1_l2_vpn_services_0_with_http_info(tier_1_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.list_tier1_l2_vpn_services_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.list_tier1_l2_vpn_services_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.list_tier1_l2_vpn_services_0\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.list_tier1_l2_vpn_services_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.list_tier1_l2_vpn_services_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/l2vpn-services'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2VPNServiceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi#list_tier1_l2_vpn_services_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_all(options = {})\n custom_params = options[:dc] ? use_named_parameter('dc', options[:dc]) : nil\n ret = send_get_request(@conn, ['/v1/catalog/nodes'], options, custom_params)\n JSON.parse(ret.body).map { |service| OpenStruct.new service }\n end", "def read_tier0(tier_0_id, opts = {})\n data, _status_code, _headers = read_tier0_with_http_info(tier_0_id, opts)\n data\n end", "def instances(type)\n @instances[type]\n end", "def meterpreter_service_list #gets\n\t\tserviceskey = \"HKLM\\\\SYSTEM\\\\CurrentControlSet\\\\Services\"\n\t\tthreadnum = 0\n\t\ta =[]\n\t\tservices = []\n\t\tbegin\n\t\t\tmeterpreter_registry_enumkeys(serviceskey).each do |s|\n \t\t\t\tif threadnum < 10\n\t\t\t\t\ta.push(::Thread.new(s) { |sk|\n\t\t\t\t\t\tbegin\n\t\t\t\t\t\t\tsrvtype = registry_getvaldata(\"#{serviceskey}\\\\#{sk}\",\"Type\").to_s\n\t\t\t\t\t\t\tservices << sk if srvtype =~ /32|16/\n\t\t\t\t\t\trescue\n\t\t\t\t\t\tend\n\t\t\t\t\t})\n\t\t\t\t\tthreadnum += 1\n\t\t\t\telse\n\t\t\t\t\tsleep(0.05) and a.delete_if {|x| not x.alive?} while not a.empty?\n\t\t\t\t\tthreadnum = 0\n\t\t\t\tend\n\t\t\tend\n\t\trescue Exception => e\n\t\t\tprint_error(\"Error enumerating services. #{e.to_s}\")\n\t\tend\n\t\treturn services\n\tend", "def index\n #@service_levels = ServiceLevel.all\n @service_levels = ServiceLevel.order(\"name asc\").paginate :page => params[:page], :per_page => 25\n end", "def get_services\n reply = @client.call(:get_services)\n\n data = reply.body.dig(:get_services_response,\n :get_services_result,\n :array_of_string)\n data = check_if_data_exists(data)\n\n data.map do |attrs|\n {\n id: Integer(attrs[:string][0], 10),\n name: attrs[:string][1]\n }\n end\n end", "def resources(oneview_type = nil, oneview_name = nil)\n oneview_type = @options[:oneview_type] if oneview_type.nil?\n oneview_name = @options[:oneview_name] if oneview_name.nil?\n raise 'Oneview resource type must be specified.' if oneview_type.nil?\n\n # Determine the endpoint that needs to be called\n endpoint = format('/rest/%s', oneview_type)\n\n # Find the resources\n response = oneview_client.rest_get(endpoint)\n resources = oneview_client.response_handler(response)\n\n return resources if oneview_name.nil?\n\n # Filter the resources by the name if it has been specified\n resources['members'].select { |r| r['name'] == oneview_name }\n end", "def object_instances\n return [] if object_definition.blank?\n \n latest_version = ::AP::VoiceExtension::Voice::Config.instance.latest_version\n klazz = \"::#{latest_version.upcase}::#{object_definition.name}\".constantize\n query_scope = object_definition.query_scope\n objects = klazz.respond_to?(query_scope.to_sym) ? klazz.send(query_scope.to_sym) : []\n if objects.blank?\n return []\n else\n return objects\n end\n end", "def services\n end", "def read_all(ts, class_name, uri = '[^\\s]+')\n ts.read_all([:name, class_name, nil, Regexp.new(uri + '/\\d+')])\n end", "def index\n @servicemen = Serviceman.all\n end", "def get_instances\n instances = [ ]\n get_clouds.each do |cloud|\n instances += cloud.instances.index(:filter => [], :view => 'tiny')\n end\n instances\n end", "def list_tier1_l2_vpn_services_with_http_info(tier_1_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.list_tier1_l2_vpn_services ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.list_tier1_l2_vpn_services\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.list_tier1_l2_vpn_services\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.list_tier1_l2_vpn_services, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.list_tier1_l2_vpn_services, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/l2vpn-services'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2VPNServiceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi#list_tier1_l2_vpn_services\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def instances\n instances = []\n JSON.parse(resource['/instances'].get)[\"instances\"].each do |i|\n instances << Instance.new(i)\n end\n return instances\n end", "def list_services(client, args, options)\n response = client.get(RESOURCE_PATH)\n\n if CloudClient::is_error?(response)\n [response.code.to_i, response.to_s]\n else\n #[0,response.body]\n if options[:json]\n [0,response.body]\n else\n array_list = JSON.parse(response.body)\n SERVICE_TABLE.show(array_list['DOCUMENT_POOL']['DOCUMENT'])\n 0\n end\n end\nend", "def init_instances\n instances = []\n next_token = nil\n all_records_retrieved = false\n\n until all_records_retrieved\n response = @@client.describe_instances({\n next_token: next_token\n })\n next_token = response.next_token\n all_records_retrieved = next_token.nil? || next_token.empty?\n instances << response.reservations.map { |r| r.instances }\n end\n\n instances.flatten\n end", "def multiple_get_objects(requests, opts = {})\n @transporter.read(:POST, '/1/indexes/*/objects', { requests: requests }, opts)\n end" ]
[ "0.583277", "0.57981855", "0.5736026", "0.56833744", "0.56744635", "0.55996484", "0.5591952", "0.5577612", "0.5427435", "0.5398957", "0.5334163", "0.52829367", "0.5264676", "0.5261105", "0.5245921", "0.52254397", "0.5207497", "0.52049446", "0.5195965", "0.51733184", "0.5169502", "0.5144154", "0.5140976", "0.51309806", "0.5123121", "0.5123121", "0.5122382", "0.50953317", "0.50900275", "0.50789356", "0.5077891", "0.5058944", "0.5023092", "0.5019441", "0.5009905", "0.5000186", "0.49781945", "0.4961324", "0.49384424", "0.49342585", "0.49208122", "0.48969242", "0.48895192", "0.48689675", "0.48671585", "0.4866761", "0.48604026", "0.4848346", "0.48400342", "0.48372847", "0.48316914", "0.48293048", "0.4826774", "0.48234835", "0.48219225", "0.48123187", "0.48074028", "0.48057252", "0.48055398", "0.47967556", "0.47857237", "0.47843072", "0.47816315", "0.47797316", "0.4777034", "0.47728357", "0.4769347", "0.47665435", "0.4765359", "0.47647673", "0.4764335", "0.47565717", "0.4752723", "0.47446516", "0.47428414", "0.4739258", "0.47390553", "0.47319633", "0.47313163", "0.47226715", "0.47190166", "0.47174904", "0.47147232", "0.47025028", "0.46933234", "0.46824485", "0.46818978", "0.46781746", "0.4675102", "0.46700162", "0.4668694", "0.46640688", "0.46570173", "0.46527717", "0.46510094", "0.46501243", "0.46486336", "0.46452314", "0.46416923", "0.46411905" ]
0.5187572
19
Read all Tier1 BYOD service instance objects under a tier1 Read all Tier1 BYOD service instance objects under a tier1
def list_tier1_byod_policy_service_instances_with_http_info(tier_1_id, locale_service_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances ...' end # verify the required parameter 'tier_1_id' is set if @api_client.config.client_side_validation && tier_1_id.nil? fail ArgumentError, "Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances" end # verify the required parameter 'locale_service_id' is set if @api_client.config.client_side_validation && locale_service_id.nil? fail ArgumentError, "Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances" end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances, must be smaller than or equal to 1000.' end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances, must be greater than or equal to 0.' end # resource path local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s) # query parameters query_params = {} query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil? query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil? query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil? query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil? query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ByodPolicyServiceInstanceListResult') if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#list_tier1_byod_policy_service_instances\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_all_policy_service_instances_for_tier1_with_http_info(tier_1_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstanceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_all_policy_service_instances_for_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1(tier_1_id, opts = {})\n data, _status_code, _headers = read_tier1_with_http_info(tier_1_id, opts)\n data\n end", "def read_tier1_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#read_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#read_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_all_policy_service_instances_for_tier1_0_with_http_info(tier_1_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1_0\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstanceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_all_policy_service_instances_for_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def all_instances\n Puppet.debug(\"all_instances - cached instances is: #{cached_instances}\")\n Puppet.debug(\"all_instances - cached instances object id: #{cached_instances.object_id}\")\n # return cache if it has been created, this means that this function will only need\n # to be loaded once, returning all instances that exist of this resource in vsphere\n # then, we can lookup our version by name/id/whatever. This saves a TON of processing\n return cached_instances unless cached_instances.nil?\n\n # Want to return an array of instances\n # each hash should have the same properties as the properties\n # of this \"type\"\n # remember the keys should be symbols, aka :ntp_servers not 'ntp_servers'\n # This is a tracking hash which will contain info about each host and NTP server relationships\n cmd = <<-EOF\n $ntp_servers_hash = @{}\n $hosts = #{powercli_get_online_hosts}\n foreach($h in $hosts) {\n $servers = Get-VMHostNtpServer -VMHost $h\n if ($servers) {\n $ntp_servers_hash[$h.Name] = @($servers)\n } else {\n $ntp_servers_hash[$h.Name] = @()\n }\n }\n $ntp_servers_hash | ConvertTo-Json\n EOF\n\n ntpservers_stdout = powercli_connect_exec(cmd)[:stdout]\n # json parse expects a json string, powershell does not stdout with quotes\n # we might be able to remove this line because powershell exits with a viable ruby array already:\n # [\n # \"time1.dev.encore.tech\",\n # \"time2.dev.encore.tech\"\n # ]\n # what happens if this returns null??\n ntpservers_hash = JSON.parse(ntpservers_stdout)\n\n # create instance hash - this contains info about ONE host at a time\n # the values should match the data \"shape\" (ie have the same fields) as our\n # type.\n # the key, should be the title/namevar so we can do a lookup in our\n # read_instance function\n cached_instances_set({})\n ntpservers_hash.each do |esx_host, ntp_servers_array|\n cached_instances[esx_host] = {\n ensure: :present,\n esx_host: esx_host,\n ntp_servers: ntp_servers_array,\n }\n end\n Puppet.debug(\"all_instances - cached instances is at end: #{cached_instances}\")\n Puppet.debug(\"all_instances - cached instances object_id at end: #{cached_instances.object_id}\")\n cached_instances\n end", "def read_all_policy_service_instances_for_tier1(tier_1_id, locale_service_id, opts = {})\n data, _status_code, _headers = read_all_policy_service_instances_for_tier1_with_http_info(tier_1_id, locale_service_id, opts)\n data\n end", "def read_tier1_0(tier_1_id, opts = {})\n data, _status_code, _headers = read_tier1_0_with_http_info(tier_1_id, opts)\n data\n end", "def read_facts_xinetd_services(srvs, type = 'std')\n xinetd_services = {}\n\n srvs.each do |srv|\n srv_name = \"srv_#{srv}\"\n xinetd_services[srv_name] = check_xinetd_service(srv, type)\n end\n\n xinetd_services\nend", "def services\n related_objects_by_type(\"Service\")\n end", "def read_all_policy_service_instances_for_tier1_0(tier_1_id, locale_service_id, opts = {})\n data, _status_code, _headers = read_all_policy_service_instances_for_tier1_0_with_http_info(tier_1_id, locale_service_id, opts)\n data\n end", "def list_tier1(opts = {})\n data, _status_code, _headers = list_tier1_with_http_info(opts)\n data\n end", "def list_tier1_locale_services_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services_0\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServicesListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#list_tier1_locale_services_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_byod_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_tier1_locale_services_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServicesListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#list_tier1_locale_services\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_byod_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_locale_services_with_http_info(tier_1_id, locale_services_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#read_tier1_locale_services\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_tier1_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.list_tier1 ...'\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.list_tier1, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.list_tier1, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s'\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1ListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#list_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n @idti_services = IdtiService.all\n end", "def list_tier1_byod_policy_service_instances(tier_1_id, locale_service_id, opts = {})\n data, _status_code, _headers = list_tier1_byod_policy_service_instances_with_http_info(tier_1_id, locale_service_id, opts)\n data\n end", "def read_tier1_locale_services_0_with_http_info(tier_1_id, locale_services_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#read_tier1_locale_services_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_byod_policy_service_instance_0(tier_1_id, locale_service_id, service_instance_id, opts = {})\n data, _status_code, _headers = read_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts)\n data\n end", "def read_service_payments\r\n read_service_payment while peek == 'SVC'\r\n self\r\n end", "def index\n @item_tiers = ItemTier.all\n end", "def read_tier1_byod_policy_service_instance(tier_1_id, locale_service_id, service_instance_id, opts = {})\n data, _status_code, _headers = read_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts)\n data\n end", "def index\n @tb_servicios = TbServicio.all\n end", "def load_tier\n if id = tier_param_id\n @tier = Tier.find_by_permalink_and_region_and_active(id)\n @tier_class = @tier.class if @tier\n end\n end", "def load_tier\n if id = tier_param_id\n @tier = Tier.find_by_permalink_and_region_and_active(id)\n @tier_class = @tier.class if @tier\n end\n end", "def load_records\n native_instance(true)\n native_instance.top(limit) if limit.present?\n Array(service.native_instance.execute)\n end", "def services\n\t\tService.find(:all)\n\tend", "def read_vms\n end", "def read_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_tier1_0_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.list_tier1_0 ...'\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.list_tier1_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.list_tier1_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/tier-1s'\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1ListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#list_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_tier1_byod_policy_service_instances_0_with_http_info(tier_1_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances_0\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstanceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#list_tier1_byod_policy_service_instances_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_service_types()\n types = []\n @client.services.each do |type|\n types << type.label\n end\n\n types\n end", "def load_tier\n if id = params[:tier_id]\n @tier = Tier.find_by_permalink_and_region_and_active(id)\n end\n end", "def list_tier1_byod_policy_service_instances_0(tier_1_id, locale_service_id, opts = {})\n data, _status_code, _headers = list_tier1_byod_policy_service_instances_0_with_http_info(tier_1_id, locale_service_id, opts)\n data\n end", "def all(params=nil)\n instance = ConektaObject.new\n url = Util.types[self.class_name.downcase].url\n requestor = Requestor.new\n response = requestor.request(:get, url)\n instance.load_from(response)\n instance\n end", "def read_tier1_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def instances\n Egi::Fedcloud::Vmhound::Log.info \"[#{self.class}] Retrieving active instances\"\n fetch_instances\n end", "def get_records(type)\n if @action == 'initial_run'\n @logger.info \"Getting all records from SalesForce for #{type}\"\n records = get_all_sobjects(type)\n else\n @logger.info \"Getting records for yesterday from SalesForce for #{type}\"\n records = @client.materialize(type)\n \n datetime = DateTime.now\n datetime = datetime -= 1\n records.query(\"lastmodifieddate >= #{datetime}\")\n end\n end", "def tier\n @tier_cache || self.tiers[0]\n end", "def import_my_tier_pricing_from_tci(markdown_pct = -20.0, create_other_tier_records = true)\n\t\t# first, check to see if we are a TCI record\n\t\ttci_name = Distributor.tci_distributor_name\n\n\t\tmy_warehouse = Warehouse.find_by_id(self.warehouse_id)\n\t\tif !my_warehouse\n\t\t\tmessage = \"WarehouseTier record id: #{self.id} - trying to run import_my_tier_pricing_from_tci but there is no TCI Warehouse with ID=#{self.warehouse_id}\"\n\n\t\t\t# create a super user notification\n\t\t\tNotification.create_super_user_notification(message, \"TCI Pricing Import Error\", 120000, Time.now + 3.days, 5, \"error\")\n\n\t\t\treturn false, message\n\t\tend\n\n\t\temail_log = []\n\n\t\temail_log << \"Importing TCI base pricing data for Warehouse=#{my_warehouse.name} (#{my_warehouse.city}, #{my_warehouse.state})\"\n\t\temail_log << \"\"\n\t\temail_log << \"Tier name is #{self.tier_name}:\"\n\n\t\ttci = TCIInterface.new\n\n\t\ttotal_added = 0\n\t\ttotal_updated = 0\n\t\ttotal_not_updated = 0\n\n\t\tTireSize.find(:all).each do |size|\n\t\t\t\tsearch_size = size.sizestr.scan(/(\\d*)\\/*(\\d*)R*(\\d*)/).join('')\n\n\t\t\t\ttire_manufacturer_ids = TireManufacturer.all.map{|m| m.id}\n\t\t\t\n\t\t client = Savon.client(wsdl: \"http://www.tcitips.com/Websales/cfc/TCi_SearchSizeTIPS.cfc?wsdl\",\n\t\t \t\t\t\t\t\tlogger: Rails.logger)\n\t\t response = \"\"\n\t\t (0..5).each do |i|\n\t\t \tbegin\n\t\t \t\tresponse = client.call :search_by_size, \n\t\t \t :message => { \n\t\t param_User: '4330167',\n\t\t param_Pass: 'd73nfsyd',\n\t\t param_Size: search_size#,\n\t\t #param_Brand: 7\n\t\t #param_QuoteBack: '',\n\t\t }\n\t \t\t\t\trescue HTTPClient::ConnectTimeoutError => e \n\t \t\t\t\t\t# ignore...\n\t \t\t\t\t\tresponse = \"\"\n\t \t\t\t\t\tsleep(5)\n\t \t\t\t\t\tnext\n\t \t\t\t\trescue SocketError => e \n\t \t\t\t\t\tresponse = \"\"\n\t \t\t\t\t\tsleep(5)\n\t \t\t\t\t\tnext\n\t\t\t\t\trescue Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError,\n \t\t\t\t\tNet::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError => e\n\t \t\t\t\t\tresponse = \"\"\n\t \t\t\t\t\tsleep(5)\n\t \t\t\t\t\tnext\n\t \t\t\t\trescue Exception => e\n\t \t\t\t\t\tthrow e\n\t \t\t\t\tend\n\t \t\t\tend\n\t \t\t\tif response.to_s == \"\"\n\t \t\t\t\tputs \"There seem to have been a lot of timeouts...try later\"\n\t \t\t\t\temail_log << \"There seem to have been a lot of timeouts...try later\"\n\t \t\t\t\tbreak\n\t \t\t\tend\n\t\t doc = REXML::Document.new(response.to_xml.to_s)\n\t\t #puts \"*** DOC: #{doc}\"\n\t\t doc.elements.each('//tire') do |tire|\n\t\t #puts \"***TIRE IS A #{tire.class}\"\n\t\t tciPN = tire.get_elements('tciPN').first.text\n\t\t manuPN = tire.get_elements('manuPN').first.text\n\t\t tire_vendor = tire.get_elements('vendor').first.text\n\n\t\t tipsmainprice = tire.get_elements('tipsmainprice').first.text\n\t\t tipsdiscprice = tire.get_elements('tipsdiscprice').first.text\n\t\t price = tire.get_elements('price').first.text\n\n\t\t qty = tire.get_elements('invqty').first.text.to_i\n\n\t\t manus = tci.get_th_manu_id_from_tci_vendor_no(tire_vendor)\n\n\t\t if !manuPN.nil?\n\t\t\t manus.each do |manu_id|\n\t\t\t \tif tire_manufacturer_ids.include?(manu_id)\n\t\t\t\t \ttm = TireModel.find_by_tire_manufacturer_id_and_product_code(manu_id, manuPN)\n\n\t\t\t\t \t# some of the Pirelli models start with three zeros on the TCI site, but our\n\t\t\t\t \t# database doesn't have them.\n\t\t\t\t \ttm = TireModel.find_by_tire_manufacturer_id_and_product_code(manu_id, manuPN.sub(/^000/, '')) if tm.nil?\n\n\t\t\t\t \t# Maxxis may start with \"TP\"\n\t\t\t\t\t\t\t\ttm = TireModel.find_by_tire_manufacturer_id_and_product_code(manu_id, \"TP\" + manuPN, '') if tm.nil?\t\t \t\n\n\t\t\t\t \tif !tm.nil?\n\t\t\t\t \t\tputs \"#{tm.tire_manufacturer.name}\\t#{tm.description}\\t#{price}\\t#{tipsdiscprice}\\t#{tipsmainprice}\"\n\n\t\t\t\t \t\t# do we have an existing pricing record? if so, we might\n\t\t\t\t \t\t# want to update it if the price has changed. if not, create one.\n\t\t\t\t \t\tpricing_record = WarehousePrice.find_by_warehouse_id_and_warehouse_tier_id_and_tire_model_id(self.warehouse_id, self.id, tm.id)\n\t\t\t\t \t\tif !pricing_record\n\t\t\t\t \t\t\ttotal_added += 1\n\n\t\t\t\t \t\t\tbase_price_money = price.to_money\n\t\t\t\t \t\t\tmarked_down_price_money = base_price_money + (base_price_money * (markdown_pct / 100.00))\t\t \t\t\t\n\n\t\t\t\t \t\t\tpricing_record = WarehousePrice.new \n\t\t\t\t \t\t\tpricing_record.warehouse_id = self.warehouse_id \n\t\t\t\t \t\t\tpricing_record.warehouse_tier_id = self.id \n\t\t\t\t \t\t\tpricing_record.tire_model_id = tm.id \n\t\t\t\t \t\t\tpricing_record.base_price_warehouse_price_id = nil \n\t\t\t\t \t\t\tpricing_record.base_price = marked_down_price_money\n\t\t\t\t \t\t\tpricing_record.cost_pct_from_base = 0.0\n\t\t\t\t \t\t\tpricing_record.wholesale_price = marked_down_price_money\n\n\t\t\t\t \t\t\tpricing_record.save \n\t\t\t\t \t\telse\n\t\t\t\t \t\t\tif price.to_money == pricing_record.wholesale_price.to_money\n\t\t\t\t \t\t\t\ttotal_not_updated += 1\n\t\t\t\t \t\t\telse\n\t\t\t\t \t\t\t\ttotal_updated += 1\n\t\t\t\t \t\t\t\tpricing_record.wholesale_price = price\n\t\t\t\t \t\t\t\tpricing_record.save\n\t\t\t\t \t\t\tend\n\t\t\t\t \t\tend\n\t\t\t\t \tend\n\t\t\t\t end\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t \tend\n\t\tend\n\n\n\t\temail_log << \"\"\n\t\temail_log << \"Total added: #{total_added}\"\n\t\temail_log << \"Total updated: #{total_updated}\"\n\t\temail_log << \"Total not updated: #{total_not_updated}\"\n\n\t\tActionMailer::Base.delay.mail(:from => \"[email protected]\", \n\t\t\t:to => system_process_completion_email_address(), \n\t\t\t:subject => \"Imported TCI tier pricing data\", \n\t\t\t:body => email_log.join(\"\\n\"))\n\n\t\t# we now have the base prices imported, let's create tier prices for all other tiers\n\t\tif create_other_tier_records\n\t\t\tWarehouseTier.delay.create_tier_pricing_from_base(self.warehouse_id, \"base\")\n\t\tend\n\tend", "def main_services\n main_co.services\n end", "def index\n @sermon_reflections = SermonReflection.all\n # @event_sermon_reflections = EventSermonReflection.all\n end", "def query_for_services(type = nil, pool = nil)\n\n raise \"Type must not be nil if pool is nil\" if type.nil? && !pool.nil?\n\n @discovery_urls.each do |discovery_url|\n resource = \"/v1/service\"\n resource += \"/#{type}\" if ! type.nil?\n resource += \"/#{pool}\" if ! pool.nil?\n\n service_uri = URI.parse(discovery_url).merge(resource)\n\n @logger.debug(\"Get Request: #{service_uri.to_s}\")\n\n begin\n response = @client.get(service_uri.to_s, nil, nil)\n\n if response.status >= 200 && response.status <= 299\n service_data = JSON.parse(response.body)\n\n return service_data\n end\n\n @logger.error(\"#{service_uri.to_s}: Response Status #{response.status}\")\n @logger.error(response.body)\n\n rescue\n @logger.error(\"#{service_uri.to_s}: #{$!}\")\n end\n\n end\n\n raise \"Failed to get all services from any of [ #{@discovery_urls.join(\",\")} ]\"\n\n end", "def index\n @service_particulars = ServiceParticular.all\n @service_particular = ServiceParticular.new\n end", "def read_policy_dns_forwarder_on_tier1(tier_1_id, opts = {})\n data, _status_code, _headers = read_policy_dns_forwarder_on_tier1_with_http_info(tier_1_id, opts)\n data\n end", "def getReadings(sensor_type)\n\n @readings = Array.new\n\n @readings = DataReading.selectAllClientReadings(@client_id, sensor_type)\n\n\n\n end", "def read_policy_dns_forwarder_on_tier1_0(tier_1_id, opts = {})\n data, _status_code, _headers = read_policy_dns_forwarder_on_tier1_0_with_http_info(tier_1_id, opts)\n data\n end", "def get_all_sobjects(type)\n case type\n when 'Account'\n records = @client.materialize(type).query(\"Agents__c != ''\")\n when 'ccrmbasic__Email__c'\n records = @client.materialize(type).query(\"ccrmbasic__Contact__c != ''\")\n else\n records = @client.materialize(type).all\n end\n sobjects = records.dup.to_a\n while records.next_page?\n sobjects += records.next_page\n records = records.next_page\n end\n sobjects\n end", "def read_tier1_service_interface_with_http_info(tier_1_id, locale_service_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_service_interface\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n @therm_resources = ThermResource.all\n end", "def all_instances\n Puppet.debug(\"all_instances - cached instances is: #{cached_instances}\")\n Puppet.debug(\"all_instances - cached instances object id: #{cached_instances.object_id}\")\n # return cache if it has been created, this means that this function will only need\n # to be loaded once, returning all instances that exist of this resource in vsphere\n # then, we can lookup our version by name/id/whatever. This saves a TON of processing\n return cached_instances unless cached_instances.nil?\n\n # Fetch the current status of the portgroup\n cmd = <<-EOF\n $portgroup_hash = @{}\n $hosts = #{powercli_get_online_hosts}\n foreach($h in $hosts) {\n # We silently continue on errors otherwise PowerCLI creates an error if the\n # portgroup does not exist on the host which pollutes our $portgroup_hash return object\n $pg = Get-VirtualSwitch -Host $h -Standard -Name #{resource[:vswitch_name]} | Get-VirtualPortGroup -Name #{resource[:portgroup]} -ErrorAction SilentlyContinue\n if ($pg) {\n $obj_hash = @{}\n $obj_hash.Add('portgroup', $pg.Name)\n $obj_hash.Add('vlan', $pg.VLanId)\n $obj_hash.Add('vswitch_name', $pg.VirtualSwitchName)\n $portgroup_hash[$h.Name] = @($obj_hash)\n } else {\n # create empty hashtable\n $obj_hash = @{}\n $portgroup_hash[$h.Name] = @($obj_hash)\n }\n }\n $portgroup_hash | ConvertTo-Json\n EOF\n\n portgroups_stdout = powercli_connect_exec(cmd)[:stdout]\n\n unless portgroups_stdout.empty?\n portgroups_hash = JSON.parse(portgroups_stdout)\n cached_instances_set({})\n portgroups_hash.each do |esx_host, pg_array|\n # Extracting hash from array object\n pg_hash = pg_array[0]\n cached_instances[esx_host] = {\n ensure: :present,\n esx_host: esx_host,\n vswitch_name: pg_hash['vswitch_name'],\n vlan: pg_hash['vlan'],\n portgroup: pg_hash['portgroup'],\n }\n end\n end\n Puppet.debug(\"all_instances - cached instances is at end: #{cached_instances}\")\n Puppet.debug(\"all_instances - cached instances object_id at end: #{cached_instances.object_id}\")\n cached_instances\n end", "def read_tier1_service_interface_0_with_http_info(tier_1_id, locale_service_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_service_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def vault_objects(vault_id)\n request_get(\"/vault/#{vault_id}\")\n end", "def read(query)\n connect if @persevere.nil?\n query = Persevere.enhance(query)\n \n resources = Array.new\n tblname = query.model.storage_name\n \n json_query, headers = query.to_json_query\n \n path = \"/#{tblname}/#{json_query}\"\n DataMapper.logger.debug(\"--> PATH/QUERY/HEADERS: #{path} #{headers.inspect}\")\n \n response = @persevere.retrieve(path, headers)\n \n if response.code.match(/20?/)\n results = JSON.parse(response.body)\n results.each do |rsrc_hash|\n # Typecast attributes, DM expects them properly cast\n query.fields.each do |prop|\n object_reference = false\n pname = prop.field.to_s\n\n value = rsrc_hash[pname]\n # Dereference references\n unless value.nil?\n if prop.field == 'id'\n rsrc_hash[pname] = prop.typecast(value.to_s.match(/(#{tblname})?\\/?([a-zA-Z0-9_-]+$)/)[2])\n else\n rsrc_hash[pname] = prop.typecast(value)\n end\n end\n # Shift date/time objects to the correct timezone because persevere is UTC\n case prop \n when DateTime then rsrc_hash[pname] = value.new_offset(Rational(Time.now.getlocal.gmt_offset/3600, 24))\n when Time then rsrc_hash[pname] = value.getlocal\n end\n end\n end\n resources = query.model.load(results, query)\n end\n # We could almost elimate this if regexp was working in persevere.\n\n # This won't work if the RegExp is nested more then 1 layer deep.\n if query.conditions.class == DataMapper::Query::Conditions::AndOperation\n regexp_conds = query.conditions.operands.select do |obj| \n obj.is_a?(DataMapper::Query::Conditions::RegexpComparison) || \n ( obj.is_a?(DataMapper::Query::Conditions::NotOperation) && obj.operand.is_a?(DataMapper::Query::Conditions::RegexpComparison) )\n end\n regexp_conds.each{|cond| resources = resources.select{|resource| cond.matches?(resource)} }\n \n end\n\n # query.match_records(resources)\n resources\n end", "def fetch_instance(shortname = :all, options = {})\n return instances if instances && !options[:force]\n\n fetch_stack\n unless instance_list\n self.instance_list = self.instances =\n aws_client.describe_instances(stack_id: stack[:stack_id])[:instances]\n end\n\n if shortname != :all\n fetch_layer(shortname, force: true)\n self.instances = []\n\n layers.each do |layer|\n instance = aws_client.describe_instances(\n layer_id: layer[:layer_id])\n self.instances << instance[:instances]\n end\n\n self.instances.flatten!\n end\n end", "def services\n\t\tselect {|x| x.class == Service }\n\tend", "def read_all_policy_service_instances_for_tier0_with_http_info(tier_0_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.read_all_policy_service_instances_for_tier0 ...'\n end\n # verify the required parameter 'tier_0_id' is set\n if @api_client.config.client_side_validation && tier_0_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_0_id' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.read_all_policy_service_instances_for_tier0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.read_all_policy_service_instances_for_tier0\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.read_all_policy_service_instances_for_tier0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.read_all_policy_service_instances_for_tier0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-0s/{tier-0-id}/locale-services/{locale-service-id}/service-instances'.sub('{' + 'tier-0-id' + '}', tier_0_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstanceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi#read_all_policy_service_instances_for_tier0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def listserv\n listservs.first\n end", "def all\n @service.all\n end", "def get_trending_objects klass, options = {}\n options = options.reverse_merge(default_options)\n\n data = request_object.object_type.trending.send(klass).page(options[:page]).limit(options[:limit]).get\n return [] if data[\"trending\"].blank?\n return klass.classify.constantize.where(id: data[\"trending\"].map { |d| d[\"external_id\"] }) if options[:load]\n data[\"trending\"].map { |d| { type: d[\"object_type\"], id: d[\"external_id\"] } }\n end", "def fetch_databag_tenants\n db_tenants = Array.new\n chef_api_connect.search.query(:foundation, '*:*', start: 0).rows.each do |tenant|\n db_tenants << tenant['raw_data']['id']\n end\n return db_tenants\nend", "def read_tier1_interface_with_http_info(tier_1_id, locale_services_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}/interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1Interface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_interface\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def service_payment_info_loop\n segments = []\n @clp_05_amount = 0\n eob.service_payment_eobs.each_with_index do |service, index|\n service_klass = Output835.class_for(\"Service\", facility)\n Output835.log.info \"Applying class #{service_klass}\" if index == 0\n service_obj = service_klass.new(service, facility, payer, index, @element_seperator) if service\n service_segments = service_obj.generate\n segments += service_segments[0]\n @clp_05_amount += service_segments[1]\n end\n segments\n end", "def services\n unless @services\n rows = database.view(VIEW_NAME, reduce: false, key: [1, name])['rows'] rescue []\n ids = rows.map {|row| row['value'] }\n @services = Service.all.keys(ids).to_a\n end\n @services\n end", "def list_tier1_0(opts = {})\n data, _status_code, _headers = list_tier1_0_with_http_info(opts)\n data\n end", "def read_policy_dns_forwarder_on_tier1_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/dns-forwarder'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyDnsForwarder')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi#read_policy_dns_forwarder_on_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_tier1_service_interfaces_with_http_info(tier_1_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_service_interfaces ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_service_interfaces\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_service_interfaces\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_service_interfaces, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_service_interfaces, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterfaceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#list_tier1_service_interfaces\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_interface_0_with_http_info(tier_1_id, locale_services_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}/interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1Interface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_policy_dns_forwarder_on_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/dns-forwarder'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyDnsForwarder')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi#read_policy_dns_forwarder_on_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_all_taxes\n self.class.get(\"/aldebaran-taxes/v2/taxes\", :basic_auth => @auth)\n end", "def index\n @loan_servicers = LoanServicer.all\n end", "def index\n @servicos = Servico.all\n end", "def get_services(sObjectType, oParams)\n case sObjectType\n when :services\n # oParams[sObjectType] will provide the controller object.\n # This one can be interpreted only by controller code,\n # except if controller declares how to map with this object.\n # Processes can deal only process mapped data.\n # Currently there is no services process function. No need to map.\n services = oParams[:services]\n if !oParams[:list_services].is_a?(Array)\n service_to_find = [oParams[:list_services]]\n else\n service_to_find = oParams[:list_services]\n end\n # Search for service. Ex: Can be :Networking or network. I currently do\n # not know why...\n search_services = services.rh_get(:service_catalog)\n service = nil\n service_to_find.each do |sServiceElem|\n if search_services.key?(sServiceElem)\n service = sServiceElem\n break\n end\n end\n\n controller_error 'Unable to find services %s',\n service_to_find if service.nil?\n result = services.rh_get(:service_catalog, service).keys\n result.delete('name')\n result.each_index do |iIndex|\n result[iIndex] = result[iIndex].to_s if result[iIndex].is_a?(Symbol)\n end\n return result\n else\n controller_error \"'%s' is not a valid object for 'get_services'\",\n sObjectType\n end\n end", "def acquire_service_data\n if config[:tags] && config[:service]\n tags = config[:tags].split(',').to_set\n services = []\n Diplomat::Health.service(config[:service]).each do |s|\n if s['Service']['Tags'].to_set.superset? tags\n services.push(*s['Checks'])\n end\n end\n services\n elsif config[:nodename]\n data = []\n begin\n services = Diplomat::Node.get(config[:nodename]).Services\n rescue StandardError\n services = {}\n end\n services.each_value do |service|\n Diplomat::Health.checks(service['Service']).each do |check|\n data.push(check) if check.Node == config[:nodename]\n end\n end\n data\n elsif config[:all]\n Diplomat::Health.state('any')\n else\n Diplomat::Health.checks(config[:service])\n end\n end", "def index\n @tech_servs = TechServ.page(params[:page]).per(10)\n end", "def read_tier0_with_http_info(tier_0_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi.read_tier0 ...'\n end\n # verify the required parameter 'tier_0_id' is set\n if @api_client.config.client_side_validation && tier_0_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_0_id' when calling PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi.read_tier0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-0s/{tier-0-id}'.sub('{' + 'tier-0-id' + '}', tier_0_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier0')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi#read_tier0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def all\n data = []\n if @ec2_main.settings.openstack \n conn = @ec2_main.environment.connection\n if conn != nil\n begin \n x = conn.flavors.all\n x.each do |y|\n vcpu = nil\n begin \n vcpu = y.vcpus\n rescue\n vcpu = nil \n end\n if vcpu != nil \n data.push(\"#{y.id} (#{y.name} Mem: #{y.ram}MB Disk: #{y.disk}GB VCPU: #{y.vcpus}VCPUs)\")\n else\n data.push(\"#{y.id} (#{y.name} Mem: #{y.ram}MB Disk: #{y.disk}GB)\") \n end\n end\n rescue\n puts \"ERROR: getting all flavors #{$!}\"\n end\n else \n raise \"Connection Error\" \n end \n elsif @ec2_main.settings.google \n conn = @ec2_main.environment.connection\n if conn != nil\n begin \n response = conn.list_machine_types($google_zone)\n\t\t\t if response.status == 200\n\t x = response.body['items']\n\t x.each do |r|\n\t\t\t\t data.push(\"#{r['name']} ( Mem: #{r['memoryMb']}MB Disks: #{r['maximumPersistentDisks']} Disk Size: #{r['maximumPersistentDisksSizeGb']}GB CPUs: #{r['guestCpus']})\")\n \t end\n\t else\n\t \t data = []\n end\n rescue\n puts \"ERROR: getting all flavors #{$!}\"\n end\n else \n raise \"Connection Error\" \n end \t\t\n\t else \n data.push('t1.micro (EBS only Micro 32 or 64-bit, 613 MB, up to 2 compute unit)') \n data.push('m1.small (Small 32 or 64-bit, 1.7 GB, 1 compute unit)')\n data.push('m1.medium (Medium 32 or 64-bit, 3.75 GB, 2 compute unit)')\n data.push('m1.large (Large 64-bit, 7.5 GB, 4 compute unit)')\n data.push('m1.xlarge (Extra Large 64-bit, 15 GB, 8 compute unit)')\n data.push('m3.xlarge (EBS Only Extra Large 64-bit, 15 GB, 13 compute unit)')\n data.push('m3.2xlarge (EBS Only Extra Double Large 64-bit, 30 GB, 26 compute unit)')\n data.push('m2.xlarge (High Memory Extra Large 64-bit, 17.1 GB, 6.5 compute unit)')\n data.push('m2.2xlarge (High Memory Double Extra Large 64-bit, 34.2 GB, 13 compute unit)')\n data.push('m2.4xlarge (High Memory Quadruple Large 64-bit, 68.4 GB, 26 compute unit)')\n data.push('c1.medium (Compute optimized CPU Medium 32 or 64-bit, 1.7 GB, 5 compute unit)')\n data.push('c1.xlarge (Compute optimized CPU Extra Large 64-bit, 7 GB, 20 compute unit)')\n data.push('c3.xlarge (Compute optimized Extra Large 64-bit, 3.75 GB, 7 compute unit)')\n data.push('c3.2xlarge (Compute optimized Double Extra Large 64-bit, 7 GB, 14 compute unit)')\n data.push('c3.4xlarge (Compute optimized Quadruple Large 64-bit, 15 GB, 28 compute unit)')\t\n data.push('c3.8xlarge (Compute optimized Eight Large 64-bit, 30 GB, 55 compute unit)')\n data.push('i2.xlarge\t\t (High I/O 1x800 GB SSD, 30.5 GB, 14 compute unit)')\n data.push('i2.2xlarge\t\t (High I/O 2x800 GB SSD, 61 GB, 27 compute unit)')\n data.push('i2.4xlarge\t\t (High I/O 4x800 GB SSD, 122 GB, 53 compute unit)')\n data.push('i2.8xlarge\t \t (High I/O 8x800 GB SSD, 244 GB, 104 compute unit)')\t\t \n data.push('cc1.4xlarge (Cluster Compute Quadruple Extra Large 64-bit, 23 GB, 33.5 compute unit. 10GBit network)')\n data.push('cc2.8xlarge (Cluster Compute Eight Extra Large 64-bit, 60.5 GB, 88 compute unit. 10GBit network)')\n\t\t data.push('g2.2xlarge (Cluster GPU Quadruple Extra Large 64-bit, 15 GB, 26compute unit.)') \n data.push('cg1.4xlarge (Cluster GPU Quadruple Extra Large 64-bit, 22 GB, 33.5 compute unit. 10GBit network)') \n data.push('hi1.4xlarge (High I/O Quadruple Extra Large 64-bit, 60.5 GB, 2x1024GB SSD, 35 compute unit. 10GBit network)')\n\t\t data.push('hs1.8xlarge (High I/O Quadruple Extra Large 64-bit, 117 GB, 24x2048GB SSD, 35 compute unit. 10GBit network)')\n \t\t\n end \n return data\n end", "def read_tier1_policy_service_instance_endpoint_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInstanceEndpoint')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance_endpoint_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n @invoice_services = InvoiceService.all\n end", "def list_tier1_l2_vpn_services_0_with_http_info(tier_1_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.list_tier1_l2_vpn_services_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.list_tier1_l2_vpn_services_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.list_tier1_l2_vpn_services_0\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.list_tier1_l2_vpn_services_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.list_tier1_l2_vpn_services_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/l2vpn-services'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2VPNServiceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi#list_tier1_l2_vpn_services_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_all(options = {})\n custom_params = options[:dc] ? use_named_parameter('dc', options[:dc]) : nil\n ret = send_get_request(@conn, ['/v1/catalog/nodes'], options, custom_params)\n JSON.parse(ret.body).map { |service| OpenStruct.new service }\n end", "def read_tier0(tier_0_id, opts = {})\n data, _status_code, _headers = read_tier0_with_http_info(tier_0_id, opts)\n data\n end", "def instances(type)\n @instances[type]\n end", "def meterpreter_service_list #gets\n\t\tserviceskey = \"HKLM\\\\SYSTEM\\\\CurrentControlSet\\\\Services\"\n\t\tthreadnum = 0\n\t\ta =[]\n\t\tservices = []\n\t\tbegin\n\t\t\tmeterpreter_registry_enumkeys(serviceskey).each do |s|\n \t\t\t\tif threadnum < 10\n\t\t\t\t\ta.push(::Thread.new(s) { |sk|\n\t\t\t\t\t\tbegin\n\t\t\t\t\t\t\tsrvtype = registry_getvaldata(\"#{serviceskey}\\\\#{sk}\",\"Type\").to_s\n\t\t\t\t\t\t\tservices << sk if srvtype =~ /32|16/\n\t\t\t\t\t\trescue\n\t\t\t\t\t\tend\n\t\t\t\t\t})\n\t\t\t\t\tthreadnum += 1\n\t\t\t\telse\n\t\t\t\t\tsleep(0.05) and a.delete_if {|x| not x.alive?} while not a.empty?\n\t\t\t\t\tthreadnum = 0\n\t\t\t\tend\n\t\t\tend\n\t\trescue Exception => e\n\t\t\tprint_error(\"Error enumerating services. #{e.to_s}\")\n\t\tend\n\t\treturn services\n\tend", "def index\n #@service_levels = ServiceLevel.all\n @service_levels = ServiceLevel.order(\"name asc\").paginate :page => params[:page], :per_page => 25\n end", "def get_services\n reply = @client.call(:get_services)\n\n data = reply.body.dig(:get_services_response,\n :get_services_result,\n :array_of_string)\n data = check_if_data_exists(data)\n\n data.map do |attrs|\n {\n id: Integer(attrs[:string][0], 10),\n name: attrs[:string][1]\n }\n end\n end", "def resources(oneview_type = nil, oneview_name = nil)\n oneview_type = @options[:oneview_type] if oneview_type.nil?\n oneview_name = @options[:oneview_name] if oneview_name.nil?\n raise 'Oneview resource type must be specified.' if oneview_type.nil?\n\n # Determine the endpoint that needs to be called\n endpoint = format('/rest/%s', oneview_type)\n\n # Find the resources\n response = oneview_client.rest_get(endpoint)\n resources = oneview_client.response_handler(response)\n\n return resources if oneview_name.nil?\n\n # Filter the resources by the name if it has been specified\n resources['members'].select { |r| r['name'] == oneview_name }\n end", "def object_instances\n return [] if object_definition.blank?\n \n latest_version = ::AP::VoiceExtension::Voice::Config.instance.latest_version\n klazz = \"::#{latest_version.upcase}::#{object_definition.name}\".constantize\n query_scope = object_definition.query_scope\n objects = klazz.respond_to?(query_scope.to_sym) ? klazz.send(query_scope.to_sym) : []\n if objects.blank?\n return []\n else\n return objects\n end\n end", "def services\n end", "def read_all(ts, class_name, uri = '[^\\s]+')\n ts.read_all([:name, class_name, nil, Regexp.new(uri + '/\\d+')])\n end", "def index\n @servicemen = Serviceman.all\n end", "def get_instances\n instances = [ ]\n get_clouds.each do |cloud|\n instances += cloud.instances.index(:filter => [], :view => 'tiny')\n end\n instances\n end", "def list_tier1_l2_vpn_services_with_http_info(tier_1_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.list_tier1_l2_vpn_services ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.list_tier1_l2_vpn_services\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.list_tier1_l2_vpn_services\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.list_tier1_l2_vpn_services, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.list_tier1_l2_vpn_services, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/l2vpn-services'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2VPNServiceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi#list_tier1_l2_vpn_services\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def instances\n instances = []\n JSON.parse(resource['/instances'].get)[\"instances\"].each do |i|\n instances << Instance.new(i)\n end\n return instances\n end", "def list_services(client, args, options)\n response = client.get(RESOURCE_PATH)\n\n if CloudClient::is_error?(response)\n [response.code.to_i, response.to_s]\n else\n #[0,response.body]\n if options[:json]\n [0,response.body]\n else\n array_list = JSON.parse(response.body)\n SERVICE_TABLE.show(array_list['DOCUMENT_POOL']['DOCUMENT'])\n 0\n end\n end\nend", "def multiple_get_objects(requests, opts = {})\n @transporter.read(:POST, '/1/indexes/*/objects', { requests: requests }, opts)\n end", "def index\n @ordem_servicos = OrdemServico.all\n end" ]
[ "0.5832485", "0.5798996", "0.57366526", "0.56839454", "0.56741834", "0.5599827", "0.55926055", "0.55782354", "0.5427398", "0.5399882", "0.5334583", "0.528343", "0.52651143", "0.52611244", "0.52463603", "0.5225432", "0.5208653", "0.52049226", "0.5196243", "0.5188682", "0.517443", "0.51701736", "0.5144056", "0.5140825", "0.51318413", "0.5123114", "0.51228726", "0.51228726", "0.5094697", "0.50904685", "0.5077914", "0.5058516", "0.5023054", "0.5019586", "0.5010251", "0.50003356", "0.4979124", "0.49625543", "0.49379945", "0.49342316", "0.4920164", "0.48960242", "0.48880702", "0.48699406", "0.48678714", "0.4867009", "0.4861288", "0.48490137", "0.48400447", "0.4837766", "0.4832727", "0.4829194", "0.48282006", "0.4823667", "0.4821773", "0.48136523", "0.48075384", "0.4805493", "0.48054802", "0.47959358", "0.47867477", "0.47848073", "0.47823304", "0.47807497", "0.4777012", "0.47721133", "0.47691306", "0.47667682", "0.47652522", "0.47651848", "0.47642797", "0.47571027", "0.47536126", "0.47457612", "0.47438583", "0.47404614", "0.4739022", "0.4733192", "0.47314528", "0.47230008", "0.4718712", "0.47177958", "0.4714879", "0.4703309", "0.46934104", "0.46825477", "0.4681967", "0.4678588", "0.46750015", "0.46714106", "0.4669776", "0.46640176", "0.46576673", "0.46539307", "0.46514496", "0.46502468", "0.4648527", "0.4644868", "0.46423283", "0.46417767" ]
0.50790185
30
Read all Tier1 BYOD service instance objects under a tier1 Read all Tier1 BYOD service instance objects under a tier1
def list_tier1_byod_policy_service_instances_0(tier_1_id, locale_service_id, opts = {}) data, _status_code, _headers = list_tier1_byod_policy_service_instances_0_with_http_info(tier_1_id, locale_service_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_all_policy_service_instances_for_tier1_with_http_info(tier_1_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstanceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_all_policy_service_instances_for_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1(tier_1_id, opts = {})\n data, _status_code, _headers = read_tier1_with_http_info(tier_1_id, opts)\n data\n end", "def read_tier1_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#read_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#read_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_all_policy_service_instances_for_tier1_0_with_http_info(tier_1_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1_0\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstanceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_all_policy_service_instances_for_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def all_instances\n Puppet.debug(\"all_instances - cached instances is: #{cached_instances}\")\n Puppet.debug(\"all_instances - cached instances object id: #{cached_instances.object_id}\")\n # return cache if it has been created, this means that this function will only need\n # to be loaded once, returning all instances that exist of this resource in vsphere\n # then, we can lookup our version by name/id/whatever. This saves a TON of processing\n return cached_instances unless cached_instances.nil?\n\n # Want to return an array of instances\n # each hash should have the same properties as the properties\n # of this \"type\"\n # remember the keys should be symbols, aka :ntp_servers not 'ntp_servers'\n # This is a tracking hash which will contain info about each host and NTP server relationships\n cmd = <<-EOF\n $ntp_servers_hash = @{}\n $hosts = #{powercli_get_online_hosts}\n foreach($h in $hosts) {\n $servers = Get-VMHostNtpServer -VMHost $h\n if ($servers) {\n $ntp_servers_hash[$h.Name] = @($servers)\n } else {\n $ntp_servers_hash[$h.Name] = @()\n }\n }\n $ntp_servers_hash | ConvertTo-Json\n EOF\n\n ntpservers_stdout = powercli_connect_exec(cmd)[:stdout]\n # json parse expects a json string, powershell does not stdout with quotes\n # we might be able to remove this line because powershell exits with a viable ruby array already:\n # [\n # \"time1.dev.encore.tech\",\n # \"time2.dev.encore.tech\"\n # ]\n # what happens if this returns null??\n ntpservers_hash = JSON.parse(ntpservers_stdout)\n\n # create instance hash - this contains info about ONE host at a time\n # the values should match the data \"shape\" (ie have the same fields) as our\n # type.\n # the key, should be the title/namevar so we can do a lookup in our\n # read_instance function\n cached_instances_set({})\n ntpservers_hash.each do |esx_host, ntp_servers_array|\n cached_instances[esx_host] = {\n ensure: :present,\n esx_host: esx_host,\n ntp_servers: ntp_servers_array,\n }\n end\n Puppet.debug(\"all_instances - cached instances is at end: #{cached_instances}\")\n Puppet.debug(\"all_instances - cached instances object_id at end: #{cached_instances.object_id}\")\n cached_instances\n end", "def read_all_policy_service_instances_for_tier1(tier_1_id, locale_service_id, opts = {})\n data, _status_code, _headers = read_all_policy_service_instances_for_tier1_with_http_info(tier_1_id, locale_service_id, opts)\n data\n end", "def read_tier1_0(tier_1_id, opts = {})\n data, _status_code, _headers = read_tier1_0_with_http_info(tier_1_id, opts)\n data\n end", "def read_facts_xinetd_services(srvs, type = 'std')\n xinetd_services = {}\n\n srvs.each do |srv|\n srv_name = \"srv_#{srv}\"\n xinetd_services[srv_name] = check_xinetd_service(srv, type)\n end\n\n xinetd_services\nend", "def services\n related_objects_by_type(\"Service\")\n end", "def read_all_policy_service_instances_for_tier1_0(tier_1_id, locale_service_id, opts = {})\n data, _status_code, _headers = read_all_policy_service_instances_for_tier1_0_with_http_info(tier_1_id, locale_service_id, opts)\n data\n end", "def list_tier1(opts = {})\n data, _status_code, _headers = list_tier1_with_http_info(opts)\n data\n end", "def list_tier1_locale_services_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services_0\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServicesListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#list_tier1_locale_services_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_byod_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_tier1_locale_services_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServicesListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#list_tier1_locale_services\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_byod_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_locale_services_with_http_info(tier_1_id, locale_services_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#read_tier1_locale_services\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_tier1_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.list_tier1 ...'\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.list_tier1, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.list_tier1, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s'\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1ListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#list_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n @idti_services = IdtiService.all\n end", "def list_tier1_byod_policy_service_instances(tier_1_id, locale_service_id, opts = {})\n data, _status_code, _headers = list_tier1_byod_policy_service_instances_with_http_info(tier_1_id, locale_service_id, opts)\n data\n end", "def read_tier1_locale_services_0_with_http_info(tier_1_id, locale_services_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#read_tier1_locale_services_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_byod_policy_service_instance_0(tier_1_id, locale_service_id, service_instance_id, opts = {})\n data, _status_code, _headers = read_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts)\n data\n end", "def read_service_payments\r\n read_service_payment while peek == 'SVC'\r\n self\r\n end", "def index\n @item_tiers = ItemTier.all\n end", "def read_tier1_byod_policy_service_instance(tier_1_id, locale_service_id, service_instance_id, opts = {})\n data, _status_code, _headers = read_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts)\n data\n end", "def load_tier\n if id = tier_param_id\n @tier = Tier.find_by_permalink_and_region_and_active(id)\n @tier_class = @tier.class if @tier\n end\n end", "def load_tier\n if id = tier_param_id\n @tier = Tier.find_by_permalink_and_region_and_active(id)\n @tier_class = @tier.class if @tier\n end\n end", "def index\n @tb_servicios = TbServicio.all\n end", "def load_records\n native_instance(true)\n native_instance.top(limit) if limit.present?\n Array(service.native_instance.execute)\n end", "def services\n\t\tService.find(:all)\n\tend", "def list_tier1_byod_policy_service_instances_with_http_info(tier_1_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstanceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#list_tier1_byod_policy_service_instances\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_vms\n end", "def read_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_tier1_0_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.list_tier1_0 ...'\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.list_tier1_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.list_tier1_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/tier-1s'\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1ListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#list_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_tier1_byod_policy_service_instances_0_with_http_info(tier_1_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances_0\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstanceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#list_tier1_byod_policy_service_instances_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_service_types()\n types = []\n @client.services.each do |type|\n types << type.label\n end\n\n types\n end", "def load_tier\n if id = params[:tier_id]\n @tier = Tier.find_by_permalink_and_region_and_active(id)\n end\n end", "def all(params=nil)\n instance = ConektaObject.new\n url = Util.types[self.class_name.downcase].url\n requestor = Requestor.new\n response = requestor.request(:get, url)\n instance.load_from(response)\n instance\n end", "def read_tier1_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def instances\n Egi::Fedcloud::Vmhound::Log.info \"[#{self.class}] Retrieving active instances\"\n fetch_instances\n end", "def get_records(type)\n if @action == 'initial_run'\n @logger.info \"Getting all records from SalesForce for #{type}\"\n records = get_all_sobjects(type)\n else\n @logger.info \"Getting records for yesterday from SalesForce for #{type}\"\n records = @client.materialize(type)\n \n datetime = DateTime.now\n datetime = datetime -= 1\n records.query(\"lastmodifieddate >= #{datetime}\")\n end\n end", "def tier\n @tier_cache || self.tiers[0]\n end", "def import_my_tier_pricing_from_tci(markdown_pct = -20.0, create_other_tier_records = true)\n\t\t# first, check to see if we are a TCI record\n\t\ttci_name = Distributor.tci_distributor_name\n\n\t\tmy_warehouse = Warehouse.find_by_id(self.warehouse_id)\n\t\tif !my_warehouse\n\t\t\tmessage = \"WarehouseTier record id: #{self.id} - trying to run import_my_tier_pricing_from_tci but there is no TCI Warehouse with ID=#{self.warehouse_id}\"\n\n\t\t\t# create a super user notification\n\t\t\tNotification.create_super_user_notification(message, \"TCI Pricing Import Error\", 120000, Time.now + 3.days, 5, \"error\")\n\n\t\t\treturn false, message\n\t\tend\n\n\t\temail_log = []\n\n\t\temail_log << \"Importing TCI base pricing data for Warehouse=#{my_warehouse.name} (#{my_warehouse.city}, #{my_warehouse.state})\"\n\t\temail_log << \"\"\n\t\temail_log << \"Tier name is #{self.tier_name}:\"\n\n\t\ttci = TCIInterface.new\n\n\t\ttotal_added = 0\n\t\ttotal_updated = 0\n\t\ttotal_not_updated = 0\n\n\t\tTireSize.find(:all).each do |size|\n\t\t\t\tsearch_size = size.sizestr.scan(/(\\d*)\\/*(\\d*)R*(\\d*)/).join('')\n\n\t\t\t\ttire_manufacturer_ids = TireManufacturer.all.map{|m| m.id}\n\t\t\t\n\t\t client = Savon.client(wsdl: \"http://www.tcitips.com/Websales/cfc/TCi_SearchSizeTIPS.cfc?wsdl\",\n\t\t \t\t\t\t\t\tlogger: Rails.logger)\n\t\t response = \"\"\n\t\t (0..5).each do |i|\n\t\t \tbegin\n\t\t \t\tresponse = client.call :search_by_size, \n\t\t \t :message => { \n\t\t param_User: '4330167',\n\t\t param_Pass: 'd73nfsyd',\n\t\t param_Size: search_size#,\n\t\t #param_Brand: 7\n\t\t #param_QuoteBack: '',\n\t\t }\n\t \t\t\t\trescue HTTPClient::ConnectTimeoutError => e \n\t \t\t\t\t\t# ignore...\n\t \t\t\t\t\tresponse = \"\"\n\t \t\t\t\t\tsleep(5)\n\t \t\t\t\t\tnext\n\t \t\t\t\trescue SocketError => e \n\t \t\t\t\t\tresponse = \"\"\n\t \t\t\t\t\tsleep(5)\n\t \t\t\t\t\tnext\n\t\t\t\t\trescue Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError,\n \t\t\t\t\tNet::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError => e\n\t \t\t\t\t\tresponse = \"\"\n\t \t\t\t\t\tsleep(5)\n\t \t\t\t\t\tnext\n\t \t\t\t\trescue Exception => e\n\t \t\t\t\t\tthrow e\n\t \t\t\t\tend\n\t \t\t\tend\n\t \t\t\tif response.to_s == \"\"\n\t \t\t\t\tputs \"There seem to have been a lot of timeouts...try later\"\n\t \t\t\t\temail_log << \"There seem to have been a lot of timeouts...try later\"\n\t \t\t\t\tbreak\n\t \t\t\tend\n\t\t doc = REXML::Document.new(response.to_xml.to_s)\n\t\t #puts \"*** DOC: #{doc}\"\n\t\t doc.elements.each('//tire') do |tire|\n\t\t #puts \"***TIRE IS A #{tire.class}\"\n\t\t tciPN = tire.get_elements('tciPN').first.text\n\t\t manuPN = tire.get_elements('manuPN').first.text\n\t\t tire_vendor = tire.get_elements('vendor').first.text\n\n\t\t tipsmainprice = tire.get_elements('tipsmainprice').first.text\n\t\t tipsdiscprice = tire.get_elements('tipsdiscprice').first.text\n\t\t price = tire.get_elements('price').first.text\n\n\t\t qty = tire.get_elements('invqty').first.text.to_i\n\n\t\t manus = tci.get_th_manu_id_from_tci_vendor_no(tire_vendor)\n\n\t\t if !manuPN.nil?\n\t\t\t manus.each do |manu_id|\n\t\t\t \tif tire_manufacturer_ids.include?(manu_id)\n\t\t\t\t \ttm = TireModel.find_by_tire_manufacturer_id_and_product_code(manu_id, manuPN)\n\n\t\t\t\t \t# some of the Pirelli models start with three zeros on the TCI site, but our\n\t\t\t\t \t# database doesn't have them.\n\t\t\t\t \ttm = TireModel.find_by_tire_manufacturer_id_and_product_code(manu_id, manuPN.sub(/^000/, '')) if tm.nil?\n\n\t\t\t\t \t# Maxxis may start with \"TP\"\n\t\t\t\t\t\t\t\ttm = TireModel.find_by_tire_manufacturer_id_and_product_code(manu_id, \"TP\" + manuPN, '') if tm.nil?\t\t \t\n\n\t\t\t\t \tif !tm.nil?\n\t\t\t\t \t\tputs \"#{tm.tire_manufacturer.name}\\t#{tm.description}\\t#{price}\\t#{tipsdiscprice}\\t#{tipsmainprice}\"\n\n\t\t\t\t \t\t# do we have an existing pricing record? if so, we might\n\t\t\t\t \t\t# want to update it if the price has changed. if not, create one.\n\t\t\t\t \t\tpricing_record = WarehousePrice.find_by_warehouse_id_and_warehouse_tier_id_and_tire_model_id(self.warehouse_id, self.id, tm.id)\n\t\t\t\t \t\tif !pricing_record\n\t\t\t\t \t\t\ttotal_added += 1\n\n\t\t\t\t \t\t\tbase_price_money = price.to_money\n\t\t\t\t \t\t\tmarked_down_price_money = base_price_money + (base_price_money * (markdown_pct / 100.00))\t\t \t\t\t\n\n\t\t\t\t \t\t\tpricing_record = WarehousePrice.new \n\t\t\t\t \t\t\tpricing_record.warehouse_id = self.warehouse_id \n\t\t\t\t \t\t\tpricing_record.warehouse_tier_id = self.id \n\t\t\t\t \t\t\tpricing_record.tire_model_id = tm.id \n\t\t\t\t \t\t\tpricing_record.base_price_warehouse_price_id = nil \n\t\t\t\t \t\t\tpricing_record.base_price = marked_down_price_money\n\t\t\t\t \t\t\tpricing_record.cost_pct_from_base = 0.0\n\t\t\t\t \t\t\tpricing_record.wholesale_price = marked_down_price_money\n\n\t\t\t\t \t\t\tpricing_record.save \n\t\t\t\t \t\telse\n\t\t\t\t \t\t\tif price.to_money == pricing_record.wholesale_price.to_money\n\t\t\t\t \t\t\t\ttotal_not_updated += 1\n\t\t\t\t \t\t\telse\n\t\t\t\t \t\t\t\ttotal_updated += 1\n\t\t\t\t \t\t\t\tpricing_record.wholesale_price = price\n\t\t\t\t \t\t\t\tpricing_record.save\n\t\t\t\t \t\t\tend\n\t\t\t\t \t\tend\n\t\t\t\t \tend\n\t\t\t\t end\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t \tend\n\t\tend\n\n\n\t\temail_log << \"\"\n\t\temail_log << \"Total added: #{total_added}\"\n\t\temail_log << \"Total updated: #{total_updated}\"\n\t\temail_log << \"Total not updated: #{total_not_updated}\"\n\n\t\tActionMailer::Base.delay.mail(:from => \"[email protected]\", \n\t\t\t:to => system_process_completion_email_address(), \n\t\t\t:subject => \"Imported TCI tier pricing data\", \n\t\t\t:body => email_log.join(\"\\n\"))\n\n\t\t# we now have the base prices imported, let's create tier prices for all other tiers\n\t\tif create_other_tier_records\n\t\t\tWarehouseTier.delay.create_tier_pricing_from_base(self.warehouse_id, \"base\")\n\t\tend\n\tend", "def main_services\n main_co.services\n end", "def query_for_services(type = nil, pool = nil)\n\n raise \"Type must not be nil if pool is nil\" if type.nil? && !pool.nil?\n\n @discovery_urls.each do |discovery_url|\n resource = \"/v1/service\"\n resource += \"/#{type}\" if ! type.nil?\n resource += \"/#{pool}\" if ! pool.nil?\n\n service_uri = URI.parse(discovery_url).merge(resource)\n\n @logger.debug(\"Get Request: #{service_uri.to_s}\")\n\n begin\n response = @client.get(service_uri.to_s, nil, nil)\n\n if response.status >= 200 && response.status <= 299\n service_data = JSON.parse(response.body)\n\n return service_data\n end\n\n @logger.error(\"#{service_uri.to_s}: Response Status #{response.status}\")\n @logger.error(response.body)\n\n rescue\n @logger.error(\"#{service_uri.to_s}: #{$!}\")\n end\n\n end\n\n raise \"Failed to get all services from any of [ #{@discovery_urls.join(\",\")} ]\"\n\n end", "def index\n @sermon_reflections = SermonReflection.all\n # @event_sermon_reflections = EventSermonReflection.all\n end", "def index\n @service_particulars = ServiceParticular.all\n @service_particular = ServiceParticular.new\n end", "def read_policy_dns_forwarder_on_tier1(tier_1_id, opts = {})\n data, _status_code, _headers = read_policy_dns_forwarder_on_tier1_with_http_info(tier_1_id, opts)\n data\n end", "def read_policy_dns_forwarder_on_tier1_0(tier_1_id, opts = {})\n data, _status_code, _headers = read_policy_dns_forwarder_on_tier1_0_with_http_info(tier_1_id, opts)\n data\n end", "def getReadings(sensor_type)\n\n @readings = Array.new\n\n @readings = DataReading.selectAllClientReadings(@client_id, sensor_type)\n\n\n\n end", "def read_tier1_service_interface_with_http_info(tier_1_id, locale_service_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_service_interface\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_all_sobjects(type)\n case type\n when 'Account'\n records = @client.materialize(type).query(\"Agents__c != ''\")\n when 'ccrmbasic__Email__c'\n records = @client.materialize(type).query(\"ccrmbasic__Contact__c != ''\")\n else\n records = @client.materialize(type).all\n end\n sobjects = records.dup.to_a\n while records.next_page?\n sobjects += records.next_page\n records = records.next_page\n end\n sobjects\n end", "def index\n @therm_resources = ThermResource.all\n end", "def read_tier1_service_interface_0_with_http_info(tier_1_id, locale_service_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_service_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def all_instances\n Puppet.debug(\"all_instances - cached instances is: #{cached_instances}\")\n Puppet.debug(\"all_instances - cached instances object id: #{cached_instances.object_id}\")\n # return cache if it has been created, this means that this function will only need\n # to be loaded once, returning all instances that exist of this resource in vsphere\n # then, we can lookup our version by name/id/whatever. This saves a TON of processing\n return cached_instances unless cached_instances.nil?\n\n # Fetch the current status of the portgroup\n cmd = <<-EOF\n $portgroup_hash = @{}\n $hosts = #{powercli_get_online_hosts}\n foreach($h in $hosts) {\n # We silently continue on errors otherwise PowerCLI creates an error if the\n # portgroup does not exist on the host which pollutes our $portgroup_hash return object\n $pg = Get-VirtualSwitch -Host $h -Standard -Name #{resource[:vswitch_name]} | Get-VirtualPortGroup -Name #{resource[:portgroup]} -ErrorAction SilentlyContinue\n if ($pg) {\n $obj_hash = @{}\n $obj_hash.Add('portgroup', $pg.Name)\n $obj_hash.Add('vlan', $pg.VLanId)\n $obj_hash.Add('vswitch_name', $pg.VirtualSwitchName)\n $portgroup_hash[$h.Name] = @($obj_hash)\n } else {\n # create empty hashtable\n $obj_hash = @{}\n $portgroup_hash[$h.Name] = @($obj_hash)\n }\n }\n $portgroup_hash | ConvertTo-Json\n EOF\n\n portgroups_stdout = powercli_connect_exec(cmd)[:stdout]\n\n unless portgroups_stdout.empty?\n portgroups_hash = JSON.parse(portgroups_stdout)\n cached_instances_set({})\n portgroups_hash.each do |esx_host, pg_array|\n # Extracting hash from array object\n pg_hash = pg_array[0]\n cached_instances[esx_host] = {\n ensure: :present,\n esx_host: esx_host,\n vswitch_name: pg_hash['vswitch_name'],\n vlan: pg_hash['vlan'],\n portgroup: pg_hash['portgroup'],\n }\n end\n end\n Puppet.debug(\"all_instances - cached instances is at end: #{cached_instances}\")\n Puppet.debug(\"all_instances - cached instances object_id at end: #{cached_instances.object_id}\")\n cached_instances\n end", "def vault_objects(vault_id)\n request_get(\"/vault/#{vault_id}\")\n end", "def read(query)\n connect if @persevere.nil?\n query = Persevere.enhance(query)\n \n resources = Array.new\n tblname = query.model.storage_name\n \n json_query, headers = query.to_json_query\n \n path = \"/#{tblname}/#{json_query}\"\n DataMapper.logger.debug(\"--> PATH/QUERY/HEADERS: #{path} #{headers.inspect}\")\n \n response = @persevere.retrieve(path, headers)\n \n if response.code.match(/20?/)\n results = JSON.parse(response.body)\n results.each do |rsrc_hash|\n # Typecast attributes, DM expects them properly cast\n query.fields.each do |prop|\n object_reference = false\n pname = prop.field.to_s\n\n value = rsrc_hash[pname]\n # Dereference references\n unless value.nil?\n if prop.field == 'id'\n rsrc_hash[pname] = prop.typecast(value.to_s.match(/(#{tblname})?\\/?([a-zA-Z0-9_-]+$)/)[2])\n else\n rsrc_hash[pname] = prop.typecast(value)\n end\n end\n # Shift date/time objects to the correct timezone because persevere is UTC\n case prop \n when DateTime then rsrc_hash[pname] = value.new_offset(Rational(Time.now.getlocal.gmt_offset/3600, 24))\n when Time then rsrc_hash[pname] = value.getlocal\n end\n end\n end\n resources = query.model.load(results, query)\n end\n # We could almost elimate this if regexp was working in persevere.\n\n # This won't work if the RegExp is nested more then 1 layer deep.\n if query.conditions.class == DataMapper::Query::Conditions::AndOperation\n regexp_conds = query.conditions.operands.select do |obj| \n obj.is_a?(DataMapper::Query::Conditions::RegexpComparison) || \n ( obj.is_a?(DataMapper::Query::Conditions::NotOperation) && obj.operand.is_a?(DataMapper::Query::Conditions::RegexpComparison) )\n end\n regexp_conds.each{|cond| resources = resources.select{|resource| cond.matches?(resource)} }\n \n end\n\n # query.match_records(resources)\n resources\n end", "def services\n\t\tselect {|x| x.class == Service }\n\tend", "def fetch_instance(shortname = :all, options = {})\n return instances if instances && !options[:force]\n\n fetch_stack\n unless instance_list\n self.instance_list = self.instances =\n aws_client.describe_instances(stack_id: stack[:stack_id])[:instances]\n end\n\n if shortname != :all\n fetch_layer(shortname, force: true)\n self.instances = []\n\n layers.each do |layer|\n instance = aws_client.describe_instances(\n layer_id: layer[:layer_id])\n self.instances << instance[:instances]\n end\n\n self.instances.flatten!\n end\n end", "def read_all_policy_service_instances_for_tier0_with_http_info(tier_0_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.read_all_policy_service_instances_for_tier0 ...'\n end\n # verify the required parameter 'tier_0_id' is set\n if @api_client.config.client_side_validation && tier_0_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_0_id' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.read_all_policy_service_instances_for_tier0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.read_all_policy_service_instances_for_tier0\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.read_all_policy_service_instances_for_tier0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.read_all_policy_service_instances_for_tier0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-0s/{tier-0-id}/locale-services/{locale-service-id}/service-instances'.sub('{' + 'tier-0-id' + '}', tier_0_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstanceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi#read_all_policy_service_instances_for_tier0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def all\n @service.all\n end", "def listserv\n listservs.first\n end", "def read_tier1_interface_with_http_info(tier_1_id, locale_services_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}/interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1Interface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_interface\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def fetch_databag_tenants\n db_tenants = Array.new\n chef_api_connect.search.query(:foundation, '*:*', start: 0).rows.each do |tenant|\n db_tenants << tenant['raw_data']['id']\n end\n return db_tenants\nend", "def get_trending_objects klass, options = {}\n options = options.reverse_merge(default_options)\n\n data = request_object.object_type.trending.send(klass).page(options[:page]).limit(options[:limit]).get\n return [] if data[\"trending\"].blank?\n return klass.classify.constantize.where(id: data[\"trending\"].map { |d| d[\"external_id\"] }) if options[:load]\n data[\"trending\"].map { |d| { type: d[\"object_type\"], id: d[\"external_id\"] } }\n end", "def service_payment_info_loop\n segments = []\n @clp_05_amount = 0\n eob.service_payment_eobs.each_with_index do |service, index|\n service_klass = Output835.class_for(\"Service\", facility)\n Output835.log.info \"Applying class #{service_klass}\" if index == 0\n service_obj = service_klass.new(service, facility, payer, index, @element_seperator) if service\n service_segments = service_obj.generate\n segments += service_segments[0]\n @clp_05_amount += service_segments[1]\n end\n segments\n end", "def list_tier1_0(opts = {})\n data, _status_code, _headers = list_tier1_0_with_http_info(opts)\n data\n end", "def read_policy_dns_forwarder_on_tier1_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/dns-forwarder'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyDnsForwarder')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi#read_policy_dns_forwarder_on_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_tier1_service_interfaces_with_http_info(tier_1_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_service_interfaces ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_service_interfaces\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_service_interfaces\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_service_interfaces, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_service_interfaces, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterfaceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#list_tier1_service_interfaces\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_interface_0_with_http_info(tier_1_id, locale_services_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}/interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1Interface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def services\n unless @services\n rows = database.view(VIEW_NAME, reduce: false, key: [1, name])['rows'] rescue []\n ids = rows.map {|row| row['value'] }\n @services = Service.all.keys(ids).to_a\n end\n @services\n end", "def read_policy_dns_forwarder_on_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/dns-forwarder'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyDnsForwarder')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi#read_policy_dns_forwarder_on_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_all_taxes\n self.class.get(\"/aldebaran-taxes/v2/taxes\", :basic_auth => @auth)\n end", "def index\n @loan_servicers = LoanServicer.all\n end", "def index\n @servicos = Servico.all\n end", "def acquire_service_data\n if config[:tags] && config[:service]\n tags = config[:tags].split(',').to_set\n services = []\n Diplomat::Health.service(config[:service]).each do |s|\n if s['Service']['Tags'].to_set.superset? tags\n services.push(*s['Checks'])\n end\n end\n services\n elsif config[:nodename]\n data = []\n begin\n services = Diplomat::Node.get(config[:nodename]).Services\n rescue StandardError\n services = {}\n end\n services.each_value do |service|\n Diplomat::Health.checks(service['Service']).each do |check|\n data.push(check) if check.Node == config[:nodename]\n end\n end\n data\n elsif config[:all]\n Diplomat::Health.state('any')\n else\n Diplomat::Health.checks(config[:service])\n end\n end", "def get_services(sObjectType, oParams)\n case sObjectType\n when :services\n # oParams[sObjectType] will provide the controller object.\n # This one can be interpreted only by controller code,\n # except if controller declares how to map with this object.\n # Processes can deal only process mapped data.\n # Currently there is no services process function. No need to map.\n services = oParams[:services]\n if !oParams[:list_services].is_a?(Array)\n service_to_find = [oParams[:list_services]]\n else\n service_to_find = oParams[:list_services]\n end\n # Search for service. Ex: Can be :Networking or network. I currently do\n # not know why...\n search_services = services.rh_get(:service_catalog)\n service = nil\n service_to_find.each do |sServiceElem|\n if search_services.key?(sServiceElem)\n service = sServiceElem\n break\n end\n end\n\n controller_error 'Unable to find services %s',\n service_to_find if service.nil?\n result = services.rh_get(:service_catalog, service).keys\n result.delete('name')\n result.each_index do |iIndex|\n result[iIndex] = result[iIndex].to_s if result[iIndex].is_a?(Symbol)\n end\n return result\n else\n controller_error \"'%s' is not a valid object for 'get_services'\",\n sObjectType\n end\n end", "def read_tier0_with_http_info(tier_0_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi.read_tier0 ...'\n end\n # verify the required parameter 'tier_0_id' is set\n if @api_client.config.client_side_validation && tier_0_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_0_id' when calling PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi.read_tier0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-0s/{tier-0-id}'.sub('{' + 'tier-0-id' + '}', tier_0_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier0')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi#read_tier0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n @tech_servs = TechServ.page(params[:page]).per(10)\n end", "def all\n data = []\n if @ec2_main.settings.openstack \n conn = @ec2_main.environment.connection\n if conn != nil\n begin \n x = conn.flavors.all\n x.each do |y|\n vcpu = nil\n begin \n vcpu = y.vcpus\n rescue\n vcpu = nil \n end\n if vcpu != nil \n data.push(\"#{y.id} (#{y.name} Mem: #{y.ram}MB Disk: #{y.disk}GB VCPU: #{y.vcpus}VCPUs)\")\n else\n data.push(\"#{y.id} (#{y.name} Mem: #{y.ram}MB Disk: #{y.disk}GB)\") \n end\n end\n rescue\n puts \"ERROR: getting all flavors #{$!}\"\n end\n else \n raise \"Connection Error\" \n end \n elsif @ec2_main.settings.google \n conn = @ec2_main.environment.connection\n if conn != nil\n begin \n response = conn.list_machine_types($google_zone)\n\t\t\t if response.status == 200\n\t x = response.body['items']\n\t x.each do |r|\n\t\t\t\t data.push(\"#{r['name']} ( Mem: #{r['memoryMb']}MB Disks: #{r['maximumPersistentDisks']} Disk Size: #{r['maximumPersistentDisksSizeGb']}GB CPUs: #{r['guestCpus']})\")\n \t end\n\t else\n\t \t data = []\n end\n rescue\n puts \"ERROR: getting all flavors #{$!}\"\n end\n else \n raise \"Connection Error\" \n end \t\t\n\t else \n data.push('t1.micro (EBS only Micro 32 or 64-bit, 613 MB, up to 2 compute unit)') \n data.push('m1.small (Small 32 or 64-bit, 1.7 GB, 1 compute unit)')\n data.push('m1.medium (Medium 32 or 64-bit, 3.75 GB, 2 compute unit)')\n data.push('m1.large (Large 64-bit, 7.5 GB, 4 compute unit)')\n data.push('m1.xlarge (Extra Large 64-bit, 15 GB, 8 compute unit)')\n data.push('m3.xlarge (EBS Only Extra Large 64-bit, 15 GB, 13 compute unit)')\n data.push('m3.2xlarge (EBS Only Extra Double Large 64-bit, 30 GB, 26 compute unit)')\n data.push('m2.xlarge (High Memory Extra Large 64-bit, 17.1 GB, 6.5 compute unit)')\n data.push('m2.2xlarge (High Memory Double Extra Large 64-bit, 34.2 GB, 13 compute unit)')\n data.push('m2.4xlarge (High Memory Quadruple Large 64-bit, 68.4 GB, 26 compute unit)')\n data.push('c1.medium (Compute optimized CPU Medium 32 or 64-bit, 1.7 GB, 5 compute unit)')\n data.push('c1.xlarge (Compute optimized CPU Extra Large 64-bit, 7 GB, 20 compute unit)')\n data.push('c3.xlarge (Compute optimized Extra Large 64-bit, 3.75 GB, 7 compute unit)')\n data.push('c3.2xlarge (Compute optimized Double Extra Large 64-bit, 7 GB, 14 compute unit)')\n data.push('c3.4xlarge (Compute optimized Quadruple Large 64-bit, 15 GB, 28 compute unit)')\t\n data.push('c3.8xlarge (Compute optimized Eight Large 64-bit, 30 GB, 55 compute unit)')\n data.push('i2.xlarge\t\t (High I/O 1x800 GB SSD, 30.5 GB, 14 compute unit)')\n data.push('i2.2xlarge\t\t (High I/O 2x800 GB SSD, 61 GB, 27 compute unit)')\n data.push('i2.4xlarge\t\t (High I/O 4x800 GB SSD, 122 GB, 53 compute unit)')\n data.push('i2.8xlarge\t \t (High I/O 8x800 GB SSD, 244 GB, 104 compute unit)')\t\t \n data.push('cc1.4xlarge (Cluster Compute Quadruple Extra Large 64-bit, 23 GB, 33.5 compute unit. 10GBit network)')\n data.push('cc2.8xlarge (Cluster Compute Eight Extra Large 64-bit, 60.5 GB, 88 compute unit. 10GBit network)')\n\t\t data.push('g2.2xlarge (Cluster GPU Quadruple Extra Large 64-bit, 15 GB, 26compute unit.)') \n data.push('cg1.4xlarge (Cluster GPU Quadruple Extra Large 64-bit, 22 GB, 33.5 compute unit. 10GBit network)') \n data.push('hi1.4xlarge (High I/O Quadruple Extra Large 64-bit, 60.5 GB, 2x1024GB SSD, 35 compute unit. 10GBit network)')\n\t\t data.push('hs1.8xlarge (High I/O Quadruple Extra Large 64-bit, 117 GB, 24x2048GB SSD, 35 compute unit. 10GBit network)')\n \t\t\n end \n return data\n end", "def read_tier1_policy_service_instance_endpoint_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInstanceEndpoint')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance_endpoint_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_tier1_l2_vpn_services_0_with_http_info(tier_1_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.list_tier1_l2_vpn_services_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.list_tier1_l2_vpn_services_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.list_tier1_l2_vpn_services_0\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.list_tier1_l2_vpn_services_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.list_tier1_l2_vpn_services_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/l2vpn-services'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2VPNServiceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi#list_tier1_l2_vpn_services_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n @invoice_services = InvoiceService.all\n end", "def get_all(options = {})\n custom_params = options[:dc] ? use_named_parameter('dc', options[:dc]) : nil\n ret = send_get_request(@conn, ['/v1/catalog/nodes'], options, custom_params)\n JSON.parse(ret.body).map { |service| OpenStruct.new service }\n end", "def read_tier0(tier_0_id, opts = {})\n data, _status_code, _headers = read_tier0_with_http_info(tier_0_id, opts)\n data\n end", "def instances(type)\n @instances[type]\n end", "def meterpreter_service_list #gets\n\t\tserviceskey = \"HKLM\\\\SYSTEM\\\\CurrentControlSet\\\\Services\"\n\t\tthreadnum = 0\n\t\ta =[]\n\t\tservices = []\n\t\tbegin\n\t\t\tmeterpreter_registry_enumkeys(serviceskey).each do |s|\n \t\t\t\tif threadnum < 10\n\t\t\t\t\ta.push(::Thread.new(s) { |sk|\n\t\t\t\t\t\tbegin\n\t\t\t\t\t\t\tsrvtype = registry_getvaldata(\"#{serviceskey}\\\\#{sk}\",\"Type\").to_s\n\t\t\t\t\t\t\tservices << sk if srvtype =~ /32|16/\n\t\t\t\t\t\trescue\n\t\t\t\t\t\tend\n\t\t\t\t\t})\n\t\t\t\t\tthreadnum += 1\n\t\t\t\telse\n\t\t\t\t\tsleep(0.05) and a.delete_if {|x| not x.alive?} while not a.empty?\n\t\t\t\t\tthreadnum = 0\n\t\t\t\tend\n\t\t\tend\n\t\trescue Exception => e\n\t\t\tprint_error(\"Error enumerating services. #{e.to_s}\")\n\t\tend\n\t\treturn services\n\tend", "def index\n #@service_levels = ServiceLevel.all\n @service_levels = ServiceLevel.order(\"name asc\").paginate :page => params[:page], :per_page => 25\n end", "def get_services\n reply = @client.call(:get_services)\n\n data = reply.body.dig(:get_services_response,\n :get_services_result,\n :array_of_string)\n data = check_if_data_exists(data)\n\n data.map do |attrs|\n {\n id: Integer(attrs[:string][0], 10),\n name: attrs[:string][1]\n }\n end\n end", "def resources(oneview_type = nil, oneview_name = nil)\n oneview_type = @options[:oneview_type] if oneview_type.nil?\n oneview_name = @options[:oneview_name] if oneview_name.nil?\n raise 'Oneview resource type must be specified.' if oneview_type.nil?\n\n # Determine the endpoint that needs to be called\n endpoint = format('/rest/%s', oneview_type)\n\n # Find the resources\n response = oneview_client.rest_get(endpoint)\n resources = oneview_client.response_handler(response)\n\n return resources if oneview_name.nil?\n\n # Filter the resources by the name if it has been specified\n resources['members'].select { |r| r['name'] == oneview_name }\n end", "def object_instances\n return [] if object_definition.blank?\n \n latest_version = ::AP::VoiceExtension::Voice::Config.instance.latest_version\n klazz = \"::#{latest_version.upcase}::#{object_definition.name}\".constantize\n query_scope = object_definition.query_scope\n objects = klazz.respond_to?(query_scope.to_sym) ? klazz.send(query_scope.to_sym) : []\n if objects.blank?\n return []\n else\n return objects\n end\n end", "def services\n end", "def read_all(ts, class_name, uri = '[^\\s]+')\n ts.read_all([:name, class_name, nil, Regexp.new(uri + '/\\d+')])\n end", "def list_tier1_l2_vpn_services_with_http_info(tier_1_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.list_tier1_l2_vpn_services ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.list_tier1_l2_vpn_services\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.list_tier1_l2_vpn_services\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.list_tier1_l2_vpn_services, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.list_tier1_l2_vpn_services, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/l2vpn-services'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2VPNServiceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi#list_tier1_l2_vpn_services\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n @servicemen = Serviceman.all\n end", "def get_instances\n instances = [ ]\n get_clouds.each do |cloud|\n instances += cloud.instances.index(:filter => [], :view => 'tiny')\n end\n instances\n end", "def instances\n instances = []\n JSON.parse(resource['/instances'].get)[\"instances\"].each do |i|\n instances << Instance.new(i)\n end\n return instances\n end", "def list_tier1_interfaces_with_http_info(tier_1_id, locale_services_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_interfaces ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_interfaces\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_interfaces\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_interfaces, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_interfaces, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}/interfaces'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1InterfaceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#list_tier1_interfaces\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_services(client, args, options)\n response = client.get(RESOURCE_PATH)\n\n if CloudClient::is_error?(response)\n [response.code.to_i, response.to_s]\n else\n #[0,response.body]\n if options[:json]\n [0,response.body]\n else\n array_list = JSON.parse(response.body)\n SERVICE_TABLE.show(array_list['DOCUMENT_POOL']['DOCUMENT'])\n 0\n end\n end\nend", "def multiple_get_objects(requests, opts = {})\n @transporter.read(:POST, '/1/indexes/*/objects', { requests: requests }, opts)\n end" ]
[ "0.583517", "0.58020633", "0.5740452", "0.56878227", "0.5676972", "0.5596582", "0.55932826", "0.5581221", "0.5425261", "0.5396678", "0.5335434", "0.5286217", "0.52677774", "0.5263029", "0.524893", "0.5227057", "0.5211213", "0.52083826", "0.5194415", "0.518818", "0.51770973", "0.5169839", "0.5143291", "0.51416886", "0.5131178", "0.5124815", "0.5124815", "0.5121519", "0.509317", "0.50877655", "0.508069", "0.5076361", "0.5060631", "0.5026494", "0.5021474", "0.5007079", "0.50027275", "0.4961526", "0.49397427", "0.49300036", "0.4920519", "0.48979518", "0.48904863", "0.48673326", "0.48666182", "0.4864323", "0.48592758", "0.48516965", "0.4840544", "0.48389876", "0.48319626", "0.483087", "0.48265705", "0.48247197", "0.48209974", "0.48120347", "0.48076057", "0.48035643", "0.48025772", "0.47978452", "0.4783819", "0.4783451", "0.47801682", "0.4779912", "0.4779692", "0.47713262", "0.47693217", "0.4768552", "0.47680613", "0.47675273", "0.4766661", "0.47604212", "0.47553962", "0.47442132", "0.47418132", "0.47377145", "0.47373027", "0.4734372", "0.4731492", "0.47225228", "0.47208208", "0.4717102", "0.47157556", "0.47017354", "0.4695278", "0.46794406", "0.46791372", "0.46785673", "0.46728736", "0.46702772", "0.4665405", "0.4662368", "0.46567", "0.46522966", "0.46515903", "0.4647693", "0.46444649", "0.46433684", "0.4642809", "0.46405748" ]
0.49789524
37
Read all Tier1 BYOD service instance objects under a tier1 Read all Tier1 BYOD service instance objects under a tier1
def list_tier1_byod_policy_service_instances_0_with_http_info(tier_1_id, locale_service_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances_0 ...' end # verify the required parameter 'tier_1_id' is set if @api_client.config.client_side_validation && tier_1_id.nil? fail ArgumentError, "Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances_0" end # verify the required parameter 'locale_service_id' is set if @api_client.config.client_side_validation && locale_service_id.nil? fail ArgumentError, "Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances_0" end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances_0, must be smaller than or equal to 1000.' end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances_0, must be greater than or equal to 0.' end # resource path local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s) # query parameters query_params = {} query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil? query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil? query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil? query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil? query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ByodPolicyServiceInstanceListResult') if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#list_tier1_byod_policy_service_instances_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_all_policy_service_instances_for_tier1_with_http_info(tier_1_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstanceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_all_policy_service_instances_for_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1(tier_1_id, opts = {})\n data, _status_code, _headers = read_tier1_with_http_info(tier_1_id, opts)\n data\n end", "def read_tier1_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#read_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#read_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_all_policy_service_instances_for_tier1_0_with_http_info(tier_1_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1_0\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstanceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_all_policy_service_instances_for_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def all_instances\n Puppet.debug(\"all_instances - cached instances is: #{cached_instances}\")\n Puppet.debug(\"all_instances - cached instances object id: #{cached_instances.object_id}\")\n # return cache if it has been created, this means that this function will only need\n # to be loaded once, returning all instances that exist of this resource in vsphere\n # then, we can lookup our version by name/id/whatever. This saves a TON of processing\n return cached_instances unless cached_instances.nil?\n\n # Want to return an array of instances\n # each hash should have the same properties as the properties\n # of this \"type\"\n # remember the keys should be symbols, aka :ntp_servers not 'ntp_servers'\n # This is a tracking hash which will contain info about each host and NTP server relationships\n cmd = <<-EOF\n $ntp_servers_hash = @{}\n $hosts = #{powercli_get_online_hosts}\n foreach($h in $hosts) {\n $servers = Get-VMHostNtpServer -VMHost $h\n if ($servers) {\n $ntp_servers_hash[$h.Name] = @($servers)\n } else {\n $ntp_servers_hash[$h.Name] = @()\n }\n }\n $ntp_servers_hash | ConvertTo-Json\n EOF\n\n ntpservers_stdout = powercli_connect_exec(cmd)[:stdout]\n # json parse expects a json string, powershell does not stdout with quotes\n # we might be able to remove this line because powershell exits with a viable ruby array already:\n # [\n # \"time1.dev.encore.tech\",\n # \"time2.dev.encore.tech\"\n # ]\n # what happens if this returns null??\n ntpservers_hash = JSON.parse(ntpservers_stdout)\n\n # create instance hash - this contains info about ONE host at a time\n # the values should match the data \"shape\" (ie have the same fields) as our\n # type.\n # the key, should be the title/namevar so we can do a lookup in our\n # read_instance function\n cached_instances_set({})\n ntpservers_hash.each do |esx_host, ntp_servers_array|\n cached_instances[esx_host] = {\n ensure: :present,\n esx_host: esx_host,\n ntp_servers: ntp_servers_array,\n }\n end\n Puppet.debug(\"all_instances - cached instances is at end: #{cached_instances}\")\n Puppet.debug(\"all_instances - cached instances object_id at end: #{cached_instances.object_id}\")\n cached_instances\n end", "def read_all_policy_service_instances_for_tier1(tier_1_id, locale_service_id, opts = {})\n data, _status_code, _headers = read_all_policy_service_instances_for_tier1_with_http_info(tier_1_id, locale_service_id, opts)\n data\n end", "def read_tier1_0(tier_1_id, opts = {})\n data, _status_code, _headers = read_tier1_0_with_http_info(tier_1_id, opts)\n data\n end", "def read_facts_xinetd_services(srvs, type = 'std')\n xinetd_services = {}\n\n srvs.each do |srv|\n srv_name = \"srv_#{srv}\"\n xinetd_services[srv_name] = check_xinetd_service(srv, type)\n end\n\n xinetd_services\nend", "def services\n related_objects_by_type(\"Service\")\n end", "def read_all_policy_service_instances_for_tier1_0(tier_1_id, locale_service_id, opts = {})\n data, _status_code, _headers = read_all_policy_service_instances_for_tier1_0_with_http_info(tier_1_id, locale_service_id, opts)\n data\n end", "def list_tier1(opts = {})\n data, _status_code, _headers = list_tier1_with_http_info(opts)\n data\n end", "def list_tier1_locale_services_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services_0\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServicesListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#list_tier1_locale_services_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_byod_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_tier1_locale_services_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServicesListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#list_tier1_locale_services\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_byod_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_locale_services_with_http_info(tier_1_id, locale_services_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#read_tier1_locale_services\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_tier1_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.list_tier1 ...'\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.list_tier1, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.list_tier1, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s'\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1ListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#list_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n @idti_services = IdtiService.all\n end", "def list_tier1_byod_policy_service_instances(tier_1_id, locale_service_id, opts = {})\n data, _status_code, _headers = list_tier1_byod_policy_service_instances_with_http_info(tier_1_id, locale_service_id, opts)\n data\n end", "def read_tier1_locale_services_0_with_http_info(tier_1_id, locale_services_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#read_tier1_locale_services_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_byod_policy_service_instance_0(tier_1_id, locale_service_id, service_instance_id, opts = {})\n data, _status_code, _headers = read_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts)\n data\n end", "def read_service_payments\r\n read_service_payment while peek == 'SVC'\r\n self\r\n end", "def index\n @item_tiers = ItemTier.all\n end", "def read_tier1_byod_policy_service_instance(tier_1_id, locale_service_id, service_instance_id, opts = {})\n data, _status_code, _headers = read_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts)\n data\n end", "def load_tier\n if id = tier_param_id\n @tier = Tier.find_by_permalink_and_region_and_active(id)\n @tier_class = @tier.class if @tier\n end\n end", "def load_tier\n if id = tier_param_id\n @tier = Tier.find_by_permalink_and_region_and_active(id)\n @tier_class = @tier.class if @tier\n end\n end", "def index\n @tb_servicios = TbServicio.all\n end", "def load_records\n native_instance(true)\n native_instance.top(limit) if limit.present?\n Array(service.native_instance.execute)\n end", "def services\n\t\tService.find(:all)\n\tend", "def list_tier1_byod_policy_service_instances_with_http_info(tier_1_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstanceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#list_tier1_byod_policy_service_instances\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_vms\n end", "def read_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_tier1_0_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.list_tier1_0 ...'\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.list_tier1_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.list_tier1_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/tier-1s'\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1ListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#list_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_service_types()\n types = []\n @client.services.each do |type|\n types << type.label\n end\n\n types\n end", "def load_tier\n if id = params[:tier_id]\n @tier = Tier.find_by_permalink_and_region_and_active(id)\n end\n end", "def list_tier1_byod_policy_service_instances_0(tier_1_id, locale_service_id, opts = {})\n data, _status_code, _headers = list_tier1_byod_policy_service_instances_0_with_http_info(tier_1_id, locale_service_id, opts)\n data\n end", "def all(params=nil)\n instance = ConektaObject.new\n url = Util.types[self.class_name.downcase].url\n requestor = Requestor.new\n response = requestor.request(:get, url)\n instance.load_from(response)\n instance\n end", "def read_tier1_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def instances\n Egi::Fedcloud::Vmhound::Log.info \"[#{self.class}] Retrieving active instances\"\n fetch_instances\n end", "def get_records(type)\n if @action == 'initial_run'\n @logger.info \"Getting all records from SalesForce for #{type}\"\n records = get_all_sobjects(type)\n else\n @logger.info \"Getting records for yesterday from SalesForce for #{type}\"\n records = @client.materialize(type)\n \n datetime = DateTime.now\n datetime = datetime -= 1\n records.query(\"lastmodifieddate >= #{datetime}\")\n end\n end", "def tier\n @tier_cache || self.tiers[0]\n end", "def import_my_tier_pricing_from_tci(markdown_pct = -20.0, create_other_tier_records = true)\n\t\t# first, check to see if we are a TCI record\n\t\ttci_name = Distributor.tci_distributor_name\n\n\t\tmy_warehouse = Warehouse.find_by_id(self.warehouse_id)\n\t\tif !my_warehouse\n\t\t\tmessage = \"WarehouseTier record id: #{self.id} - trying to run import_my_tier_pricing_from_tci but there is no TCI Warehouse with ID=#{self.warehouse_id}\"\n\n\t\t\t# create a super user notification\n\t\t\tNotification.create_super_user_notification(message, \"TCI Pricing Import Error\", 120000, Time.now + 3.days, 5, \"error\")\n\n\t\t\treturn false, message\n\t\tend\n\n\t\temail_log = []\n\n\t\temail_log << \"Importing TCI base pricing data for Warehouse=#{my_warehouse.name} (#{my_warehouse.city}, #{my_warehouse.state})\"\n\t\temail_log << \"\"\n\t\temail_log << \"Tier name is #{self.tier_name}:\"\n\n\t\ttci = TCIInterface.new\n\n\t\ttotal_added = 0\n\t\ttotal_updated = 0\n\t\ttotal_not_updated = 0\n\n\t\tTireSize.find(:all).each do |size|\n\t\t\t\tsearch_size = size.sizestr.scan(/(\\d*)\\/*(\\d*)R*(\\d*)/).join('')\n\n\t\t\t\ttire_manufacturer_ids = TireManufacturer.all.map{|m| m.id}\n\t\t\t\n\t\t client = Savon.client(wsdl: \"http://www.tcitips.com/Websales/cfc/TCi_SearchSizeTIPS.cfc?wsdl\",\n\t\t \t\t\t\t\t\tlogger: Rails.logger)\n\t\t response = \"\"\n\t\t (0..5).each do |i|\n\t\t \tbegin\n\t\t \t\tresponse = client.call :search_by_size, \n\t\t \t :message => { \n\t\t param_User: '4330167',\n\t\t param_Pass: 'd73nfsyd',\n\t\t param_Size: search_size#,\n\t\t #param_Brand: 7\n\t\t #param_QuoteBack: '',\n\t\t }\n\t \t\t\t\trescue HTTPClient::ConnectTimeoutError => e \n\t \t\t\t\t\t# ignore...\n\t \t\t\t\t\tresponse = \"\"\n\t \t\t\t\t\tsleep(5)\n\t \t\t\t\t\tnext\n\t \t\t\t\trescue SocketError => e \n\t \t\t\t\t\tresponse = \"\"\n\t \t\t\t\t\tsleep(5)\n\t \t\t\t\t\tnext\n\t\t\t\t\trescue Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError,\n \t\t\t\t\tNet::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError => e\n\t \t\t\t\t\tresponse = \"\"\n\t \t\t\t\t\tsleep(5)\n\t \t\t\t\t\tnext\n\t \t\t\t\trescue Exception => e\n\t \t\t\t\t\tthrow e\n\t \t\t\t\tend\n\t \t\t\tend\n\t \t\t\tif response.to_s == \"\"\n\t \t\t\t\tputs \"There seem to have been a lot of timeouts...try later\"\n\t \t\t\t\temail_log << \"There seem to have been a lot of timeouts...try later\"\n\t \t\t\t\tbreak\n\t \t\t\tend\n\t\t doc = REXML::Document.new(response.to_xml.to_s)\n\t\t #puts \"*** DOC: #{doc}\"\n\t\t doc.elements.each('//tire') do |tire|\n\t\t #puts \"***TIRE IS A #{tire.class}\"\n\t\t tciPN = tire.get_elements('tciPN').first.text\n\t\t manuPN = tire.get_elements('manuPN').first.text\n\t\t tire_vendor = tire.get_elements('vendor').first.text\n\n\t\t tipsmainprice = tire.get_elements('tipsmainprice').first.text\n\t\t tipsdiscprice = tire.get_elements('tipsdiscprice').first.text\n\t\t price = tire.get_elements('price').first.text\n\n\t\t qty = tire.get_elements('invqty').first.text.to_i\n\n\t\t manus = tci.get_th_manu_id_from_tci_vendor_no(tire_vendor)\n\n\t\t if !manuPN.nil?\n\t\t\t manus.each do |manu_id|\n\t\t\t \tif tire_manufacturer_ids.include?(manu_id)\n\t\t\t\t \ttm = TireModel.find_by_tire_manufacturer_id_and_product_code(manu_id, manuPN)\n\n\t\t\t\t \t# some of the Pirelli models start with three zeros on the TCI site, but our\n\t\t\t\t \t# database doesn't have them.\n\t\t\t\t \ttm = TireModel.find_by_tire_manufacturer_id_and_product_code(manu_id, manuPN.sub(/^000/, '')) if tm.nil?\n\n\t\t\t\t \t# Maxxis may start with \"TP\"\n\t\t\t\t\t\t\t\ttm = TireModel.find_by_tire_manufacturer_id_and_product_code(manu_id, \"TP\" + manuPN, '') if tm.nil?\t\t \t\n\n\t\t\t\t \tif !tm.nil?\n\t\t\t\t \t\tputs \"#{tm.tire_manufacturer.name}\\t#{tm.description}\\t#{price}\\t#{tipsdiscprice}\\t#{tipsmainprice}\"\n\n\t\t\t\t \t\t# do we have an existing pricing record? if so, we might\n\t\t\t\t \t\t# want to update it if the price has changed. if not, create one.\n\t\t\t\t \t\tpricing_record = WarehousePrice.find_by_warehouse_id_and_warehouse_tier_id_and_tire_model_id(self.warehouse_id, self.id, tm.id)\n\t\t\t\t \t\tif !pricing_record\n\t\t\t\t \t\t\ttotal_added += 1\n\n\t\t\t\t \t\t\tbase_price_money = price.to_money\n\t\t\t\t \t\t\tmarked_down_price_money = base_price_money + (base_price_money * (markdown_pct / 100.00))\t\t \t\t\t\n\n\t\t\t\t \t\t\tpricing_record = WarehousePrice.new \n\t\t\t\t \t\t\tpricing_record.warehouse_id = self.warehouse_id \n\t\t\t\t \t\t\tpricing_record.warehouse_tier_id = self.id \n\t\t\t\t \t\t\tpricing_record.tire_model_id = tm.id \n\t\t\t\t \t\t\tpricing_record.base_price_warehouse_price_id = nil \n\t\t\t\t \t\t\tpricing_record.base_price = marked_down_price_money\n\t\t\t\t \t\t\tpricing_record.cost_pct_from_base = 0.0\n\t\t\t\t \t\t\tpricing_record.wholesale_price = marked_down_price_money\n\n\t\t\t\t \t\t\tpricing_record.save \n\t\t\t\t \t\telse\n\t\t\t\t \t\t\tif price.to_money == pricing_record.wholesale_price.to_money\n\t\t\t\t \t\t\t\ttotal_not_updated += 1\n\t\t\t\t \t\t\telse\n\t\t\t\t \t\t\t\ttotal_updated += 1\n\t\t\t\t \t\t\t\tpricing_record.wholesale_price = price\n\t\t\t\t \t\t\t\tpricing_record.save\n\t\t\t\t \t\t\tend\n\t\t\t\t \t\tend\n\t\t\t\t \tend\n\t\t\t\t end\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t \tend\n\t\tend\n\n\n\t\temail_log << \"\"\n\t\temail_log << \"Total added: #{total_added}\"\n\t\temail_log << \"Total updated: #{total_updated}\"\n\t\temail_log << \"Total not updated: #{total_not_updated}\"\n\n\t\tActionMailer::Base.delay.mail(:from => \"[email protected]\", \n\t\t\t:to => system_process_completion_email_address(), \n\t\t\t:subject => \"Imported TCI tier pricing data\", \n\t\t\t:body => email_log.join(\"\\n\"))\n\n\t\t# we now have the base prices imported, let's create tier prices for all other tiers\n\t\tif create_other_tier_records\n\t\t\tWarehouseTier.delay.create_tier_pricing_from_base(self.warehouse_id, \"base\")\n\t\tend\n\tend", "def main_services\n main_co.services\n end", "def query_for_services(type = nil, pool = nil)\n\n raise \"Type must not be nil if pool is nil\" if type.nil? && !pool.nil?\n\n @discovery_urls.each do |discovery_url|\n resource = \"/v1/service\"\n resource += \"/#{type}\" if ! type.nil?\n resource += \"/#{pool}\" if ! pool.nil?\n\n service_uri = URI.parse(discovery_url).merge(resource)\n\n @logger.debug(\"Get Request: #{service_uri.to_s}\")\n\n begin\n response = @client.get(service_uri.to_s, nil, nil)\n\n if response.status >= 200 && response.status <= 299\n service_data = JSON.parse(response.body)\n\n return service_data\n end\n\n @logger.error(\"#{service_uri.to_s}: Response Status #{response.status}\")\n @logger.error(response.body)\n\n rescue\n @logger.error(\"#{service_uri.to_s}: #{$!}\")\n end\n\n end\n\n raise \"Failed to get all services from any of [ #{@discovery_urls.join(\",\")} ]\"\n\n end", "def index\n @sermon_reflections = SermonReflection.all\n # @event_sermon_reflections = EventSermonReflection.all\n end", "def index\n @service_particulars = ServiceParticular.all\n @service_particular = ServiceParticular.new\n end", "def read_policy_dns_forwarder_on_tier1(tier_1_id, opts = {})\n data, _status_code, _headers = read_policy_dns_forwarder_on_tier1_with_http_info(tier_1_id, opts)\n data\n end", "def getReadings(sensor_type)\n\n @readings = Array.new\n\n @readings = DataReading.selectAllClientReadings(@client_id, sensor_type)\n\n\n\n end", "def read_policy_dns_forwarder_on_tier1_0(tier_1_id, opts = {})\n data, _status_code, _headers = read_policy_dns_forwarder_on_tier1_0_with_http_info(tier_1_id, opts)\n data\n end", "def get_all_sobjects(type)\n case type\n when 'Account'\n records = @client.materialize(type).query(\"Agents__c != ''\")\n when 'ccrmbasic__Email__c'\n records = @client.materialize(type).query(\"ccrmbasic__Contact__c != ''\")\n else\n records = @client.materialize(type).all\n end\n sobjects = records.dup.to_a\n while records.next_page?\n sobjects += records.next_page\n records = records.next_page\n end\n sobjects\n end", "def read_tier1_service_interface_with_http_info(tier_1_id, locale_service_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_service_interface\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n @therm_resources = ThermResource.all\n end", "def all_instances\n Puppet.debug(\"all_instances - cached instances is: #{cached_instances}\")\n Puppet.debug(\"all_instances - cached instances object id: #{cached_instances.object_id}\")\n # return cache if it has been created, this means that this function will only need\n # to be loaded once, returning all instances that exist of this resource in vsphere\n # then, we can lookup our version by name/id/whatever. This saves a TON of processing\n return cached_instances unless cached_instances.nil?\n\n # Fetch the current status of the portgroup\n cmd = <<-EOF\n $portgroup_hash = @{}\n $hosts = #{powercli_get_online_hosts}\n foreach($h in $hosts) {\n # We silently continue on errors otherwise PowerCLI creates an error if the\n # portgroup does not exist on the host which pollutes our $portgroup_hash return object\n $pg = Get-VirtualSwitch -Host $h -Standard -Name #{resource[:vswitch_name]} | Get-VirtualPortGroup -Name #{resource[:portgroup]} -ErrorAction SilentlyContinue\n if ($pg) {\n $obj_hash = @{}\n $obj_hash.Add('portgroup', $pg.Name)\n $obj_hash.Add('vlan', $pg.VLanId)\n $obj_hash.Add('vswitch_name', $pg.VirtualSwitchName)\n $portgroup_hash[$h.Name] = @($obj_hash)\n } else {\n # create empty hashtable\n $obj_hash = @{}\n $portgroup_hash[$h.Name] = @($obj_hash)\n }\n }\n $portgroup_hash | ConvertTo-Json\n EOF\n\n portgroups_stdout = powercli_connect_exec(cmd)[:stdout]\n\n unless portgroups_stdout.empty?\n portgroups_hash = JSON.parse(portgroups_stdout)\n cached_instances_set({})\n portgroups_hash.each do |esx_host, pg_array|\n # Extracting hash from array object\n pg_hash = pg_array[0]\n cached_instances[esx_host] = {\n ensure: :present,\n esx_host: esx_host,\n vswitch_name: pg_hash['vswitch_name'],\n vlan: pg_hash['vlan'],\n portgroup: pg_hash['portgroup'],\n }\n end\n end\n Puppet.debug(\"all_instances - cached instances is at end: #{cached_instances}\")\n Puppet.debug(\"all_instances - cached instances object_id at end: #{cached_instances.object_id}\")\n cached_instances\n end", "def read_tier1_service_interface_0_with_http_info(tier_1_id, locale_service_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_service_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def vault_objects(vault_id)\n request_get(\"/vault/#{vault_id}\")\n end", "def read(query)\n connect if @persevere.nil?\n query = Persevere.enhance(query)\n \n resources = Array.new\n tblname = query.model.storage_name\n \n json_query, headers = query.to_json_query\n \n path = \"/#{tblname}/#{json_query}\"\n DataMapper.logger.debug(\"--> PATH/QUERY/HEADERS: #{path} #{headers.inspect}\")\n \n response = @persevere.retrieve(path, headers)\n \n if response.code.match(/20?/)\n results = JSON.parse(response.body)\n results.each do |rsrc_hash|\n # Typecast attributes, DM expects them properly cast\n query.fields.each do |prop|\n object_reference = false\n pname = prop.field.to_s\n\n value = rsrc_hash[pname]\n # Dereference references\n unless value.nil?\n if prop.field == 'id'\n rsrc_hash[pname] = prop.typecast(value.to_s.match(/(#{tblname})?\\/?([a-zA-Z0-9_-]+$)/)[2])\n else\n rsrc_hash[pname] = prop.typecast(value)\n end\n end\n # Shift date/time objects to the correct timezone because persevere is UTC\n case prop \n when DateTime then rsrc_hash[pname] = value.new_offset(Rational(Time.now.getlocal.gmt_offset/3600, 24))\n when Time then rsrc_hash[pname] = value.getlocal\n end\n end\n end\n resources = query.model.load(results, query)\n end\n # We could almost elimate this if regexp was working in persevere.\n\n # This won't work if the RegExp is nested more then 1 layer deep.\n if query.conditions.class == DataMapper::Query::Conditions::AndOperation\n regexp_conds = query.conditions.operands.select do |obj| \n obj.is_a?(DataMapper::Query::Conditions::RegexpComparison) || \n ( obj.is_a?(DataMapper::Query::Conditions::NotOperation) && obj.operand.is_a?(DataMapper::Query::Conditions::RegexpComparison) )\n end\n regexp_conds.each{|cond| resources = resources.select{|resource| cond.matches?(resource)} }\n \n end\n\n # query.match_records(resources)\n resources\n end", "def services\n\t\tselect {|x| x.class == Service }\n\tend", "def fetch_instance(shortname = :all, options = {})\n return instances if instances && !options[:force]\n\n fetch_stack\n unless instance_list\n self.instance_list = self.instances =\n aws_client.describe_instances(stack_id: stack[:stack_id])[:instances]\n end\n\n if shortname != :all\n fetch_layer(shortname, force: true)\n self.instances = []\n\n layers.each do |layer|\n instance = aws_client.describe_instances(\n layer_id: layer[:layer_id])\n self.instances << instance[:instances]\n end\n\n self.instances.flatten!\n end\n end", "def read_all_policy_service_instances_for_tier0_with_http_info(tier_0_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.read_all_policy_service_instances_for_tier0 ...'\n end\n # verify the required parameter 'tier_0_id' is set\n if @api_client.config.client_side_validation && tier_0_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_0_id' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.read_all_policy_service_instances_for_tier0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.read_all_policy_service_instances_for_tier0\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.read_all_policy_service_instances_for_tier0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.read_all_policy_service_instances_for_tier0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-0s/{tier-0-id}/locale-services/{locale-service-id}/service-instances'.sub('{' + 'tier-0-id' + '}', tier_0_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstanceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi#read_all_policy_service_instances_for_tier0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def listserv\n listservs.first\n end", "def all\n @service.all\n end", "def get_trending_objects klass, options = {}\n options = options.reverse_merge(default_options)\n\n data = request_object.object_type.trending.send(klass).page(options[:page]).limit(options[:limit]).get\n return [] if data[\"trending\"].blank?\n return klass.classify.constantize.where(id: data[\"trending\"].map { |d| d[\"external_id\"] }) if options[:load]\n data[\"trending\"].map { |d| { type: d[\"object_type\"], id: d[\"external_id\"] } }\n end", "def fetch_databag_tenants\n db_tenants = Array.new\n chef_api_connect.search.query(:foundation, '*:*', start: 0).rows.each do |tenant|\n db_tenants << tenant['raw_data']['id']\n end\n return db_tenants\nend", "def read_tier1_interface_with_http_info(tier_1_id, locale_services_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}/interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1Interface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_interface\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def service_payment_info_loop\n segments = []\n @clp_05_amount = 0\n eob.service_payment_eobs.each_with_index do |service, index|\n service_klass = Output835.class_for(\"Service\", facility)\n Output835.log.info \"Applying class #{service_klass}\" if index == 0\n service_obj = service_klass.new(service, facility, payer, index, @element_seperator) if service\n service_segments = service_obj.generate\n segments += service_segments[0]\n @clp_05_amount += service_segments[1]\n end\n segments\n end", "def services\n unless @services\n rows = database.view(VIEW_NAME, reduce: false, key: [1, name])['rows'] rescue []\n ids = rows.map {|row| row['value'] }\n @services = Service.all.keys(ids).to_a\n end\n @services\n end", "def list_tier1_0(opts = {})\n data, _status_code, _headers = list_tier1_0_with_http_info(opts)\n data\n end", "def list_tier1_service_interfaces_with_http_info(tier_1_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_service_interfaces ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_service_interfaces\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_service_interfaces\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_service_interfaces, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_service_interfaces, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterfaceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#list_tier1_service_interfaces\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_policy_dns_forwarder_on_tier1_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/dns-forwarder'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyDnsForwarder')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi#read_policy_dns_forwarder_on_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_interface_0_with_http_info(tier_1_id, locale_services_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}/interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1Interface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_policy_dns_forwarder_on_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/dns-forwarder'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyDnsForwarder')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi#read_policy_dns_forwarder_on_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_all_taxes\n self.class.get(\"/aldebaran-taxes/v2/taxes\", :basic_auth => @auth)\n end", "def index\n @loan_servicers = LoanServicer.all\n end", "def index\n @servicos = Servico.all\n end", "def get_services(sObjectType, oParams)\n case sObjectType\n when :services\n # oParams[sObjectType] will provide the controller object.\n # This one can be interpreted only by controller code,\n # except if controller declares how to map with this object.\n # Processes can deal only process mapped data.\n # Currently there is no services process function. No need to map.\n services = oParams[:services]\n if !oParams[:list_services].is_a?(Array)\n service_to_find = [oParams[:list_services]]\n else\n service_to_find = oParams[:list_services]\n end\n # Search for service. Ex: Can be :Networking or network. I currently do\n # not know why...\n search_services = services.rh_get(:service_catalog)\n service = nil\n service_to_find.each do |sServiceElem|\n if search_services.key?(sServiceElem)\n service = sServiceElem\n break\n end\n end\n\n controller_error 'Unable to find services %s',\n service_to_find if service.nil?\n result = services.rh_get(:service_catalog, service).keys\n result.delete('name')\n result.each_index do |iIndex|\n result[iIndex] = result[iIndex].to_s if result[iIndex].is_a?(Symbol)\n end\n return result\n else\n controller_error \"'%s' is not a valid object for 'get_services'\",\n sObjectType\n end\n end", "def acquire_service_data\n if config[:tags] && config[:service]\n tags = config[:tags].split(',').to_set\n services = []\n Diplomat::Health.service(config[:service]).each do |s|\n if s['Service']['Tags'].to_set.superset? tags\n services.push(*s['Checks'])\n end\n end\n services\n elsif config[:nodename]\n data = []\n begin\n services = Diplomat::Node.get(config[:nodename]).Services\n rescue StandardError\n services = {}\n end\n services.each_value do |service|\n Diplomat::Health.checks(service['Service']).each do |check|\n data.push(check) if check.Node == config[:nodename]\n end\n end\n data\n elsif config[:all]\n Diplomat::Health.state('any')\n else\n Diplomat::Health.checks(config[:service])\n end\n end", "def read_tier0_with_http_info(tier_0_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi.read_tier0 ...'\n end\n # verify the required parameter 'tier_0_id' is set\n if @api_client.config.client_side_validation && tier_0_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_0_id' when calling PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi.read_tier0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-0s/{tier-0-id}'.sub('{' + 'tier-0-id' + '}', tier_0_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier0')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi#read_tier0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n @tech_servs = TechServ.page(params[:page]).per(10)\n end", "def all\n data = []\n if @ec2_main.settings.openstack \n conn = @ec2_main.environment.connection\n if conn != nil\n begin \n x = conn.flavors.all\n x.each do |y|\n vcpu = nil\n begin \n vcpu = y.vcpus\n rescue\n vcpu = nil \n end\n if vcpu != nil \n data.push(\"#{y.id} (#{y.name} Mem: #{y.ram}MB Disk: #{y.disk}GB VCPU: #{y.vcpus}VCPUs)\")\n else\n data.push(\"#{y.id} (#{y.name} Mem: #{y.ram}MB Disk: #{y.disk}GB)\") \n end\n end\n rescue\n puts \"ERROR: getting all flavors #{$!}\"\n end\n else \n raise \"Connection Error\" \n end \n elsif @ec2_main.settings.google \n conn = @ec2_main.environment.connection\n if conn != nil\n begin \n response = conn.list_machine_types($google_zone)\n\t\t\t if response.status == 200\n\t x = response.body['items']\n\t x.each do |r|\n\t\t\t\t data.push(\"#{r['name']} ( Mem: #{r['memoryMb']}MB Disks: #{r['maximumPersistentDisks']} Disk Size: #{r['maximumPersistentDisksSizeGb']}GB CPUs: #{r['guestCpus']})\")\n \t end\n\t else\n\t \t data = []\n end\n rescue\n puts \"ERROR: getting all flavors #{$!}\"\n end\n else \n raise \"Connection Error\" \n end \t\t\n\t else \n data.push('t1.micro (EBS only Micro 32 or 64-bit, 613 MB, up to 2 compute unit)') \n data.push('m1.small (Small 32 or 64-bit, 1.7 GB, 1 compute unit)')\n data.push('m1.medium (Medium 32 or 64-bit, 3.75 GB, 2 compute unit)')\n data.push('m1.large (Large 64-bit, 7.5 GB, 4 compute unit)')\n data.push('m1.xlarge (Extra Large 64-bit, 15 GB, 8 compute unit)')\n data.push('m3.xlarge (EBS Only Extra Large 64-bit, 15 GB, 13 compute unit)')\n data.push('m3.2xlarge (EBS Only Extra Double Large 64-bit, 30 GB, 26 compute unit)')\n data.push('m2.xlarge (High Memory Extra Large 64-bit, 17.1 GB, 6.5 compute unit)')\n data.push('m2.2xlarge (High Memory Double Extra Large 64-bit, 34.2 GB, 13 compute unit)')\n data.push('m2.4xlarge (High Memory Quadruple Large 64-bit, 68.4 GB, 26 compute unit)')\n data.push('c1.medium (Compute optimized CPU Medium 32 or 64-bit, 1.7 GB, 5 compute unit)')\n data.push('c1.xlarge (Compute optimized CPU Extra Large 64-bit, 7 GB, 20 compute unit)')\n data.push('c3.xlarge (Compute optimized Extra Large 64-bit, 3.75 GB, 7 compute unit)')\n data.push('c3.2xlarge (Compute optimized Double Extra Large 64-bit, 7 GB, 14 compute unit)')\n data.push('c3.4xlarge (Compute optimized Quadruple Large 64-bit, 15 GB, 28 compute unit)')\t\n data.push('c3.8xlarge (Compute optimized Eight Large 64-bit, 30 GB, 55 compute unit)')\n data.push('i2.xlarge\t\t (High I/O 1x800 GB SSD, 30.5 GB, 14 compute unit)')\n data.push('i2.2xlarge\t\t (High I/O 2x800 GB SSD, 61 GB, 27 compute unit)')\n data.push('i2.4xlarge\t\t (High I/O 4x800 GB SSD, 122 GB, 53 compute unit)')\n data.push('i2.8xlarge\t \t (High I/O 8x800 GB SSD, 244 GB, 104 compute unit)')\t\t \n data.push('cc1.4xlarge (Cluster Compute Quadruple Extra Large 64-bit, 23 GB, 33.5 compute unit. 10GBit network)')\n data.push('cc2.8xlarge (Cluster Compute Eight Extra Large 64-bit, 60.5 GB, 88 compute unit. 10GBit network)')\n\t\t data.push('g2.2xlarge (Cluster GPU Quadruple Extra Large 64-bit, 15 GB, 26compute unit.)') \n data.push('cg1.4xlarge (Cluster GPU Quadruple Extra Large 64-bit, 22 GB, 33.5 compute unit. 10GBit network)') \n data.push('hi1.4xlarge (High I/O Quadruple Extra Large 64-bit, 60.5 GB, 2x1024GB SSD, 35 compute unit. 10GBit network)')\n\t\t data.push('hs1.8xlarge (High I/O Quadruple Extra Large 64-bit, 117 GB, 24x2048GB SSD, 35 compute unit. 10GBit network)')\n \t\t\n end \n return data\n end", "def read_tier1_policy_service_instance_endpoint_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInstanceEndpoint')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance_endpoint_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n @invoice_services = InvoiceService.all\n end", "def list_tier1_l2_vpn_services_0_with_http_info(tier_1_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.list_tier1_l2_vpn_services_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.list_tier1_l2_vpn_services_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.list_tier1_l2_vpn_services_0\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.list_tier1_l2_vpn_services_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.list_tier1_l2_vpn_services_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/l2vpn-services'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2VPNServiceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi#list_tier1_l2_vpn_services_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_all(options = {})\n custom_params = options[:dc] ? use_named_parameter('dc', options[:dc]) : nil\n ret = send_get_request(@conn, ['/v1/catalog/nodes'], options, custom_params)\n JSON.parse(ret.body).map { |service| OpenStruct.new service }\n end", "def read_tier0(tier_0_id, opts = {})\n data, _status_code, _headers = read_tier0_with_http_info(tier_0_id, opts)\n data\n end", "def instances(type)\n @instances[type]\n end", "def meterpreter_service_list #gets\n\t\tserviceskey = \"HKLM\\\\SYSTEM\\\\CurrentControlSet\\\\Services\"\n\t\tthreadnum = 0\n\t\ta =[]\n\t\tservices = []\n\t\tbegin\n\t\t\tmeterpreter_registry_enumkeys(serviceskey).each do |s|\n \t\t\t\tif threadnum < 10\n\t\t\t\t\ta.push(::Thread.new(s) { |sk|\n\t\t\t\t\t\tbegin\n\t\t\t\t\t\t\tsrvtype = registry_getvaldata(\"#{serviceskey}\\\\#{sk}\",\"Type\").to_s\n\t\t\t\t\t\t\tservices << sk if srvtype =~ /32|16/\n\t\t\t\t\t\trescue\n\t\t\t\t\t\tend\n\t\t\t\t\t})\n\t\t\t\t\tthreadnum += 1\n\t\t\t\telse\n\t\t\t\t\tsleep(0.05) and a.delete_if {|x| not x.alive?} while not a.empty?\n\t\t\t\t\tthreadnum = 0\n\t\t\t\tend\n\t\t\tend\n\t\trescue Exception => e\n\t\t\tprint_error(\"Error enumerating services. #{e.to_s}\")\n\t\tend\n\t\treturn services\n\tend", "def index\n #@service_levels = ServiceLevel.all\n @service_levels = ServiceLevel.order(\"name asc\").paginate :page => params[:page], :per_page => 25\n end", "def get_services\n reply = @client.call(:get_services)\n\n data = reply.body.dig(:get_services_response,\n :get_services_result,\n :array_of_string)\n data = check_if_data_exists(data)\n\n data.map do |attrs|\n {\n id: Integer(attrs[:string][0], 10),\n name: attrs[:string][1]\n }\n end\n end", "def resources(oneview_type = nil, oneview_name = nil)\n oneview_type = @options[:oneview_type] if oneview_type.nil?\n oneview_name = @options[:oneview_name] if oneview_name.nil?\n raise 'Oneview resource type must be specified.' if oneview_type.nil?\n\n # Determine the endpoint that needs to be called\n endpoint = format('/rest/%s', oneview_type)\n\n # Find the resources\n response = oneview_client.rest_get(endpoint)\n resources = oneview_client.response_handler(response)\n\n return resources if oneview_name.nil?\n\n # Filter the resources by the name if it has been specified\n resources['members'].select { |r| r['name'] == oneview_name }\n end", "def object_instances\n return [] if object_definition.blank?\n \n latest_version = ::AP::VoiceExtension::Voice::Config.instance.latest_version\n klazz = \"::#{latest_version.upcase}::#{object_definition.name}\".constantize\n query_scope = object_definition.query_scope\n objects = klazz.respond_to?(query_scope.to_sym) ? klazz.send(query_scope.to_sym) : []\n if objects.blank?\n return []\n else\n return objects\n end\n end", "def services\n end", "def read_all(ts, class_name, uri = '[^\\s]+')\n ts.read_all([:name, class_name, nil, Regexp.new(uri + '/\\d+')])\n end", "def index\n @servicemen = Serviceman.all\n end", "def list_tier1_l2_vpn_services_with_http_info(tier_1_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.list_tier1_l2_vpn_services ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.list_tier1_l2_vpn_services\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.list_tier1_l2_vpn_services\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.list_tier1_l2_vpn_services, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.list_tier1_l2_vpn_services, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/l2vpn-services'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2VPNServiceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi#list_tier1_l2_vpn_services\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_instances\n instances = [ ]\n get_clouds.each do |cloud|\n instances += cloud.instances.index(:filter => [], :view => 'tiny')\n end\n instances\n end", "def instances\n instances = []\n JSON.parse(resource['/instances'].get)[\"instances\"].each do |i|\n instances << Instance.new(i)\n end\n return instances\n end", "def list_services(client, args, options)\n response = client.get(RESOURCE_PATH)\n\n if CloudClient::is_error?(response)\n [response.code.to_i, response.to_s]\n else\n #[0,response.body]\n if options[:json]\n [0,response.body]\n else\n array_list = JSON.parse(response.body)\n SERVICE_TABLE.show(array_list['DOCUMENT_POOL']['DOCUMENT'])\n 0\n end\n end\nend", "def list_tier1_interfaces_with_http_info(tier_1_id, locale_services_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_interfaces ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_interfaces\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_interfaces\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_interfaces, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_interfaces, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}/interfaces'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1InterfaceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#list_tier1_interfaces\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def init_instances\n instances = []\n next_token = nil\n all_records_retrieved = false\n\n until all_records_retrieved\n response = @@client.describe_instances({\n next_token: next_token\n })\n next_token = response.next_token\n all_records_retrieved = next_token.nil? || next_token.empty?\n instances << response.reservations.map { |r| r.instances }\n end\n\n instances.flatten\n end" ]
[ "0.58344865", "0.5798938", "0.57375133", "0.5684942", "0.5676201", "0.5599036", "0.559275", "0.5578264", "0.5426529", "0.5397648", "0.5334831", "0.5284513", "0.5266344", "0.52624005", "0.5247583", "0.5226673", "0.5208993", "0.52069324", "0.5195821", "0.518867", "0.517481", "0.5169913", "0.5143196", "0.51414156", "0.5131369", "0.51237166", "0.51237166", "0.5122754", "0.5094354", "0.50892085", "0.50807756", "0.50772595", "0.5060152", "0.5025095", "0.5008684", "0.5000808", "0.49791497", "0.49613705", "0.49395806", "0.49332857", "0.49195424", "0.48969284", "0.48899674", "0.48683637", "0.4866463", "0.48657453", "0.48600677", "0.4849229", "0.48390904", "0.48381186", "0.4830835", "0.4830747", "0.4826836", "0.48237514", "0.4823384", "0.4811704", "0.48062453", "0.4804947", "0.48047456", "0.47978798", "0.4784775", "0.47840855", "0.4780325", "0.47793606", "0.47786447", "0.4772284", "0.47688648", "0.47678712", "0.47672817", "0.47662657", "0.47659516", "0.47581056", "0.47536722", "0.47448197", "0.474306", "0.47387996", "0.4738243", "0.4732223", "0.47317737", "0.47232684", "0.47202295", "0.47173092", "0.47157806", "0.47020155", "0.46932817", "0.46815032", "0.46810433", "0.46784797", "0.46743748", "0.4670093", "0.46674022", "0.46635738", "0.46556622", "0.46531066", "0.46510968", "0.46503156", "0.46477002", "0.46445242", "0.464235", "0.46409416" ]
0.50212824
34
List all Tier1 service instance endpoint List all Tier1 service instance endpoint
def list_tier1_policy_service_instance_endpoints(tier_1_id, locale_service_id, service_instance_id, opts = {}) data, _status_code, _headers = list_tier1_policy_service_instance_endpoints_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def endpoints_list\n get \"endpoints\"\n end", "def index\n endpoint(get(services_url).body)\n end", "def endpoints\n EndpointRegistry[id]\n end", "def endpoints; end", "def index\n @port_services = PortService.all\n end", "def list()\n puts \"Listing all endpoints\"\n load_manifest\n\n pp manifest.keys\n\n end", "def index\n @emt_services = EmtService.all\n end", "def listserv\n listservs.first\n end", "def endpoints\n @endpoints ||= []\n end", "def transaction_endpoints\n TransactionEndpointsController.instance\n end", "def index\n @idti_services = IdtiService.all\n end", "def get_endpoints\n endpoints = call(CMD_GET_ENDPOINTS)[:endpoints]\n endpoints.map {|endpoint| Endpoint.new(endpoint) }\n end", "def endpoints\n @endpoints ||= init_endpoints\n end", "def services\n end", "def service_list\n uri = URI.parse(@url)\n http = Net::HTTP.new(uri.host, uri.port, @proxy_addr, @proxy_port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Get.new(uri.request_uri)\n request.basic_auth user, passwd\n request.add_field 'X-ID-TENANT-NAME', id_domain\n http.request(request)\n end", "def index\n @servicemen = Serviceman.all\n end", "def index\n @servants = Servant.all\n end", "def services\n\n end", "def index\n @serves = Serve.all\n end", "def list_services\n @services\n end", "def service_endpoint; end", "def service_endpoint; end", "def index\n @endpoints = @project.endpoints.all\n end", "def index\n @serviceordemservices = Serviceordemservice.all\n end", "def index\n @request_services = RequestService.all\n end", "def index\n @tb_servicios = TbServicio.all\n end", "def endpoint_types\n %w()\n end", "def services\n\tend", "def inst_list(inst_id)\n uri = URI.parse(@url + '/' + inst_id) \n http = Net::HTTP.new(uri.host, uri.port, @proxy_addr, @proxy_port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Get.new(uri.request_uri)\n request.basic_auth user, passwd\n request.add_field 'X-ID-TENANT-NAME', id_domain\n http.request(request)\n end", "def get_endpoints\n response = @client.rest_get(@data['uri'] + '/endpoints')\n @client.response_handler(response)['members']\n end", "def endpoints\n object.endpoints.map { |e| e.id }\n end", "def index\n @tourist_site_app_services = TouristSiteAppService.all\n end", "def list_endpoints\n render json: @endpoints, status: 200\n end", "def index\n @point_services = PointService.all\n end", "def services\n\t\tService.find(:all)\n\tend", "def public_endpoints\n\t\t\[email protected] {|e| e.public_port_name != nil}\n\t\tend", "def set_endpoints\n @endpoints = Endpoint.where('client_tag like ?', \"%#{params[:client_tag]}%\")\n .where('name like ?', \"%#{params[:request_name]}%\")\n end", "def all\n @service.all\n end", "def index\n @service_requests = ServiceRequest.all\n end", "def registered_services\n ENDPOINT_INSTANCES.keys\n end", "def all(options = {})\n out = xml_run build_command('services', options.merge(:get => XML_COMMANDS_GET))\n convert_output(out.fetch(:stream, {}).fetch(:service_list, {}).fetch(:service, []), :service)\n end", "def index\n @servings = Serving.all\n end", "def get_endpoint()\n end", "def index\n @tech_servs = TechServ.page(params[:page]).per(10)\n end", "def index\n @service_lists = ServiceList.all\n end", "def services(query = {})\n get('service', query)\n end", "def index\n @sevices = Sevice.all\n end", "def index\n @services = Service.all\n end", "def index\n @services = Service.all\n end", "def index\n @services = Service.all\n end", "def index\n @services = Service.all\n end", "def index\n @services = Service.all\n end", "def index\n @services = Service.all\n end", "def index\n @services = Service.all\n end", "def index\n @services = Service.all\n end", "def index\n @services = Service.all\n end", "def index\n @call_services = CallService.all\n end", "def endpoints\n unless @endpoints_collected\n @endpoints += get_missing(\"endpoints\")\n @endpoints_collected = true\n end\n\n @endpoints\n end", "def index\n @invoice_services = InvoiceService.all\n end", "def index\n @service = Service.all()\n end", "def dcerpc_endpoint_list\n\t\tres = []\n\n\t\tprint_status(\"Connecting to the endpoint mapper service...\")\n\t\tbegin\n\t\t\teps = nil\n\t\t\tdport = nil\n\n\t\t\t[135, 593].each do |i|\n\t\t\t\tdport = i\n\t\t\t\tbegin\n\t\t\t\t\teps = Rex::Socket::Tcp.create(\n\t\t\t\t\t'PeerHost' => rhost,\n\t\t\t\t\t'PeerPort' => dport,\n\t\t\t\t\t'Proxies' => proxies,\n\t\t\t\t\t'Context' =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'Msf' => framework,\n\t\t\t\t\t\t\t'MsfExploit' => self,\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\n\t\t\t\t\tbreak\n\n\t\t\t\trescue ::Exception\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tif (not eps)\n\t\t\t\tprint_status(\"Could not connect to the endpoint mapper service\")\n\t\t\t\treturn nil\n\t\t\tend\n\n\t\t\teph = dcerpc_handle('e1af8308-5d1f-11c9-91a4-08002b14a0fa', '3.0', 'ncacn_ip_tcp', [dport])\n\t\t\topt = { 'Msf' => framework, 'MsfExploit' => self }\n\t\t\tdce = Rex::Proto::DCERPC::Client.new(eph, eps, opt)\n\n\t\t\thnd = nil\n\n\t\t\twhile(true)\n\n\t\t\t\t# Placeholders\n\t\t\t\tinfo =\n\t\t\t\t{\n\t\t\t\t\t:type => nil,\n\t\t\t\t\t:port => nil,\n\t\t\t\t\t:host => nil,\n\t\t\t\t\t:pipe => nil,\n\t\t\t\t\t:prot => nil,\n\t\t\t\t\t:uuid => nil,\n\t\t\t\t\t:vers => nil,\n\t\t\t\t\t:note => nil\n\t\t\t\t}\n\n\t\t\t\tdata = nil\n\n\t\t\t\tif(not hnd)\n\t\t\t\t\t# NULL handle to start with\n\t\t\t\t\tdata = [0, 0, 0, 0, 0, 0, 0, 0, 0, 1].pack(\"V*\")\n\t\t\t\telse\n\t\t\t\t\t# Use the existing handle\n\t\t\t\t\tdata = [0, 0, 0, 0, 0].pack(\"V*\") + hnd\n\t\t\t\tend\n\n\t\t\t\tret = dce.call(2, data)\n\n\t\t\t\tif (\n\t\t\t\t\tdce.last_response == nil or\n\t\t\t\t\tdce.last_response.stub_data == nil or\n\t\t\t\t\tdce.last_response.stub_data.length < 40 or\n\t\t\t\t\tdce.last_response.stub_data[36,4] == \"\\xd6\\xa0\\xc9\\x16\"\n\t\t\t\t)\n\t\t\t\t\t# break from the parsing loop\n\t\t\t\t\tbreak\n\t\t\t\tend\n\n\t\t\t\t# Record the response data\n\t\t\t\tbuf = dce.last_response.stub_data\n\n\t\t\t\t# Record the handle if needed\n\t\t\t\thnd = buf[4, 20] if not hnd\n\n\t\t\t\t# Parse the response data\n\t\t\t\tnlen = buf[60, 4].unpack('V')[0]\n\t\t\t\tif (nlen > 1)\n\t\t\t\t\tinfo[:note] = buf[64, nlen - 1]\n\t\t\t\tend\n\n\t\t\t\t# Align the stub offset\n\t\t\t\tsoff = nlen + 72\n\t\t\t\twhile (soff % 4 != 0)\n\t\t\t\t\tsoff += 1\n\t\t\t\tend\n\n\t\t\t\t# Determine number of records\n\t\t\t\trcnt = buf[soff, 2].unpack('v')[0]\n\t\t\t\tsoff += 2\n\n\t\t\t\t# Parse the data from the stack\n\t\t\t\t1.upto(rcnt) do |i|\n\t\t\t\t\trlen = buf[soff, 2].unpack('v')[0]\n\t\t\t\t\tsoff += 2\n\n\t\t\t\t\tif (i == 1)\n\t\t\t\t\t\tinfo[:uuid] = Rex::Proto::DCERPC::UUID.uuid_unpack(buf[soff+1, 16])\n\t\t\t\t\t\tinfo[:vers] = buf[soff+17,2].unpack('CC').map{|s| s.to_s}.join(\".\")\n\t\t\t\t\tend\n\n\t\t\t\t\tif (i > 3)\n\t\t\t\t\t\tinfo[:type] = buf[soff, 1].unpack(\"C*\")[0]\n\t\t\t\t\tend\n\n\t\t\t\t\tsoff += rlen\n\n\t\t\t\t\txlen = buf[soff, 2].unpack('v')[0]\n\t\t\t\t\tsoff += 2\n\n\t\t\t\t\tcase info[:type]\n\t\t\t\t\twhen nil\n\n\t\t\t\t\t# TCP\n\t\t\t\t\twhen 7\n\t\t\t\t\t\tinfo[:prot] = 'tcp'\n\t\t\t\t\t\tinfo[:port] = buf[soff, 2].unpack('n')[0]\n\n\t\t\t\t\t# UDP\n\t\t\t\t\twhen 8\n\t\t\t\t\t\tinfo[:prot] = 'udp'\n\t\t\t\t\t\tinfo[:port] = buf[soff, 2].unpack('n')[0]\n\n\t\t\t\t\t# ADDR\n\t\t\t\t\twhen 9\n\t\t\t\t\t\tinfo[:host] = buf[soff, 4].unpack('C4').join('.')\n\n\t\t\t\t\t# PIPE\n\t\t\t\t\twhen 15\n\t\t\t\t\t\tinfo[:prot] = 'pipe'\n\t\t\t\t\t\tinfo[:pipe] = buf[soff, xlen].unpack(\"a*\")[0]\n\n\t\t\t\t\t# LRPC\n\t\t\t\t\twhen 16\n\t\t\t\t\t\tinfo[:prot] = 'lrpc'\n\t\t\t\t\t\tinfo[:pipe] = buf[soff, xlen].unpack(\"a*\")[0]\n\n\t\t\t\t\t# NETBIOS\n\t\t\t\t\twhen 17,24\n\t\t\t\t\t\tinfo[:host] = buf[soff, xlen].unpack(\"a*\")[0]\n\n\t\t\t\t\t# HTTP\n\t\t\t\t\twhen 31\n\t\t\t\t\t\tinfo[:prot] = 'http'\n\t\t\t\t\t\tinfo[:port] = buf[soff, 2].unpack('n')[0]\n\n\t\t\t\t\t# DYNAMIC?\n\t\t\t\t\twhen 22\n\t\t\t\t\t\t# not parsed\n\t\t\t\t\telse\n\t\t\t\t\t\tprint_status(\"EPM unknown type: #{info[:type]} #{buf[soff, xlen].unpack(\"H*\")[0]}\")\n\t\t\t\t\tend\n\n\t\t\t\t\tsoff += xlen\n\t\t\t\tend\n\n\t\t\t\tinfo[:pipe].gsub!(\"\\x00\", '') if info[:pipe]\n\t\t\t\tinfo[:host].gsub!(\"\\x00\", '') if info[:host]\n\n\t\t\t\tres << info\n\t\t\tend\n\n\t\trescue ::Interrupt\n\t\t\traise $!\n\n\t\trescue ::Exception => e\n\t\t\tprint_status(\"Could not obtain the endpoint list: #{e}\")\n\t\t\tres = nil\n\t\tend\n\n\t\tres\n\tend", "def endpoint; end", "def endpoint; end", "def endpoint; end", "def endpoint; end", "def index\n @service_faults = ServiceFault.all\n end", "def index\n @xservices = Xservice.all\n end", "def index\n @service_tables = ServiceTable.all\n end", "def index\n @ordem_servicos = OrdemServico.all\n end", "def index\n @ordem_servicos = OrdemServico.all\n end", "def servers\n endpoint.config.nodes.map(&:to_s)\n end", "def index\n @service_providers = ServiceProvider.all\n end", "def _endpoint_chain\n chain = []\n node = self\n while node.is_a?(BaseEndpoint)\n chain << node\n node = node.parent\n end\n chain.reverse\n end", "def index\n @servicos = Servico.all\n end", "def list_services\n response = @http_client.get(prefix_path('services'))\n Response.new(response)\n end", "def index\n services = accessible_services.includes(:proxy, :account).order(:id).paginate(pagination_params)\n respond_with(services)\n end", "def index\n services = accessible_services.includes(:proxy, :account).order(:id).paginate(pagination_params)\n respond_with(services)\n end", "def interfaces_list\n\t\t[\n\t\t\t{\n\t\t\t\t'uri' => '/',\n\t\t\t\t'method' => 'GET',\n\t\t\t\t'purpose' => 'REST API Structure and Capability Discovery'\n\t\t\t}\n\t\t]\n\tend", "def index\n @loan_servicers = LoanServicer.all\n end", "def endpoints options={}\n service_type = options[:service_type]\n endpoint_type = options[:endpoint_type]\n\n return {}.tap do |rtn|\n catalog = self.catalog['serviceCatalog'] || []\n\n catalog.each do |service|\n next if service_type and service_type != service['type']\n\n rtn[service['type']] = []\n service['endpoints'].each do |endpoint|\n next if endpoint_type and endpoint.include?(endpoint_type)\n rtn[service['type']] << endpoint\n end\n end\n end\n end", "def index\n @service_classes = ServiceClass.all\n end", "def services\n ServiceLocator.service_names.map{|name| \"#{name}_service\".to_sym}\n end", "def index\n @pagos_servicios = PagosServicio.all\n end", "def index\n @therm_resources = ThermResource.all\n end", "def index\n @webhook_endpoints = WebhookEndpoint.all\n end", "def show\n @latest_version = @service.latest_version\n @latest_version_instance = @latest_version.service_versionified\n @latest_deployment = @service.latest_deployment\n\n @all_service_version_instances = @service.service_version_instances\n @all_service_types = @service.service_types\n\n @soaplab_server = @service.soaplab_server\n\n @pending_responsibility_requests = @service.pending_responsibility_requests\n unless is_api_request?\n @service_tests = @service.service_tests\n @test_script_service_tests = @service.service_tests_by_type(\"TestScript\")\n @url_monitor_service_tests = @service.service_tests_by_type(\"UrlMonitor\")\n end\n if @latest_version_instance.is_a?(RestService)\n @grouped_rest_methods = @latest_version_instance.group_all_rest_methods_from_rest_resources\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml # show.xml.builder\n format.json { render :json => @service.to_json }\n end\n end", "def get_endpoint_info(client)\n response = client.get_endpoints()\n logger.info \"this is response for all endpoints #{response.inspect}\"\n if response[0]= 200\n # if api call is sucess \n all_endpoints= response[1][\"objects\"]\n logger.info \"entering parsing \"\n all_endpoints.each do |e|\n logger.info \"looking for a match beetween #{e[\"alias\"]} == #{self.id}\"\n if e[\"alias\"] == self.id.to_s\n #found the endpoint info\n logger.info \"found a match #{e.inspect}\"\n self.sip_endpoint = e\n add_to_phone(e)\n end \n end \n end\n end", "def tag_data_endpoints\n TagDataEndpointsController.instance\n end", "def servers\n Vultr::Resource::Server.new(@faraday)\n end", "def service_list\n @service_list ||= {}\n end", "def index\n @vices = Vice.all\n end", "def init_endpoints\n endpoints = []\n next_token = nil\n all_records_retrieved = false\n\n until all_records_retrieved\n response = @@client.describe_vpc_endpoints({\n next_token: next_token\n })\n next_token = response.next_token\n all_records_retrieved = next_token.nil? || next_token.empty?\n endpoints << response.vpc_endpoints\n end\n\n endpoints.flatten\n end", "def index\n\t@aservices = Aservice.all #@aservices variable de clase\n end", "def index\n #@transports = Transport.all\n @transports = Transport.paginate :page => params[:page], :order => 'id DESC'\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @transports }\n end\n end", "def index\n @hospital = Hospital.find(params[:hospital_id])\n @service_requests = @hospital.service_request.all\n end", "def servers(service_id)\n request :get, \"/services/#{service_id}/servers\"\n end", "def services\n @services ||= []\n end", "def index\n @providerservices = Providerservice.all\n end", "def index\n @tarifas_servicios = TarifasServicio.all\n end", "def index\n @trafficofficers = Trafficofficer.all\n end", "def read_all_policy_service_instances_for_tier1_with_http_info(tier_1_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstanceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_all_policy_service_instances_for_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end" ]
[ "0.68617404", "0.6665617", "0.64297575", "0.63295543", "0.61919904", "0.61715585", "0.6124001", "0.6094538", "0.60799533", "0.6036918", "0.6034845", "0.6015748", "0.60012597", "0.5964773", "0.595692", "0.59415877", "0.5925453", "0.5922914", "0.59045476", "0.58989143", "0.58921695", "0.58921695", "0.5873431", "0.5871035", "0.58694685", "0.5866193", "0.58563304", "0.5852655", "0.58364594", "0.58341247", "0.5816806", "0.57974696", "0.57951635", "0.5780094", "0.57300264", "0.5704321", "0.5695265", "0.5694041", "0.5678045", "0.5677106", "0.5654513", "0.5635989", "0.56282485", "0.56259036", "0.5616455", "0.56158364", "0.55955595", "0.55712855", "0.55712855", "0.55712855", "0.55712855", "0.55712855", "0.55712855", "0.55712855", "0.55712855", "0.55712855", "0.55677533", "0.5562352", "0.5562305", "0.5551727", "0.55483466", "0.5539808", "0.5539808", "0.5539808", "0.5539808", "0.5539328", "0.55329096", "0.55324423", "0.5529578", "0.5529578", "0.55291015", "0.55285245", "0.5527072", "0.5516443", "0.5504102", "0.5492824", "0.5492824", "0.5491223", "0.54881907", "0.5487372", "0.547985", "0.54759765", "0.5472698", "0.5469483", "0.54649854", "0.5456153", "0.5455445", "0.5449176", "0.5448943", "0.5419375", "0.5419369", "0.541665", "0.5412269", "0.54011625", "0.53857535", "0.5384119", "0.53832406", "0.5379717", "0.5375149", "0.5373882", "0.53639126" ]
0.0
-1
List all Tier1 service instance endpoint List all Tier1 service instance endpoint
def list_tier1_policy_service_instance_endpoints_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_policy_service_instance_endpoints ...' end # verify the required parameter 'tier_1_id' is set if @api_client.config.client_side_validation && tier_1_id.nil? fail ArgumentError, "Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_policy_service_instance_endpoints" end # verify the required parameter 'locale_service_id' is set if @api_client.config.client_side_validation && locale_service_id.nil? fail ArgumentError, "Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_policy_service_instance_endpoints" end # verify the required parameter 'service_instance_id' is set if @api_client.config.client_side_validation && service_instance_id.nil? fail ArgumentError, "Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_policy_service_instance_endpoints" end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_policy_service_instance_endpoints, must be smaller than or equal to 1000.' end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_policy_service_instance_endpoints, must be greater than or equal to 0.' end # resource path local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s) # query parameters query_params = {} query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil? query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil? query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil? query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil? query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ServiceInstanceEndpointListResult') if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#list_tier1_policy_service_instance_endpoints\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def endpoints_list\n get \"endpoints\"\n end", "def index\n endpoint(get(services_url).body)\n end", "def endpoints\n EndpointRegistry[id]\n end", "def endpoints; end", "def index\n @port_services = PortService.all\n end", "def list()\n puts \"Listing all endpoints\"\n load_manifest\n\n pp manifest.keys\n\n end", "def index\n @emt_services = EmtService.all\n end", "def listserv\n listservs.first\n end", "def endpoints\n @endpoints ||= []\n end", "def transaction_endpoints\n TransactionEndpointsController.instance\n end", "def index\n @idti_services = IdtiService.all\n end", "def get_endpoints\n endpoints = call(CMD_GET_ENDPOINTS)[:endpoints]\n endpoints.map {|endpoint| Endpoint.new(endpoint) }\n end", "def endpoints\n @endpoints ||= init_endpoints\n end", "def services\n end", "def service_list\n uri = URI.parse(@url)\n http = Net::HTTP.new(uri.host, uri.port, @proxy_addr, @proxy_port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Get.new(uri.request_uri)\n request.basic_auth user, passwd\n request.add_field 'X-ID-TENANT-NAME', id_domain\n http.request(request)\n end", "def index\n @servicemen = Serviceman.all\n end", "def index\n @servants = Servant.all\n end", "def services\n\n end", "def index\n @serves = Serve.all\n end", "def list_services\n @services\n end", "def service_endpoint; end", "def service_endpoint; end", "def index\n @endpoints = @project.endpoints.all\n end", "def index\n @serviceordemservices = Serviceordemservice.all\n end", "def index\n @request_services = RequestService.all\n end", "def index\n @tb_servicios = TbServicio.all\n end", "def endpoint_types\n %w()\n end", "def services\n\tend", "def inst_list(inst_id)\n uri = URI.parse(@url + '/' + inst_id) \n http = Net::HTTP.new(uri.host, uri.port, @proxy_addr, @proxy_port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Get.new(uri.request_uri)\n request.basic_auth user, passwd\n request.add_field 'X-ID-TENANT-NAME', id_domain\n http.request(request)\n end", "def get_endpoints\n response = @client.rest_get(@data['uri'] + '/endpoints')\n @client.response_handler(response)['members']\n end", "def endpoints\n object.endpoints.map { |e| e.id }\n end", "def index\n @tourist_site_app_services = TouristSiteAppService.all\n end", "def list_endpoints\n render json: @endpoints, status: 200\n end", "def index\n @point_services = PointService.all\n end", "def services\n\t\tService.find(:all)\n\tend", "def public_endpoints\n\t\t\[email protected] {|e| e.public_port_name != nil}\n\t\tend", "def set_endpoints\n @endpoints = Endpoint.where('client_tag like ?', \"%#{params[:client_tag]}%\")\n .where('name like ?', \"%#{params[:request_name]}%\")\n end", "def all\n @service.all\n end", "def index\n @service_requests = ServiceRequest.all\n end", "def registered_services\n ENDPOINT_INSTANCES.keys\n end", "def all(options = {})\n out = xml_run build_command('services', options.merge(:get => XML_COMMANDS_GET))\n convert_output(out.fetch(:stream, {}).fetch(:service_list, {}).fetch(:service, []), :service)\n end", "def index\n @servings = Serving.all\n end", "def get_endpoint()\n end", "def index\n @tech_servs = TechServ.page(params[:page]).per(10)\n end", "def index\n @service_lists = ServiceList.all\n end", "def services(query = {})\n get('service', query)\n end", "def index\n @sevices = Sevice.all\n end", "def index\n @services = Service.all\n end", "def index\n @services = Service.all\n end", "def index\n @services = Service.all\n end", "def index\n @services = Service.all\n end", "def index\n @services = Service.all\n end", "def index\n @services = Service.all\n end", "def index\n @services = Service.all\n end", "def index\n @services = Service.all\n end", "def index\n @services = Service.all\n end", "def index\n @call_services = CallService.all\n end", "def endpoints\n unless @endpoints_collected\n @endpoints += get_missing(\"endpoints\")\n @endpoints_collected = true\n end\n\n @endpoints\n end", "def index\n @invoice_services = InvoiceService.all\n end", "def index\n @service = Service.all()\n end", "def dcerpc_endpoint_list\n\t\tres = []\n\n\t\tprint_status(\"Connecting to the endpoint mapper service...\")\n\t\tbegin\n\t\t\teps = nil\n\t\t\tdport = nil\n\n\t\t\t[135, 593].each do |i|\n\t\t\t\tdport = i\n\t\t\t\tbegin\n\t\t\t\t\teps = Rex::Socket::Tcp.create(\n\t\t\t\t\t'PeerHost' => rhost,\n\t\t\t\t\t'PeerPort' => dport,\n\t\t\t\t\t'Proxies' => proxies,\n\t\t\t\t\t'Context' =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'Msf' => framework,\n\t\t\t\t\t\t\t'MsfExploit' => self,\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\n\t\t\t\t\tbreak\n\n\t\t\t\trescue ::Exception\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tif (not eps)\n\t\t\t\tprint_status(\"Could not connect to the endpoint mapper service\")\n\t\t\t\treturn nil\n\t\t\tend\n\n\t\t\teph = dcerpc_handle('e1af8308-5d1f-11c9-91a4-08002b14a0fa', '3.0', 'ncacn_ip_tcp', [dport])\n\t\t\topt = { 'Msf' => framework, 'MsfExploit' => self }\n\t\t\tdce = Rex::Proto::DCERPC::Client.new(eph, eps, opt)\n\n\t\t\thnd = nil\n\n\t\t\twhile(true)\n\n\t\t\t\t# Placeholders\n\t\t\t\tinfo =\n\t\t\t\t{\n\t\t\t\t\t:type => nil,\n\t\t\t\t\t:port => nil,\n\t\t\t\t\t:host => nil,\n\t\t\t\t\t:pipe => nil,\n\t\t\t\t\t:prot => nil,\n\t\t\t\t\t:uuid => nil,\n\t\t\t\t\t:vers => nil,\n\t\t\t\t\t:note => nil\n\t\t\t\t}\n\n\t\t\t\tdata = nil\n\n\t\t\t\tif(not hnd)\n\t\t\t\t\t# NULL handle to start with\n\t\t\t\t\tdata = [0, 0, 0, 0, 0, 0, 0, 0, 0, 1].pack(\"V*\")\n\t\t\t\telse\n\t\t\t\t\t# Use the existing handle\n\t\t\t\t\tdata = [0, 0, 0, 0, 0].pack(\"V*\") + hnd\n\t\t\t\tend\n\n\t\t\t\tret = dce.call(2, data)\n\n\t\t\t\tif (\n\t\t\t\t\tdce.last_response == nil or\n\t\t\t\t\tdce.last_response.stub_data == nil or\n\t\t\t\t\tdce.last_response.stub_data.length < 40 or\n\t\t\t\t\tdce.last_response.stub_data[36,4] == \"\\xd6\\xa0\\xc9\\x16\"\n\t\t\t\t)\n\t\t\t\t\t# break from the parsing loop\n\t\t\t\t\tbreak\n\t\t\t\tend\n\n\t\t\t\t# Record the response data\n\t\t\t\tbuf = dce.last_response.stub_data\n\n\t\t\t\t# Record the handle if needed\n\t\t\t\thnd = buf[4, 20] if not hnd\n\n\t\t\t\t# Parse the response data\n\t\t\t\tnlen = buf[60, 4].unpack('V')[0]\n\t\t\t\tif (nlen > 1)\n\t\t\t\t\tinfo[:note] = buf[64, nlen - 1]\n\t\t\t\tend\n\n\t\t\t\t# Align the stub offset\n\t\t\t\tsoff = nlen + 72\n\t\t\t\twhile (soff % 4 != 0)\n\t\t\t\t\tsoff += 1\n\t\t\t\tend\n\n\t\t\t\t# Determine number of records\n\t\t\t\trcnt = buf[soff, 2].unpack('v')[0]\n\t\t\t\tsoff += 2\n\n\t\t\t\t# Parse the data from the stack\n\t\t\t\t1.upto(rcnt) do |i|\n\t\t\t\t\trlen = buf[soff, 2].unpack('v')[0]\n\t\t\t\t\tsoff += 2\n\n\t\t\t\t\tif (i == 1)\n\t\t\t\t\t\tinfo[:uuid] = Rex::Proto::DCERPC::UUID.uuid_unpack(buf[soff+1, 16])\n\t\t\t\t\t\tinfo[:vers] = buf[soff+17,2].unpack('CC').map{|s| s.to_s}.join(\".\")\n\t\t\t\t\tend\n\n\t\t\t\t\tif (i > 3)\n\t\t\t\t\t\tinfo[:type] = buf[soff, 1].unpack(\"C*\")[0]\n\t\t\t\t\tend\n\n\t\t\t\t\tsoff += rlen\n\n\t\t\t\t\txlen = buf[soff, 2].unpack('v')[0]\n\t\t\t\t\tsoff += 2\n\n\t\t\t\t\tcase info[:type]\n\t\t\t\t\twhen nil\n\n\t\t\t\t\t# TCP\n\t\t\t\t\twhen 7\n\t\t\t\t\t\tinfo[:prot] = 'tcp'\n\t\t\t\t\t\tinfo[:port] = buf[soff, 2].unpack('n')[0]\n\n\t\t\t\t\t# UDP\n\t\t\t\t\twhen 8\n\t\t\t\t\t\tinfo[:prot] = 'udp'\n\t\t\t\t\t\tinfo[:port] = buf[soff, 2].unpack('n')[0]\n\n\t\t\t\t\t# ADDR\n\t\t\t\t\twhen 9\n\t\t\t\t\t\tinfo[:host] = buf[soff, 4].unpack('C4').join('.')\n\n\t\t\t\t\t# PIPE\n\t\t\t\t\twhen 15\n\t\t\t\t\t\tinfo[:prot] = 'pipe'\n\t\t\t\t\t\tinfo[:pipe] = buf[soff, xlen].unpack(\"a*\")[0]\n\n\t\t\t\t\t# LRPC\n\t\t\t\t\twhen 16\n\t\t\t\t\t\tinfo[:prot] = 'lrpc'\n\t\t\t\t\t\tinfo[:pipe] = buf[soff, xlen].unpack(\"a*\")[0]\n\n\t\t\t\t\t# NETBIOS\n\t\t\t\t\twhen 17,24\n\t\t\t\t\t\tinfo[:host] = buf[soff, xlen].unpack(\"a*\")[0]\n\n\t\t\t\t\t# HTTP\n\t\t\t\t\twhen 31\n\t\t\t\t\t\tinfo[:prot] = 'http'\n\t\t\t\t\t\tinfo[:port] = buf[soff, 2].unpack('n')[0]\n\n\t\t\t\t\t# DYNAMIC?\n\t\t\t\t\twhen 22\n\t\t\t\t\t\t# not parsed\n\t\t\t\t\telse\n\t\t\t\t\t\tprint_status(\"EPM unknown type: #{info[:type]} #{buf[soff, xlen].unpack(\"H*\")[0]}\")\n\t\t\t\t\tend\n\n\t\t\t\t\tsoff += xlen\n\t\t\t\tend\n\n\t\t\t\tinfo[:pipe].gsub!(\"\\x00\", '') if info[:pipe]\n\t\t\t\tinfo[:host].gsub!(\"\\x00\", '') if info[:host]\n\n\t\t\t\tres << info\n\t\t\tend\n\n\t\trescue ::Interrupt\n\t\t\traise $!\n\n\t\trescue ::Exception => e\n\t\t\tprint_status(\"Could not obtain the endpoint list: #{e}\")\n\t\t\tres = nil\n\t\tend\n\n\t\tres\n\tend", "def endpoint; end", "def endpoint; end", "def endpoint; end", "def endpoint; end", "def index\n @service_faults = ServiceFault.all\n end", "def index\n @xservices = Xservice.all\n end", "def index\n @service_tables = ServiceTable.all\n end", "def index\n @ordem_servicos = OrdemServico.all\n end", "def index\n @ordem_servicos = OrdemServico.all\n end", "def servers\n endpoint.config.nodes.map(&:to_s)\n end", "def index\n @service_providers = ServiceProvider.all\n end", "def _endpoint_chain\n chain = []\n node = self\n while node.is_a?(BaseEndpoint)\n chain << node\n node = node.parent\n end\n chain.reverse\n end", "def index\n @servicos = Servico.all\n end", "def list_services\n response = @http_client.get(prefix_path('services'))\n Response.new(response)\n end", "def index\n services = accessible_services.includes(:proxy, :account).order(:id).paginate(pagination_params)\n respond_with(services)\n end", "def index\n services = accessible_services.includes(:proxy, :account).order(:id).paginate(pagination_params)\n respond_with(services)\n end", "def interfaces_list\n\t\t[\n\t\t\t{\n\t\t\t\t'uri' => '/',\n\t\t\t\t'method' => 'GET',\n\t\t\t\t'purpose' => 'REST API Structure and Capability Discovery'\n\t\t\t}\n\t\t]\n\tend", "def index\n @loan_servicers = LoanServicer.all\n end", "def endpoints options={}\n service_type = options[:service_type]\n endpoint_type = options[:endpoint_type]\n\n return {}.tap do |rtn|\n catalog = self.catalog['serviceCatalog'] || []\n\n catalog.each do |service|\n next if service_type and service_type != service['type']\n\n rtn[service['type']] = []\n service['endpoints'].each do |endpoint|\n next if endpoint_type and endpoint.include?(endpoint_type)\n rtn[service['type']] << endpoint\n end\n end\n end\n end", "def index\n @service_classes = ServiceClass.all\n end", "def services\n ServiceLocator.service_names.map{|name| \"#{name}_service\".to_sym}\n end", "def index\n @pagos_servicios = PagosServicio.all\n end", "def index\n @therm_resources = ThermResource.all\n end", "def index\n @webhook_endpoints = WebhookEndpoint.all\n end", "def show\n @latest_version = @service.latest_version\n @latest_version_instance = @latest_version.service_versionified\n @latest_deployment = @service.latest_deployment\n\n @all_service_version_instances = @service.service_version_instances\n @all_service_types = @service.service_types\n\n @soaplab_server = @service.soaplab_server\n\n @pending_responsibility_requests = @service.pending_responsibility_requests\n unless is_api_request?\n @service_tests = @service.service_tests\n @test_script_service_tests = @service.service_tests_by_type(\"TestScript\")\n @url_monitor_service_tests = @service.service_tests_by_type(\"UrlMonitor\")\n end\n if @latest_version_instance.is_a?(RestService)\n @grouped_rest_methods = @latest_version_instance.group_all_rest_methods_from_rest_resources\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml # show.xml.builder\n format.json { render :json => @service.to_json }\n end\n end", "def get_endpoint_info(client)\n response = client.get_endpoints()\n logger.info \"this is response for all endpoints #{response.inspect}\"\n if response[0]= 200\n # if api call is sucess \n all_endpoints= response[1][\"objects\"]\n logger.info \"entering parsing \"\n all_endpoints.each do |e|\n logger.info \"looking for a match beetween #{e[\"alias\"]} == #{self.id}\"\n if e[\"alias\"] == self.id.to_s\n #found the endpoint info\n logger.info \"found a match #{e.inspect}\"\n self.sip_endpoint = e\n add_to_phone(e)\n end \n end \n end\n end", "def tag_data_endpoints\n TagDataEndpointsController.instance\n end", "def servers\n Vultr::Resource::Server.new(@faraday)\n end", "def service_list\n @service_list ||= {}\n end", "def index\n @vices = Vice.all\n end", "def init_endpoints\n endpoints = []\n next_token = nil\n all_records_retrieved = false\n\n until all_records_retrieved\n response = @@client.describe_vpc_endpoints({\n next_token: next_token\n })\n next_token = response.next_token\n all_records_retrieved = next_token.nil? || next_token.empty?\n endpoints << response.vpc_endpoints\n end\n\n endpoints.flatten\n end", "def index\n\t@aservices = Aservice.all #@aservices variable de clase\n end", "def index\n #@transports = Transport.all\n @transports = Transport.paginate :page => params[:page], :order => 'id DESC'\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @transports }\n end\n end", "def index\n @hospital = Hospital.find(params[:hospital_id])\n @service_requests = @hospital.service_request.all\n end", "def servers(service_id)\n request :get, \"/services/#{service_id}/servers\"\n end", "def services\n @services ||= []\n end", "def index\n @providerservices = Providerservice.all\n end", "def index\n @tarifas_servicios = TarifasServicio.all\n end", "def index\n @trafficofficers = Trafficofficer.all\n end", "def read_all_policy_service_instances_for_tier1_with_http_info(tier_1_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstanceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_all_policy_service_instances_for_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end" ]
[ "0.68617404", "0.6665617", "0.64297575", "0.63295543", "0.61919904", "0.61715585", "0.6124001", "0.6094538", "0.60799533", "0.6036918", "0.6034845", "0.6015748", "0.60012597", "0.5964773", "0.595692", "0.59415877", "0.5925453", "0.5922914", "0.59045476", "0.58989143", "0.58921695", "0.58921695", "0.5873431", "0.5871035", "0.58694685", "0.5866193", "0.58563304", "0.5852655", "0.58364594", "0.58341247", "0.5816806", "0.57974696", "0.57951635", "0.5780094", "0.57300264", "0.5704321", "0.5695265", "0.5694041", "0.5678045", "0.5677106", "0.5654513", "0.5635989", "0.56282485", "0.56259036", "0.5616455", "0.56158364", "0.55955595", "0.55712855", "0.55712855", "0.55712855", "0.55712855", "0.55712855", "0.55712855", "0.55712855", "0.55712855", "0.55712855", "0.55677533", "0.5562352", "0.5562305", "0.5551727", "0.55483466", "0.5539808", "0.5539808", "0.5539808", "0.5539808", "0.5539328", "0.55329096", "0.55324423", "0.5529578", "0.5529578", "0.55291015", "0.55285245", "0.5527072", "0.5516443", "0.5504102", "0.5492824", "0.5492824", "0.5491223", "0.54881907", "0.5487372", "0.547985", "0.54759765", "0.5472698", "0.5469483", "0.54649854", "0.5456153", "0.5455445", "0.5449176", "0.5448943", "0.5419375", "0.5419369", "0.541665", "0.5412269", "0.54011625", "0.53857535", "0.5384119", "0.53832406", "0.5379717", "0.5375149", "0.5373882", "0.53639126" ]
0.0
-1
List all Tier1 service instance endpoint List all Tier1 service instance endpoint
def list_tier1_policy_service_instance_endpoints_0(tier_1_id, locale_service_id, service_instance_id, opts = {}) data, _status_code, _headers = list_tier1_policy_service_instance_endpoints_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def endpoints_list\n get \"endpoints\"\n end", "def index\n endpoint(get(services_url).body)\n end", "def endpoints\n EndpointRegistry[id]\n end", "def endpoints; end", "def index\n @port_services = PortService.all\n end", "def list()\n puts \"Listing all endpoints\"\n load_manifest\n\n pp manifest.keys\n\n end", "def index\n @emt_services = EmtService.all\n end", "def listserv\n listservs.first\n end", "def endpoints\n @endpoints ||= []\n end", "def transaction_endpoints\n TransactionEndpointsController.instance\n end", "def index\n @idti_services = IdtiService.all\n end", "def get_endpoints\n endpoints = call(CMD_GET_ENDPOINTS)[:endpoints]\n endpoints.map {|endpoint| Endpoint.new(endpoint) }\n end", "def endpoints\n @endpoints ||= init_endpoints\n end", "def services\n end", "def service_list\n uri = URI.parse(@url)\n http = Net::HTTP.new(uri.host, uri.port, @proxy_addr, @proxy_port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Get.new(uri.request_uri)\n request.basic_auth user, passwd\n request.add_field 'X-ID-TENANT-NAME', id_domain\n http.request(request)\n end", "def index\n @servicemen = Serviceman.all\n end", "def index\n @servants = Servant.all\n end", "def services\n\n end", "def index\n @serves = Serve.all\n end", "def list_services\n @services\n end", "def service_endpoint; end", "def service_endpoint; end", "def index\n @endpoints = @project.endpoints.all\n end", "def index\n @serviceordemservices = Serviceordemservice.all\n end", "def index\n @request_services = RequestService.all\n end", "def index\n @tb_servicios = TbServicio.all\n end", "def endpoint_types\n %w()\n end", "def services\n\tend", "def inst_list(inst_id)\n uri = URI.parse(@url + '/' + inst_id) \n http = Net::HTTP.new(uri.host, uri.port, @proxy_addr, @proxy_port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Get.new(uri.request_uri)\n request.basic_auth user, passwd\n request.add_field 'X-ID-TENANT-NAME', id_domain\n http.request(request)\n end", "def get_endpoints\n response = @client.rest_get(@data['uri'] + '/endpoints')\n @client.response_handler(response)['members']\n end", "def endpoints\n object.endpoints.map { |e| e.id }\n end", "def index\n @tourist_site_app_services = TouristSiteAppService.all\n end", "def list_endpoints\n render json: @endpoints, status: 200\n end", "def index\n @point_services = PointService.all\n end", "def services\n\t\tService.find(:all)\n\tend", "def public_endpoints\n\t\t\[email protected] {|e| e.public_port_name != nil}\n\t\tend", "def set_endpoints\n @endpoints = Endpoint.where('client_tag like ?', \"%#{params[:client_tag]}%\")\n .where('name like ?', \"%#{params[:request_name]}%\")\n end", "def all\n @service.all\n end", "def index\n @service_requests = ServiceRequest.all\n end", "def registered_services\n ENDPOINT_INSTANCES.keys\n end", "def all(options = {})\n out = xml_run build_command('services', options.merge(:get => XML_COMMANDS_GET))\n convert_output(out.fetch(:stream, {}).fetch(:service_list, {}).fetch(:service, []), :service)\n end", "def index\n @servings = Serving.all\n end", "def get_endpoint()\n end", "def index\n @tech_servs = TechServ.page(params[:page]).per(10)\n end", "def index\n @service_lists = ServiceList.all\n end", "def services(query = {})\n get('service', query)\n end", "def index\n @sevices = Sevice.all\n end", "def index\n @services = Service.all\n end", "def index\n @services = Service.all\n end", "def index\n @services = Service.all\n end", "def index\n @services = Service.all\n end", "def index\n @services = Service.all\n end", "def index\n @services = Service.all\n end", "def index\n @services = Service.all\n end", "def index\n @services = Service.all\n end", "def index\n @services = Service.all\n end", "def index\n @call_services = CallService.all\n end", "def index\n @invoice_services = InvoiceService.all\n end", "def endpoints\n unless @endpoints_collected\n @endpoints += get_missing(\"endpoints\")\n @endpoints_collected = true\n end\n\n @endpoints\n end", "def index\n @service = Service.all()\n end", "def dcerpc_endpoint_list\n\t\tres = []\n\n\t\tprint_status(\"Connecting to the endpoint mapper service...\")\n\t\tbegin\n\t\t\teps = nil\n\t\t\tdport = nil\n\n\t\t\t[135, 593].each do |i|\n\t\t\t\tdport = i\n\t\t\t\tbegin\n\t\t\t\t\teps = Rex::Socket::Tcp.create(\n\t\t\t\t\t'PeerHost' => rhost,\n\t\t\t\t\t'PeerPort' => dport,\n\t\t\t\t\t'Proxies' => proxies,\n\t\t\t\t\t'Context' =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'Msf' => framework,\n\t\t\t\t\t\t\t'MsfExploit' => self,\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\n\t\t\t\t\tbreak\n\n\t\t\t\trescue ::Exception\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tif (not eps)\n\t\t\t\tprint_status(\"Could not connect to the endpoint mapper service\")\n\t\t\t\treturn nil\n\t\t\tend\n\n\t\t\teph = dcerpc_handle('e1af8308-5d1f-11c9-91a4-08002b14a0fa', '3.0', 'ncacn_ip_tcp', [dport])\n\t\t\topt = { 'Msf' => framework, 'MsfExploit' => self }\n\t\t\tdce = Rex::Proto::DCERPC::Client.new(eph, eps, opt)\n\n\t\t\thnd = nil\n\n\t\t\twhile(true)\n\n\t\t\t\t# Placeholders\n\t\t\t\tinfo =\n\t\t\t\t{\n\t\t\t\t\t:type => nil,\n\t\t\t\t\t:port => nil,\n\t\t\t\t\t:host => nil,\n\t\t\t\t\t:pipe => nil,\n\t\t\t\t\t:prot => nil,\n\t\t\t\t\t:uuid => nil,\n\t\t\t\t\t:vers => nil,\n\t\t\t\t\t:note => nil\n\t\t\t\t}\n\n\t\t\t\tdata = nil\n\n\t\t\t\tif(not hnd)\n\t\t\t\t\t# NULL handle to start with\n\t\t\t\t\tdata = [0, 0, 0, 0, 0, 0, 0, 0, 0, 1].pack(\"V*\")\n\t\t\t\telse\n\t\t\t\t\t# Use the existing handle\n\t\t\t\t\tdata = [0, 0, 0, 0, 0].pack(\"V*\") + hnd\n\t\t\t\tend\n\n\t\t\t\tret = dce.call(2, data)\n\n\t\t\t\tif (\n\t\t\t\t\tdce.last_response == nil or\n\t\t\t\t\tdce.last_response.stub_data == nil or\n\t\t\t\t\tdce.last_response.stub_data.length < 40 or\n\t\t\t\t\tdce.last_response.stub_data[36,4] == \"\\xd6\\xa0\\xc9\\x16\"\n\t\t\t\t)\n\t\t\t\t\t# break from the parsing loop\n\t\t\t\t\tbreak\n\t\t\t\tend\n\n\t\t\t\t# Record the response data\n\t\t\t\tbuf = dce.last_response.stub_data\n\n\t\t\t\t# Record the handle if needed\n\t\t\t\thnd = buf[4, 20] if not hnd\n\n\t\t\t\t# Parse the response data\n\t\t\t\tnlen = buf[60, 4].unpack('V')[0]\n\t\t\t\tif (nlen > 1)\n\t\t\t\t\tinfo[:note] = buf[64, nlen - 1]\n\t\t\t\tend\n\n\t\t\t\t# Align the stub offset\n\t\t\t\tsoff = nlen + 72\n\t\t\t\twhile (soff % 4 != 0)\n\t\t\t\t\tsoff += 1\n\t\t\t\tend\n\n\t\t\t\t# Determine number of records\n\t\t\t\trcnt = buf[soff, 2].unpack('v')[0]\n\t\t\t\tsoff += 2\n\n\t\t\t\t# Parse the data from the stack\n\t\t\t\t1.upto(rcnt) do |i|\n\t\t\t\t\trlen = buf[soff, 2].unpack('v')[0]\n\t\t\t\t\tsoff += 2\n\n\t\t\t\t\tif (i == 1)\n\t\t\t\t\t\tinfo[:uuid] = Rex::Proto::DCERPC::UUID.uuid_unpack(buf[soff+1, 16])\n\t\t\t\t\t\tinfo[:vers] = buf[soff+17,2].unpack('CC').map{|s| s.to_s}.join(\".\")\n\t\t\t\t\tend\n\n\t\t\t\t\tif (i > 3)\n\t\t\t\t\t\tinfo[:type] = buf[soff, 1].unpack(\"C*\")[0]\n\t\t\t\t\tend\n\n\t\t\t\t\tsoff += rlen\n\n\t\t\t\t\txlen = buf[soff, 2].unpack('v')[0]\n\t\t\t\t\tsoff += 2\n\n\t\t\t\t\tcase info[:type]\n\t\t\t\t\twhen nil\n\n\t\t\t\t\t# TCP\n\t\t\t\t\twhen 7\n\t\t\t\t\t\tinfo[:prot] = 'tcp'\n\t\t\t\t\t\tinfo[:port] = buf[soff, 2].unpack('n')[0]\n\n\t\t\t\t\t# UDP\n\t\t\t\t\twhen 8\n\t\t\t\t\t\tinfo[:prot] = 'udp'\n\t\t\t\t\t\tinfo[:port] = buf[soff, 2].unpack('n')[0]\n\n\t\t\t\t\t# ADDR\n\t\t\t\t\twhen 9\n\t\t\t\t\t\tinfo[:host] = buf[soff, 4].unpack('C4').join('.')\n\n\t\t\t\t\t# PIPE\n\t\t\t\t\twhen 15\n\t\t\t\t\t\tinfo[:prot] = 'pipe'\n\t\t\t\t\t\tinfo[:pipe] = buf[soff, xlen].unpack(\"a*\")[0]\n\n\t\t\t\t\t# LRPC\n\t\t\t\t\twhen 16\n\t\t\t\t\t\tinfo[:prot] = 'lrpc'\n\t\t\t\t\t\tinfo[:pipe] = buf[soff, xlen].unpack(\"a*\")[0]\n\n\t\t\t\t\t# NETBIOS\n\t\t\t\t\twhen 17,24\n\t\t\t\t\t\tinfo[:host] = buf[soff, xlen].unpack(\"a*\")[0]\n\n\t\t\t\t\t# HTTP\n\t\t\t\t\twhen 31\n\t\t\t\t\t\tinfo[:prot] = 'http'\n\t\t\t\t\t\tinfo[:port] = buf[soff, 2].unpack('n')[0]\n\n\t\t\t\t\t# DYNAMIC?\n\t\t\t\t\twhen 22\n\t\t\t\t\t\t# not parsed\n\t\t\t\t\telse\n\t\t\t\t\t\tprint_status(\"EPM unknown type: #{info[:type]} #{buf[soff, xlen].unpack(\"H*\")[0]}\")\n\t\t\t\t\tend\n\n\t\t\t\t\tsoff += xlen\n\t\t\t\tend\n\n\t\t\t\tinfo[:pipe].gsub!(\"\\x00\", '') if info[:pipe]\n\t\t\t\tinfo[:host].gsub!(\"\\x00\", '') if info[:host]\n\n\t\t\t\tres << info\n\t\t\tend\n\n\t\trescue ::Interrupt\n\t\t\traise $!\n\n\t\trescue ::Exception => e\n\t\t\tprint_status(\"Could not obtain the endpoint list: #{e}\")\n\t\t\tres = nil\n\t\tend\n\n\t\tres\n\tend", "def endpoint; end", "def endpoint; end", "def endpoint; end", "def endpoint; end", "def index\n @service_faults = ServiceFault.all\n end", "def index\n @xservices = Xservice.all\n end", "def index\n @service_tables = ServiceTable.all\n end", "def index\n @ordem_servicos = OrdemServico.all\n end", "def index\n @ordem_servicos = OrdemServico.all\n end", "def index\n @service_providers = ServiceProvider.all\n end", "def servers\n endpoint.config.nodes.map(&:to_s)\n end", "def _endpoint_chain\n chain = []\n node = self\n while node.is_a?(BaseEndpoint)\n chain << node\n node = node.parent\n end\n chain.reverse\n end", "def index\n @servicos = Servico.all\n end", "def list_services\n response = @http_client.get(prefix_path('services'))\n Response.new(response)\n end", "def index\n services = accessible_services.includes(:proxy, :account).order(:id).paginate(pagination_params)\n respond_with(services)\n end", "def index\n services = accessible_services.includes(:proxy, :account).order(:id).paginate(pagination_params)\n respond_with(services)\n end", "def interfaces_list\n\t\t[\n\t\t\t{\n\t\t\t\t'uri' => '/',\n\t\t\t\t'method' => 'GET',\n\t\t\t\t'purpose' => 'REST API Structure and Capability Discovery'\n\t\t\t}\n\t\t]\n\tend", "def index\n @loan_servicers = LoanServicer.all\n end", "def endpoints options={}\n service_type = options[:service_type]\n endpoint_type = options[:endpoint_type]\n\n return {}.tap do |rtn|\n catalog = self.catalog['serviceCatalog'] || []\n\n catalog.each do |service|\n next if service_type and service_type != service['type']\n\n rtn[service['type']] = []\n service['endpoints'].each do |endpoint|\n next if endpoint_type and endpoint.include?(endpoint_type)\n rtn[service['type']] << endpoint\n end\n end\n end\n end", "def index\n @service_classes = ServiceClass.all\n end", "def services\n ServiceLocator.service_names.map{|name| \"#{name}_service\".to_sym}\n end", "def index\n @pagos_servicios = PagosServicio.all\n end", "def index\n @therm_resources = ThermResource.all\n end", "def index\n @webhook_endpoints = WebhookEndpoint.all\n end", "def show\n @latest_version = @service.latest_version\n @latest_version_instance = @latest_version.service_versionified\n @latest_deployment = @service.latest_deployment\n\n @all_service_version_instances = @service.service_version_instances\n @all_service_types = @service.service_types\n\n @soaplab_server = @service.soaplab_server\n\n @pending_responsibility_requests = @service.pending_responsibility_requests\n unless is_api_request?\n @service_tests = @service.service_tests\n @test_script_service_tests = @service.service_tests_by_type(\"TestScript\")\n @url_monitor_service_tests = @service.service_tests_by_type(\"UrlMonitor\")\n end\n if @latest_version_instance.is_a?(RestService)\n @grouped_rest_methods = @latest_version_instance.group_all_rest_methods_from_rest_resources\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml # show.xml.builder\n format.json { render :json => @service.to_json }\n end\n end", "def get_endpoint_info(client)\n response = client.get_endpoints()\n logger.info \"this is response for all endpoints #{response.inspect}\"\n if response[0]= 200\n # if api call is sucess \n all_endpoints= response[1][\"objects\"]\n logger.info \"entering parsing \"\n all_endpoints.each do |e|\n logger.info \"looking for a match beetween #{e[\"alias\"]} == #{self.id}\"\n if e[\"alias\"] == self.id.to_s\n #found the endpoint info\n logger.info \"found a match #{e.inspect}\"\n self.sip_endpoint = e\n add_to_phone(e)\n end \n end \n end\n end", "def servers\n Vultr::Resource::Server.new(@faraday)\n end", "def tag_data_endpoints\n TagDataEndpointsController.instance\n end", "def service_list\n @service_list ||= {}\n end", "def index\n @vices = Vice.all\n end", "def init_endpoints\n endpoints = []\n next_token = nil\n all_records_retrieved = false\n\n until all_records_retrieved\n response = @@client.describe_vpc_endpoints({\n next_token: next_token\n })\n next_token = response.next_token\n all_records_retrieved = next_token.nil? || next_token.empty?\n endpoints << response.vpc_endpoints\n end\n\n endpoints.flatten\n end", "def index\n\t@aservices = Aservice.all #@aservices variable de clase\n end", "def index\n #@transports = Transport.all\n @transports = Transport.paginate :page => params[:page], :order => 'id DESC'\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @transports }\n end\n end", "def index\n @hospital = Hospital.find(params[:hospital_id])\n @service_requests = @hospital.service_request.all\n end", "def servers(service_id)\n request :get, \"/services/#{service_id}/servers\"\n end", "def services\n @services ||= []\n end", "def index\n @providerservices = Providerservice.all\n end", "def index\n @tarifas_servicios = TarifasServicio.all\n end", "def index\n @trafficofficers = Trafficofficer.all\n end", "def read_all_policy_service_instances_for_tier1_with_http_info(tier_1_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstanceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_all_policy_service_instances_for_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end" ]
[ "0.68601507", "0.6665762", "0.6428642", "0.63292533", "0.6192408", "0.617035", "0.61239564", "0.6095005", "0.60789734", "0.6036646", "0.60354614", "0.6014171", "0.60001165", "0.59654695", "0.5957459", "0.59418905", "0.5925882", "0.5923631", "0.5904724", "0.58986443", "0.58929133", "0.58929133", "0.587284", "0.58713245", "0.58706015", "0.58667684", "0.58551353", "0.58534074", "0.5837032", "0.5832627", "0.58155966", "0.5797468", "0.5794154", "0.5780623", "0.5730121", "0.5703443", "0.5694803", "0.56942165", "0.5679298", "0.56761307", "0.5654733", "0.563628", "0.56282616", "0.5626725", "0.5616636", "0.56165427", "0.5595572", "0.55718523", "0.55718523", "0.55718523", "0.55718523", "0.55718523", "0.55718523", "0.55718523", "0.55718523", "0.55718523", "0.55689096", "0.5563242", "0.55607384", "0.55522716", "0.55480427", "0.5540193", "0.5540193", "0.5540193", "0.5540193", "0.5539502", "0.5533337", "0.5533266", "0.55300677", "0.55300677", "0.5528612", "0.55276287", "0.55265224", "0.5517065", "0.5504105", "0.5493199", "0.5493199", "0.54893553", "0.54891485", "0.5486634", "0.54802716", "0.5475653", "0.54732937", "0.54686743", "0.5464602", "0.545637", "0.5454559", "0.544904", "0.5448487", "0.54196453", "0.5419206", "0.5415716", "0.54123795", "0.5401578", "0.538675", "0.53849596", "0.5383159", "0.53798723", "0.5375149", "0.5373885", "0.5365384" ]
0.0
-1
List all Tier1 service instance endpoint List all Tier1 service instance endpoint
def list_tier1_policy_service_instance_endpoints_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_policy_service_instance_endpoints_0 ...' end # verify the required parameter 'tier_1_id' is set if @api_client.config.client_side_validation && tier_1_id.nil? fail ArgumentError, "Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_policy_service_instance_endpoints_0" end # verify the required parameter 'locale_service_id' is set if @api_client.config.client_side_validation && locale_service_id.nil? fail ArgumentError, "Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_policy_service_instance_endpoints_0" end # verify the required parameter 'service_instance_id' is set if @api_client.config.client_side_validation && service_instance_id.nil? fail ArgumentError, "Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_policy_service_instance_endpoints_0" end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_policy_service_instance_endpoints_0, must be smaller than or equal to 1000.' end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_policy_service_instance_endpoints_0, must be greater than or equal to 0.' end # resource path local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s) # query parameters query_params = {} query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil? query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil? query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil? query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil? query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ServiceInstanceEndpointListResult') if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#list_tier1_policy_service_instance_endpoints_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def endpoints_list\n get \"endpoints\"\n end", "def index\n endpoint(get(services_url).body)\n end", "def endpoints\n EndpointRegistry[id]\n end", "def endpoints; end", "def index\n @port_services = PortService.all\n end", "def list()\n puts \"Listing all endpoints\"\n load_manifest\n\n pp manifest.keys\n\n end", "def index\n @emt_services = EmtService.all\n end", "def listserv\n listservs.first\n end", "def endpoints\n @endpoints ||= []\n end", "def transaction_endpoints\n TransactionEndpointsController.instance\n end", "def index\n @idti_services = IdtiService.all\n end", "def get_endpoints\n endpoints = call(CMD_GET_ENDPOINTS)[:endpoints]\n endpoints.map {|endpoint| Endpoint.new(endpoint) }\n end", "def endpoints\n @endpoints ||= init_endpoints\n end", "def services\n end", "def service_list\n uri = URI.parse(@url)\n http = Net::HTTP.new(uri.host, uri.port, @proxy_addr, @proxy_port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Get.new(uri.request_uri)\n request.basic_auth user, passwd\n request.add_field 'X-ID-TENANT-NAME', id_domain\n http.request(request)\n end", "def index\n @servicemen = Serviceman.all\n end", "def index\n @servants = Servant.all\n end", "def services\n\n end", "def index\n @serves = Serve.all\n end", "def list_services\n @services\n end", "def service_endpoint; end", "def service_endpoint; end", "def index\n @endpoints = @project.endpoints.all\n end", "def index\n @serviceordemservices = Serviceordemservice.all\n end", "def index\n @request_services = RequestService.all\n end", "def index\n @tb_servicios = TbServicio.all\n end", "def endpoint_types\n %w()\n end", "def services\n\tend", "def inst_list(inst_id)\n uri = URI.parse(@url + '/' + inst_id) \n http = Net::HTTP.new(uri.host, uri.port, @proxy_addr, @proxy_port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Get.new(uri.request_uri)\n request.basic_auth user, passwd\n request.add_field 'X-ID-TENANT-NAME', id_domain\n http.request(request)\n end", "def get_endpoints\n response = @client.rest_get(@data['uri'] + '/endpoints')\n @client.response_handler(response)['members']\n end", "def endpoints\n object.endpoints.map { |e| e.id }\n end", "def index\n @tourist_site_app_services = TouristSiteAppService.all\n end", "def list_endpoints\n render json: @endpoints, status: 200\n end", "def index\n @point_services = PointService.all\n end", "def services\n\t\tService.find(:all)\n\tend", "def public_endpoints\n\t\t\[email protected] {|e| e.public_port_name != nil}\n\t\tend", "def set_endpoints\n @endpoints = Endpoint.where('client_tag like ?', \"%#{params[:client_tag]}%\")\n .where('name like ?', \"%#{params[:request_name]}%\")\n end", "def all\n @service.all\n end", "def index\n @service_requests = ServiceRequest.all\n end", "def registered_services\n ENDPOINT_INSTANCES.keys\n end", "def all(options = {})\n out = xml_run build_command('services', options.merge(:get => XML_COMMANDS_GET))\n convert_output(out.fetch(:stream, {}).fetch(:service_list, {}).fetch(:service, []), :service)\n end", "def index\n @servings = Serving.all\n end", "def get_endpoint()\n end", "def index\n @tech_servs = TechServ.page(params[:page]).per(10)\n end", "def index\n @service_lists = ServiceList.all\n end", "def services(query = {})\n get('service', query)\n end", "def index\n @sevices = Sevice.all\n end", "def index\n @services = Service.all\n end", "def index\n @services = Service.all\n end", "def index\n @services = Service.all\n end", "def index\n @services = Service.all\n end", "def index\n @services = Service.all\n end", "def index\n @services = Service.all\n end", "def index\n @services = Service.all\n end", "def index\n @services = Service.all\n end", "def index\n @services = Service.all\n end", "def index\n @call_services = CallService.all\n end", "def endpoints\n unless @endpoints_collected\n @endpoints += get_missing(\"endpoints\")\n @endpoints_collected = true\n end\n\n @endpoints\n end", "def index\n @invoice_services = InvoiceService.all\n end", "def index\n @service = Service.all()\n end", "def dcerpc_endpoint_list\n\t\tres = []\n\n\t\tprint_status(\"Connecting to the endpoint mapper service...\")\n\t\tbegin\n\t\t\teps = nil\n\t\t\tdport = nil\n\n\t\t\t[135, 593].each do |i|\n\t\t\t\tdport = i\n\t\t\t\tbegin\n\t\t\t\t\teps = Rex::Socket::Tcp.create(\n\t\t\t\t\t'PeerHost' => rhost,\n\t\t\t\t\t'PeerPort' => dport,\n\t\t\t\t\t'Proxies' => proxies,\n\t\t\t\t\t'Context' =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'Msf' => framework,\n\t\t\t\t\t\t\t'MsfExploit' => self,\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\n\t\t\t\t\tbreak\n\n\t\t\t\trescue ::Exception\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tif (not eps)\n\t\t\t\tprint_status(\"Could not connect to the endpoint mapper service\")\n\t\t\t\treturn nil\n\t\t\tend\n\n\t\t\teph = dcerpc_handle('e1af8308-5d1f-11c9-91a4-08002b14a0fa', '3.0', 'ncacn_ip_tcp', [dport])\n\t\t\topt = { 'Msf' => framework, 'MsfExploit' => self }\n\t\t\tdce = Rex::Proto::DCERPC::Client.new(eph, eps, opt)\n\n\t\t\thnd = nil\n\n\t\t\twhile(true)\n\n\t\t\t\t# Placeholders\n\t\t\t\tinfo =\n\t\t\t\t{\n\t\t\t\t\t:type => nil,\n\t\t\t\t\t:port => nil,\n\t\t\t\t\t:host => nil,\n\t\t\t\t\t:pipe => nil,\n\t\t\t\t\t:prot => nil,\n\t\t\t\t\t:uuid => nil,\n\t\t\t\t\t:vers => nil,\n\t\t\t\t\t:note => nil\n\t\t\t\t}\n\n\t\t\t\tdata = nil\n\n\t\t\t\tif(not hnd)\n\t\t\t\t\t# NULL handle to start with\n\t\t\t\t\tdata = [0, 0, 0, 0, 0, 0, 0, 0, 0, 1].pack(\"V*\")\n\t\t\t\telse\n\t\t\t\t\t# Use the existing handle\n\t\t\t\t\tdata = [0, 0, 0, 0, 0].pack(\"V*\") + hnd\n\t\t\t\tend\n\n\t\t\t\tret = dce.call(2, data)\n\n\t\t\t\tif (\n\t\t\t\t\tdce.last_response == nil or\n\t\t\t\t\tdce.last_response.stub_data == nil or\n\t\t\t\t\tdce.last_response.stub_data.length < 40 or\n\t\t\t\t\tdce.last_response.stub_data[36,4] == \"\\xd6\\xa0\\xc9\\x16\"\n\t\t\t\t)\n\t\t\t\t\t# break from the parsing loop\n\t\t\t\t\tbreak\n\t\t\t\tend\n\n\t\t\t\t# Record the response data\n\t\t\t\tbuf = dce.last_response.stub_data\n\n\t\t\t\t# Record the handle if needed\n\t\t\t\thnd = buf[4, 20] if not hnd\n\n\t\t\t\t# Parse the response data\n\t\t\t\tnlen = buf[60, 4].unpack('V')[0]\n\t\t\t\tif (nlen > 1)\n\t\t\t\t\tinfo[:note] = buf[64, nlen - 1]\n\t\t\t\tend\n\n\t\t\t\t# Align the stub offset\n\t\t\t\tsoff = nlen + 72\n\t\t\t\twhile (soff % 4 != 0)\n\t\t\t\t\tsoff += 1\n\t\t\t\tend\n\n\t\t\t\t# Determine number of records\n\t\t\t\trcnt = buf[soff, 2].unpack('v')[0]\n\t\t\t\tsoff += 2\n\n\t\t\t\t# Parse the data from the stack\n\t\t\t\t1.upto(rcnt) do |i|\n\t\t\t\t\trlen = buf[soff, 2].unpack('v')[0]\n\t\t\t\t\tsoff += 2\n\n\t\t\t\t\tif (i == 1)\n\t\t\t\t\t\tinfo[:uuid] = Rex::Proto::DCERPC::UUID.uuid_unpack(buf[soff+1, 16])\n\t\t\t\t\t\tinfo[:vers] = buf[soff+17,2].unpack('CC').map{|s| s.to_s}.join(\".\")\n\t\t\t\t\tend\n\n\t\t\t\t\tif (i > 3)\n\t\t\t\t\t\tinfo[:type] = buf[soff, 1].unpack(\"C*\")[0]\n\t\t\t\t\tend\n\n\t\t\t\t\tsoff += rlen\n\n\t\t\t\t\txlen = buf[soff, 2].unpack('v')[0]\n\t\t\t\t\tsoff += 2\n\n\t\t\t\t\tcase info[:type]\n\t\t\t\t\twhen nil\n\n\t\t\t\t\t# TCP\n\t\t\t\t\twhen 7\n\t\t\t\t\t\tinfo[:prot] = 'tcp'\n\t\t\t\t\t\tinfo[:port] = buf[soff, 2].unpack('n')[0]\n\n\t\t\t\t\t# UDP\n\t\t\t\t\twhen 8\n\t\t\t\t\t\tinfo[:prot] = 'udp'\n\t\t\t\t\t\tinfo[:port] = buf[soff, 2].unpack('n')[0]\n\n\t\t\t\t\t# ADDR\n\t\t\t\t\twhen 9\n\t\t\t\t\t\tinfo[:host] = buf[soff, 4].unpack('C4').join('.')\n\n\t\t\t\t\t# PIPE\n\t\t\t\t\twhen 15\n\t\t\t\t\t\tinfo[:prot] = 'pipe'\n\t\t\t\t\t\tinfo[:pipe] = buf[soff, xlen].unpack(\"a*\")[0]\n\n\t\t\t\t\t# LRPC\n\t\t\t\t\twhen 16\n\t\t\t\t\t\tinfo[:prot] = 'lrpc'\n\t\t\t\t\t\tinfo[:pipe] = buf[soff, xlen].unpack(\"a*\")[0]\n\n\t\t\t\t\t# NETBIOS\n\t\t\t\t\twhen 17,24\n\t\t\t\t\t\tinfo[:host] = buf[soff, xlen].unpack(\"a*\")[0]\n\n\t\t\t\t\t# HTTP\n\t\t\t\t\twhen 31\n\t\t\t\t\t\tinfo[:prot] = 'http'\n\t\t\t\t\t\tinfo[:port] = buf[soff, 2].unpack('n')[0]\n\n\t\t\t\t\t# DYNAMIC?\n\t\t\t\t\twhen 22\n\t\t\t\t\t\t# not parsed\n\t\t\t\t\telse\n\t\t\t\t\t\tprint_status(\"EPM unknown type: #{info[:type]} #{buf[soff, xlen].unpack(\"H*\")[0]}\")\n\t\t\t\t\tend\n\n\t\t\t\t\tsoff += xlen\n\t\t\t\tend\n\n\t\t\t\tinfo[:pipe].gsub!(\"\\x00\", '') if info[:pipe]\n\t\t\t\tinfo[:host].gsub!(\"\\x00\", '') if info[:host]\n\n\t\t\t\tres << info\n\t\t\tend\n\n\t\trescue ::Interrupt\n\t\t\traise $!\n\n\t\trescue ::Exception => e\n\t\t\tprint_status(\"Could not obtain the endpoint list: #{e}\")\n\t\t\tres = nil\n\t\tend\n\n\t\tres\n\tend", "def endpoint; end", "def endpoint; end", "def endpoint; end", "def endpoint; end", "def index\n @service_faults = ServiceFault.all\n end", "def index\n @xservices = Xservice.all\n end", "def index\n @service_tables = ServiceTable.all\n end", "def index\n @ordem_servicos = OrdemServico.all\n end", "def index\n @ordem_servicos = OrdemServico.all\n end", "def servers\n endpoint.config.nodes.map(&:to_s)\n end", "def index\n @service_providers = ServiceProvider.all\n end", "def _endpoint_chain\n chain = []\n node = self\n while node.is_a?(BaseEndpoint)\n chain << node\n node = node.parent\n end\n chain.reverse\n end", "def index\n @servicos = Servico.all\n end", "def list_services\n response = @http_client.get(prefix_path('services'))\n Response.new(response)\n end", "def index\n services = accessible_services.includes(:proxy, :account).order(:id).paginate(pagination_params)\n respond_with(services)\n end", "def index\n services = accessible_services.includes(:proxy, :account).order(:id).paginate(pagination_params)\n respond_with(services)\n end", "def interfaces_list\n\t\t[\n\t\t\t{\n\t\t\t\t'uri' => '/',\n\t\t\t\t'method' => 'GET',\n\t\t\t\t'purpose' => 'REST API Structure and Capability Discovery'\n\t\t\t}\n\t\t]\n\tend", "def index\n @loan_servicers = LoanServicer.all\n end", "def endpoints options={}\n service_type = options[:service_type]\n endpoint_type = options[:endpoint_type]\n\n return {}.tap do |rtn|\n catalog = self.catalog['serviceCatalog'] || []\n\n catalog.each do |service|\n next if service_type and service_type != service['type']\n\n rtn[service['type']] = []\n service['endpoints'].each do |endpoint|\n next if endpoint_type and endpoint.include?(endpoint_type)\n rtn[service['type']] << endpoint\n end\n end\n end\n end", "def index\n @service_classes = ServiceClass.all\n end", "def services\n ServiceLocator.service_names.map{|name| \"#{name}_service\".to_sym}\n end", "def index\n @pagos_servicios = PagosServicio.all\n end", "def index\n @therm_resources = ThermResource.all\n end", "def index\n @webhook_endpoints = WebhookEndpoint.all\n end", "def show\n @latest_version = @service.latest_version\n @latest_version_instance = @latest_version.service_versionified\n @latest_deployment = @service.latest_deployment\n\n @all_service_version_instances = @service.service_version_instances\n @all_service_types = @service.service_types\n\n @soaplab_server = @service.soaplab_server\n\n @pending_responsibility_requests = @service.pending_responsibility_requests\n unless is_api_request?\n @service_tests = @service.service_tests\n @test_script_service_tests = @service.service_tests_by_type(\"TestScript\")\n @url_monitor_service_tests = @service.service_tests_by_type(\"UrlMonitor\")\n end\n if @latest_version_instance.is_a?(RestService)\n @grouped_rest_methods = @latest_version_instance.group_all_rest_methods_from_rest_resources\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml # show.xml.builder\n format.json { render :json => @service.to_json }\n end\n end", "def get_endpoint_info(client)\n response = client.get_endpoints()\n logger.info \"this is response for all endpoints #{response.inspect}\"\n if response[0]= 200\n # if api call is sucess \n all_endpoints= response[1][\"objects\"]\n logger.info \"entering parsing \"\n all_endpoints.each do |e|\n logger.info \"looking for a match beetween #{e[\"alias\"]} == #{self.id}\"\n if e[\"alias\"] == self.id.to_s\n #found the endpoint info\n logger.info \"found a match #{e.inspect}\"\n self.sip_endpoint = e\n add_to_phone(e)\n end \n end \n end\n end", "def tag_data_endpoints\n TagDataEndpointsController.instance\n end", "def servers\n Vultr::Resource::Server.new(@faraday)\n end", "def service_list\n @service_list ||= {}\n end", "def index\n @vices = Vice.all\n end", "def init_endpoints\n endpoints = []\n next_token = nil\n all_records_retrieved = false\n\n until all_records_retrieved\n response = @@client.describe_vpc_endpoints({\n next_token: next_token\n })\n next_token = response.next_token\n all_records_retrieved = next_token.nil? || next_token.empty?\n endpoints << response.vpc_endpoints\n end\n\n endpoints.flatten\n end", "def index\n\t@aservices = Aservice.all #@aservices variable de clase\n end", "def index\n #@transports = Transport.all\n @transports = Transport.paginate :page => params[:page], :order => 'id DESC'\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @transports }\n end\n end", "def index\n @hospital = Hospital.find(params[:hospital_id])\n @service_requests = @hospital.service_request.all\n end", "def servers(service_id)\n request :get, \"/services/#{service_id}/servers\"\n end", "def services\n @services ||= []\n end", "def index\n @providerservices = Providerservice.all\n end", "def index\n @tarifas_servicios = TarifasServicio.all\n end", "def index\n @trafficofficers = Trafficofficer.all\n end", "def read_all_policy_service_instances_for_tier1_with_http_info(tier_1_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstanceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_all_policy_service_instances_for_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end" ]
[ "0.68617404", "0.6665617", "0.64297575", "0.63295543", "0.61919904", "0.61715585", "0.6124001", "0.6094538", "0.60799533", "0.6036918", "0.6034845", "0.6015748", "0.60012597", "0.5964773", "0.595692", "0.59415877", "0.5925453", "0.5922914", "0.59045476", "0.58989143", "0.58921695", "0.58921695", "0.5873431", "0.5871035", "0.58694685", "0.5866193", "0.58563304", "0.5852655", "0.58364594", "0.58341247", "0.5816806", "0.57974696", "0.57951635", "0.5780094", "0.57300264", "0.5704321", "0.5695265", "0.5694041", "0.5678045", "0.5677106", "0.5654513", "0.5635989", "0.56282485", "0.56259036", "0.5616455", "0.56158364", "0.55955595", "0.55712855", "0.55712855", "0.55712855", "0.55712855", "0.55712855", "0.55712855", "0.55712855", "0.55712855", "0.55712855", "0.55677533", "0.5562352", "0.5562305", "0.5551727", "0.55483466", "0.5539808", "0.5539808", "0.5539808", "0.5539808", "0.5539328", "0.55329096", "0.55324423", "0.5529578", "0.5529578", "0.55291015", "0.55285245", "0.5527072", "0.5516443", "0.5504102", "0.5492824", "0.5492824", "0.5491223", "0.54881907", "0.5487372", "0.547985", "0.54759765", "0.5472698", "0.5469483", "0.54649854", "0.5456153", "0.5455445", "0.5449176", "0.5448943", "0.5419375", "0.5419369", "0.541665", "0.5412269", "0.54011625", "0.53857535", "0.5384119", "0.53832406", "0.5379717", "0.5375149", "0.5373882", "0.53639126" ]
0.0
-1
Create Tier1 BYOD service instance Create Tier1 BYOD Service Instance which represents instance of service definition created on manager.
def patch_tier1_byod_policy_service_instance(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts = {}) patch_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts) nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n super(@@service)\n end", "def create_service_instance(name, space_guid, service_plan_id)\n service_plan_instance = CFoundry::V2::ServicePlan.new(service_plan_id, @client)\n service_instance = @client.managed_service_instance\n service_instance.name = name\n service_instance.service_plan = service_plan_instance\n service_instance.space = @client.space(space_guid)\n service_instance.create!\n service_instance\n end", "def new\n @service = Service.new\n end", "def create_service\n # Check signals here to be nice and abort early if possible.\n check_signals!\n # Enable automatically creates the service with Runit.\n directory \"/var/log/#{new_resource.service_name}\" do\n owner 'root'\n group 'root'\n mode '700'\n end\n end", "def create_service\n super.tap do |service_template|\n service_template.cookbook('poise-service')\n create_monit_config\n end\n end", "def create_service(data=nil)\n if (!data.blank? && data.is_a?(Hash))\n @service = Service.create(data)\n else\n @service = Service.create(:name => \"Test Service #{rand(1..1000)}\", :description => \"Test service description.\", :active => true, :probe => \"dummy\", :probe_config => {:value => 1}, :interval => 60, :clean_interval => 86400, :priority => Service::PRIORITY_NORMAL, :resume => :mean_value)\n end\n end", "def service_create(name, display_name, executable_on_host,startup=2)\n\t\tif session_has_services_depend?\n\t\t\tmeterpreter_service_create(name, display_name, executable_on_host,startup)\n\t\telse\n\t\t\tshell_service_create(name, display_name, executable_on_host,startup)\n\t\tend\n\tend", "def create_instance\n create_instances(1).first\n end", "def create\n @service = Service.create(service_params)\n end", "def start_service\n object = DBusObject.new(@main, self)\n service = @bus.request_service(SERVICE)\n service.export object\n end", "def initialize_service_for_create\n @service = service_class.new(hashified_params, service_options)\n end", "def instantiate_service\n @service = ContestService.new\n end", "def create_and_register_service(service_hash)\n # SystemDebug.debug(SystemDebug.services, :attach_ing_create_and_egister_service, service_hash)\n create_and_register_managed_service(service_hash)\n end", "def create\n service = current_account.services.build\n create_service = ServiceCreator.new(service: service)\n create_service.call(service_params.to_h)\n service.reload if service.persisted? # It has been touched\n respond_with(service)\n end", "def new\n @service = Service.new\n\n # If a valid type is received, apply to the host to create.\n check_priority_param\n @service.priority = @priority if([email protected]?)\n\n # Add custom views paths\n prepend_view_path \"app/views/services\"\n prepend_view_path \"lib/probes/#{@service.probe}/views\"\n\n respond_to do |format|\n format.html\n end\n end", "def create\n service = current_account.services.build\n create_service = ServiceCreator.new(service: service)\n create_service.call(service_params)\n service.reload if service.persisted? # It has been touched\n respond_with(service)\n end", "def new_service(service)\n \tOrder.new(\n \t\torderNumber: 37592,\n \t\tservice: service,\n\t\t\torderType: \"установка розетки\",\n\t\t\tnameOrFIO: \"Нибелунг Зигфрид Беовульфыч\",\n\t\t\tstreet: \"бул. Амурский\",\n\t\t\thouse: 10,\n\t\t\tresponsiblePerson: \"Витя Кабан\",\n\t\t\tpersonType: \"Физ лицо\",\n\t\t\tformingDate: \"2013-11-13\")\n end", "def start_service\n DRb.start_service \n @space = Rinda::TupleSpaceProxy.new(DRbObject.new(nil, @uri))\n end", "def get_instance(payload)\n ServiceInstance.new(@version, payload)\n end", "def get_instance(payload)\n ServiceInstance.new(@version, payload)\n end", "def create\n submenu_item 'services-new'\n @service = Service.new(params[:service])\n @service_type = @service.type\n service_param\n\n @service.tenant_id = current_user.tenant_id\n\n # service_params = Service.extract_params(params[:service])\n # service_params = Service.extract_thresholds(service_params)\n # @service = Service.new(service_params)\n\n respond_to do |format|\n if @service.save\n flash[:notice] = \"#{@service.name}创建成功\"\n format.html { redirect_to(@service) }\n else\n dictionary\n format.html { render :action => \"new\" }\n end\n end\n end", "def call\n # Update service and update context\n self.service = Entities::Service.find_by_system_name(remote: threescale_client,\n system_name: service_system_name)\n if service.nil?\n # Create service and update context\n self.service = Entities::Service.create(remote: threescale_client,\n service_params: service_settings)\n logger.info \"Created service id: #{service.id}, name: #{service_name}\"\n else\n service.update(service_settings)\n logger.info \"Updated service id: #{service.id}, name: #{service_name}\"\n end\n\n report['id'] = service.id\n report['system_name'] = service.system_name\n report['name'] = service.name\n report['backend_version'] = api_spec.service_backend_version\n end", "def service\n StockManagementService.new\n end", "def start\n service.pool_action uuid, :create\n end", "def start(klass, *args)\n # Get the hardcore alias.\n hals = \"#{klass}\" + klass.hardcore_alias(*args)\n\n # Has a service already been constructed for this guy? If so, increment\n # its reference count like it aint no thang.\n if (inst = self[hals])\n inst.ref\n return inst\n end\n\n inst = klass.new(*args)\n als = inst.alias\n\n # Find an alias that isn't taken.\n if (self[als])\n cnt = 1\n cnt += 1 while (self[als + \" #{cnt}\"])\n als = inst.alias + \" #{cnt}\"\n end\n\n # Extend the instance as a service.\n inst.extend(Rex::Service)\n\n # Re-aliases the instance.\n inst.alias = als\n\n # Fire up the engines. If an error occurs an exception will be\n # raised.\n inst.start\n\n # Alias associate and initialize reference counting\n self[als] = self[hals] = inst.refinit\n\n # Pass the caller a reference\n inst.ref\n\n inst\n end", "def start_instance\n @instance = Task.find(@task).instances.create\n end", "def create_instance(supervisor)\n Instance.new(supervisor, self, get_instance_id)\n end", "def service(nickname, reserved, distribution, type)\n end", "def create\n @idti_service = IdtiService.new(idti_service_params)\n\n respond_to do |format|\n if @idti_service.save\n format.html { redirect_to @idti_service, notice: 'Idti service was successfully created.' }\n format.json { render :show, status: :created, location: @idti_service }\n else\n format.html { render :new }\n format.json { render json: @idti_service.errors, status: :unprocessable_entity }\n end\n end\n end", "def instantiate_service!(service, request)\n definition = service.kind_of?(Hash) ? service : service_definition_for(service.to_s)\n raise NoSuchService.new(\"Service '#{service}'' does not exist in umlaut-services.yml\") if definition.nil?\n className = definition[\"type\"] || definition[\"service_id\"]\n classConst = Kernel.const_get(className)\n service = classConst.new(definition)\n service.request = request\n return service\n end", "def algolia_new_service\n services = Algolia::Index.new(\"services\")\n res = services.add_object({\"title\" => self.title, \"user_id\" => self.user_id, \"id\" => self.id, \"price\" => self.price, \"due_date\" => self.due_date,\n \"youtube_url\" => self.youtube_url, \"category\" => self.category, \"sub_category\" => self.sub_category, \"description\" => self.description,\n \"refund\" => self.refund, \"status\" => self.status, \"title_seo\" => self.title_seo})\n self.algolia_id = res[\"objectID\"]\n self.save\n end", "def create(name)\n object = new(name)\n @instances.push(object)\n object\n end", "def create\n Puppet.debug \"starting create #{self.class.to_s}\"\n dns_service = get_dns_service(get_fqdn)\n dns_service.create_record(get_fqdn, get_type, get_ip) if dns_service != nil\n Puppet.debug \"done with create #{self.class.to_s}\"\n end", "def new_climate_service\r\n @climate_service = ClimateService.new\r\n end", "def new_climate_service\r\n @climate_service = ClimateService.new\r\n end", "def create_target_mock\n ref = self.service_name.downcase.gsub(/ /, '-')\n create_row = {\n ref: ref,\n display_name: self.service_name,\n type: 'instance',\n iaas_type: 'ec2',\n iaas_properties: {},\n project_id: self.project.id\n }\n Model.create_from_row(self.project.model_handle(:target), create_row, convert: true, ret_obj: { model_name: :target_instance })\n end", "def create_service(opts = {})\n data, _status_code, _headers = create_service_with_http_info(opts)\n data\n end", "def create_instance(credentials, image_id, opts)\n racks = new_client( credentials )\n hwp_id = opts[:hwp_id] || 1\n name = Time.now.to_s\n if (opts[:name]) then name = opts[:name] end\n safely do\n return convert_srv_to_instance(racks.start_server(image_id, hwp_id, name))\n end\n end", "def create_service_by_names(name, space_guid, service_plan_name, service_type_name)\n service = @client.services.select{ |srv| srv.label == service_type_name }\n\n if service != []\n service_plan_id = @client.service_plans_by_service_guid(service.first.guid).each.find { |current_plan| current_plan.name == service_plan_name }.guid\n create_service_instance(name, space_guid, service_plan_id)\n else\n return false\n end\n end", "def instance(*options)\n all_options = @options.merge(options.to_options_hash)\n Rush::ServiceInstance.factory(@name, @box, all_options)\n end", "def create\n req = VCAP::Services::Api::ServiceOfferingRequest.decode(request_body)\n logger.debug(\"Create service request: #{req.extract.inspect}\")\n\n # Should we worry about a race here?\n\n success = nil\n svc = Service.find_by_label(req.label)\n if svc\n raise CloudError.new(CloudError::FORBIDDEN) unless svc.verify_auth_token(@service_auth_token)\n attrs = req.extract.dup\n attrs.delete(:label)\n # Keep DB in sync with configs if the token changes in the config\n attrs[:token] = @service_auth_token if svc.is_builtin?\n svc.update_attributes!(attrs)\n else\n # Service doesn't exist yet. This can only happen for builtin services since service providers must\n # register with us to get a token.\n svc = Service.new(req.extract)\n raise CloudError.new(CloudError::FORBIDDEN) unless svc.is_builtin? && svc.verify_auth_token(@service_auth_token)\n svc.token = @service_auth_token\n svc.save!\n end\n\n render :json => {}\n end", "def generate\n\t\ttemplate('service.tt', \"lib/services/#{name.underscore}_service.rb\")\n\tend", "def create_driver\n parse_service_description\n\n @driver = SOAP::RPC::Driver.new @control_url, @type\n\n mapping_registry = UPnP::SOAPRegistry.new\n\n @actions.each do |name, arguments|\n soapaction = \"#{@type}##{name}\"\n qname = XSD::QName.new @type, name\n\n # TODO map ranges, enumerations\n arguments = arguments.map do |direction, arg_name, variable|\n type, = @variables[variable]\n\n schema_name = XSD::QName.new nil, arg_name\n\n mapping_registry.register :class => type, :schema_name => schema_name\n\n [direction, arg_name, @variables[variable].first]\n end\n\n @driver.proxy.add_rpc_method qname, soapaction, name, arguments\n @driver.send :add_rpc_method_interface, name, arguments\n end\n\n @driver.mapping_registry = mapping_registry\n\n @variables = nil\n end", "def create(name, command, description = nil, options = {})\n defaults = {\n :service_type => Win32::Service::WIN32_OWN_PROCESS,\n :start_type => Win32::Service::AUTO_START,\n :error_control => Win32::Service::ERROR_NORMAL\n }\n defaults.merge!(options)\n name = n(name)\n options = defaults.merge(\n :display_name => name,\n :description => description || name,\n :binary_path_name => command\n )\n Win32::Service.create(name, nil, options)\n end", "def createVehicle _obj, _args\n \"_obj createVehicle _args;\" \n end", "def create_tier1_byod_policy_service_instance_0(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts = {})\n data, _status_code, _headers = create_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts)\n data\n end", "def start_service(*args)\n end", "def run_instance\n Souffle::Log.info \"Single instance runs are not currently implemented...\"\n # system = Souffle::System.from_hash(data)\n # provider = Souffle::Provider.plugin(system.try_opt(:provider)).new\n # system_tag = provider.create_system(system)\n end", "def create_object\n definition.sought_type.new\n end", "def create\n service = current_account.create_service(service_params)\n service.reload if service.persisted? # It has been touched\n respond_with(service)\n end", "def create_service(resource, actions)\n service_name = get_service_name()\n\n case resource.service_type\n when \"upstart\"\n service service_name do\n provider Chef::Provider::Service::Upstart\n supports :status => true, :restart => true, :reload => true\n action actions\n end\n when \"init.d\"\n service service_name do\n supports :status => true, :restart => true, :reload => true\n action actions\n end\n else\n raise \"dashing: Unknown service_type '#{resource.service_type}'\"\n end\nend", "def create_service(name, description)\n response = @client.post(\"/api/v1/services\", { \"name\" => name, \"description\" => description })\n return JSON.parse(response.body)\n end", "def newServiceCorp(corpConf)\n klass = SavServiceCorp.getSubClassByName(corpConf[:class]) ;\n corp = klass.new(@simulator, corpConf) ;\n return corp ;\n end", "def create_tier1_byod_policy_service_instance(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts = {})\n data, _status_code, _headers = create_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts)\n data\n end", "def create_offering(args)\n params = {\n 'command' => 'createServiceOffering',\n 'name' => args[:name],\n 'cpunumber' => args[:cpunumber],\n 'cpuspeed' => args[:cpuspeed],\n 'displaytext' => args[:displaytext],\n 'memory' => args[:memory]\n }\n\n if args['domain']\n params['domainid'] = list_domains(args['domain']).first[\"id\"]\n end\n\n params['tags'] = args[:tags] if args[:tags]\n params['offerha'] = 'true' if args[:ha]\n\n json = send_request(params)\n json['serviceoffering'].first\n end", "def spawn(name)\n if service_list.include?(name)\n VinData::Services.const_get(classify_name(name)).new\n else\n valids = service_list.map(&:inspect).join(\", \")\n raise ConfigurationError, \"Please specify a valid service for VinData \" +\n \"(#{name.inspect} is not one of: #{valids}).\"\n end\n end", "def create\n @emt_service = EmtService.new(emt_service_params)\n\n respond_to do |format|\n if @emt_service.save\n format.html { redirect_to @emt_service, notice: 'Emt service was successfully created.' }\n format.json { render action: 'show', status: :created, location: @emt_service }\n else\n format.html { render action: 'new' }\n format.json { render json: @emt_service.errors, status: :unprocessable_entity }\n end\n end\n end", "def create(label_options)\n create_label File.join(LABEL_URL, 'domestic'), label_options\n end", "def init_service (service_name, service_class)\n\n if service_name\n #\n # if there is a service previously registered under the same name,\n # make sure to stop before it gets 'overriden' in the\n # application context\n\n s = @application_context[service_name]\n s.stop if s.respond_to?(:stop)\n end\n\n s = service_class.new(service_name, @application_context)\n\n unless service_name\n #\n # making sure to register the service. service#new doesn't\n # register when there is no service_name\n\n s.service_name = \"#{service_class.name}::#{s.object_id}\"\n @application_context[s.service_name.to_s] = s\n end\n\n s\n end", "def service\n @service ||= service_class.new(self, assessment: @assessment, submission: @submission)\n end", "def create_worker(id, worker_klasses)\n worker = Service::Worker.new(id: id, supervisor: self, klasses: worker_klasses)\n @workers[id] = worker\n worker\n end", "def run\n super\n opt_port = _get_option \"port\"\n opt_protocol = _get_option \"protocol\"\n _create_network_service_entity(@entity,opt_port,opt_protocol,{})\n end", "def create(id, name: nil, type: :PRODUCTION, labels: nil, clusters: nil)\n end", "def space_service_create(entity, opts = {})\n data, _status_code, _headers = space_service_create_with_http_info(entity, opts)\n return data\n end", "def create\n @service = Service.new(params[:service])\n\n respond_to do |format|\n if @service.save\n format.html { redirect_to(admin_service_path(@service), :notice => 'Service was successfully created.') }\n format.xml { render :xml => @service, :status => :created, :location => @service }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @service.errors, :status => :unprocessable_entity }\n end\n end\n end", "def install\n kit_klass = ServiceKit.const_get self.service_type.capitalize\n kit = kit_klass.new comms, container, host\n kit.configure_service!\n end", "def service(service_name, api_client)\n klazz = service_class(service_name)\n\n # raise an error unless the class inherits from Service\n unless klazz < Core::ServiceLayer::Service\n raise ServiceParentError,\n \"service #{klazz.name} is not a subclass of \\\n Core::ServiceLayer::Service\"\n end\n\n # create an instance of the service class\n klazz.try(:new, api_client)\n end", "def create_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'byod_policy_service_instance' is set\n if @api_client.config.client_side_validation && byod_policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'byod_policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(byod_policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_byod_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @tech_serv = TechServ.new(tech_serv_params)\n\n respond_to do |format|\n if @tech_serv.save\n format.html { redirect_to [:admin, @tech_serv], notice: '技术服务创建成功.' }\n format.json { render action: 'show', status: :created, location: @tech_serv }\n else\n format.html { render action: 'new' }\n format.json { render json: @tech_serv.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @servicetype = Servicetype.new(params[:servicetype])\n\n respond_to do |format|\n if @servicetype.save\n format.html { redirect_to @servicetype, notice: 'Servicetype was successfully created.' }\n format.json { render json: @servicetype, status: :created, location: @servicetype }\n else\n format.html { render action: \"new\" }\n format.json { render json: @servicetype.errors, status: :unprocessable_entity }\n end\n end\n end", "def initialize(name, domain)\n raise Exception.new(\"#{name} is not a valid service name\") unless valid_directory_name(name.to_s)\n \n @name = name\n @booted = false\n @domain = domain\n @full_name = \"#{domain.name}::#{@name}\"\n @path = \"#{SERVICES_PATH}/#{domain.name}/#{@name}\"\n @port_in = $port_start+=1\n @port_out = $port_start+=1\n @status = \"stopped\"\n @runtime = JJRuby.newInstance()\n \n # Create the domain directory if not present\n FileUtils.mkdir_p(@path, :mode => 0755)\n \n # And finally set the meta-data for the service\n @meta_data = ServiceMetaData.new(self)\n ContainerLogger.debug \"Service added #{domain.name}::#{name}\" \n end", "def service; end", "def create\n @admin_service = Admin::Service.new(admin_service_regex_params)\n\n respond_to do |format|\n if @admin_service.save\n format.html { redirect_to @admin_service, notice: 'Platform was successfully created.' }\n format.json { render :show, status: :created, location: @admin_service }\n else\n format.html { render :new }\n format.json { render json: @admin_service.errors, status: :unprocessable_entity }\n end\n end\n end", "def create params\n raise_start_server unless Server::node\n new params\n end", "def create_carrier_service\n puts \" ____________ CREATE CARRIER SERVICE ______\"\n connectApi\n ShopifyAPI::CarrierService.create({\n \"carrier_service\": {\n \"name\": \"Livraison à domicile avec Urbit\",\n \"callback_url\": \"https://conticini-urbit.herokuapp.com/shipping\",\n \"service_discovery\": true\n }\n })\n end", "def create(_instance)\n raise Errors::Backend::NotImplementedError, 'Requested functionality is not implemented'\n end", "def create_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'byod_policy_service_instance' is set\n if @api_client.config.client_side_validation && byod_policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'byod_policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(byod_policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_byod_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @tb_servicio = TbServicio.new(tb_servicio_params)\n\n respond_to do |format|\n if @tb_servicio.save\n format.html { redirect_to @tb_servicio, notice: 'Tb servicio was successfully created.' }\n format.json { render :show, status: :created, location: @tb_servicio }\n else\n format.html { render :new }\n format.json { render json: @tb_servicio.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_service_dir( sname, instance = nil )\n sdir = service_dir( sname, instance )\n mkdir_run_user( sdir )\n end", "def new()\n trace(\"Instance #{index} created\")\n index += 1\n end", "def service_discovery_create_manager(title, configurations:, load_balancer: nil, custom_build_method: nil, interval: 3)\n super\n end", "def newMicroServiceType(name,abbr,style,opmode,min=1,max=1)\n\nend", "def create\n @servicetype = Servicetype.new(params[:servicetype])\n\n respond_to do |format|\n if @servicetype.save\n format.html { redirect_to @servicetype, :notice => 'Servicetype was successfully created.' }\n format.json { render :json => @servicetype, :status => :created, :location => @servicetype }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @servicetype.errors, :status => :unprocessable_entity }\n end\n end\n end", "def service(name)\n name = name.to_sym\n\n service_info = SERVICES[name]\n if service_info.nil?\n raise ArgumentError, sprintf('No service found with name %s', name)\n end\n\n require_path = sprintf(SERVICE_PATH, @path_version,\n service_info.first)\n require require_path\n\n class_path = sprintf(SERVICE_CLASS_PATH, @version, service_info.last)\n return class_for_path(class_path)\n end", "def create\n @taxi_sevice = TaxiSevice.new(taxi_sevice_params)\n\n respond_to do |format|\n if @taxi_sevice.save\n format.html { redirect_to action: \"index\" }\n else\n format.html { render :new }\n format.json { render json: @taxi_sevice.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_instance(credentials, image_id, opts)\n new_vapp = nil\n vapp_opts = {} #assemble options to pass to Fog::Terremark::Real.instantiate_vapp_template\n terremark_hwp = hardware_profiles(credentials, {:name => 'default'}).first #sanity check values against default\n name = opts[:name]\n if not name\n name = \"inst#{Time.now.to_i}\"\n end\n if name.length > USER_NAME_MAX\n raise \"Parameter name must be #{USER_NAME_MAX} characters or less\"\n end\n unless ( (terremark_hwp.include?(:cpu, opts[:hwp_cpu].to_i)) &&\n (terremark_hwp.include?(:memory, opts[:hwp_memory].to_i)) ) then\n raise Deltacloud::Exceptions::ValidationFailure.new(\n StandardError.new(\"Error with cpu and/or memory values. you said cpu->#{opts[:hwp_cpu]} and mem->#{opts[:hwp_memory]}\")\n )\n end\n vapp_opts['cpus'] = opts[:hwp_cpu]\n vapp_opts['memory'] = opts[:hwp_memory]\n safely do\n terremark_client = new_client(credentials)\n#######\n#FIXME# what happens if there is an issue getting the new vapp id? (eg even though created succesfully)\n#######\n vapp_id = terremark_client.instantiate_vapp_template(name, image_id, vapp_opts).body['href'].split('/').last\n new_vapp = terremark_client.get_vapp(vapp_id)\n return convert_instance(new_vapp, terremark_client, credentials.user) #return an Instance object\n end\n end", "def start\n create('start')\n end", "def create\n @one_time_stop = OneTimeStop.new(params[:one_time_stop])\n\n respond_to do |format|\n if @one_time_stop.save\n format.html { redirect_to @one_time_stop, notice: 'One time stop was successfully created.' }\n format.json { render json: @one_time_stop, status: :created, location: @one_time_stop }\n else\n format.html { render action: \"new\" }\n format.json { render json: @one_time_stop.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n begin\n enterMaintenanceMode\n rescue\n Puppet.err 'Could not find Host system.Either Host is not exist or disconnected'\n end\n end", "def create\n @recreation_service_typology = RecreationServiceTypology.new(recreation_service_typology_params)\n\n respond_to do |format|\n if @recreation_service_typology.save\n format.html { redirect_to @recreation_service_typology, notice: 'Recreation service typology was successfully created.' }\n format.json { render action: 'show', status: :created, location: @recreation_service_typology }\n else\n format.html { render action: 'new' }\n format.json { render json: @recreation_service_typology.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n Puppet.debug \"starting create #{self.class.to_s}\"\n dns_service = get_dns_service(get_zone)\n dns_service.create_zone(get_zone, get_email, get_ttl) if dns_service != nil\n Puppet.debug \"done with create #{self.class.to_s}\"\n end", "def initialize(type, id = nil)\n client = OpenNebula::Client.new\n\n @type = type\n\n case type\n when 'Cluster'\n if !id\n xml = OpenNebula::Cluster.build_xml\n\n @one = OpenNebula::Cluster.new(xml, client)\n else\n @one = OpenNebula::Cluster.new_with_id(id, client)\n @one.info\n end\n\n @pool = OpenNebula::ClusterPool.new(client)\n when 'Datastore'\n xml = OpenNebula::Datastore.build_xml\n\n @one = OpenNebula::Datastore.new(xml, client)\n @pool = OpenNebula::DatastorePool.new(client)\n when 'Host'\n if !id\n xml = OpenNebula::Host.build_xml\n\n @one = OpenNebula::Host.new(xml, client)\n else\n @one = OpenNebula::Host.new_with_id(id, client)\n @one.info\n end\n\n @pool = OpenNebula::HostPool.new(client)\n when 'Vnet'\n xml = OpenNebula::VirtualNetwork.build_xml\n\n @one = OpenNebula::VirtualNetwork.new(xml, client)\n @pool = OpenNebula::VirtualNetworkPool.new(client)\n end\n end", "def create(cluster_id)\n # create ONE object\n new_object\n\n rc = @one.allocate(format_template(@p_template), cluster_id)\n Utils.exception(rc)\n rc = @one.info\n Utils.exception(rc)\n\n OneProvisionLogger.debug(\n \"#{@type} created with ID: #{@one.id}\"\n )\n\n Integer(@one.id)\n end", "def create\n @serviceordemservice = Serviceordemservice.new(serviceordemservice_params)\n\n respond_to do |format|\n if @serviceordemservice.save\n format.html { redirect_to @serviceordemservice, notice: 'Serviceordemservice was successfully created.' }\n format.json { render :show, status: :created, location: @serviceordemservice }\n else\n format.html { render :new }\n format.json { render json: @serviceordemservice.errors, status: :unprocessable_entity }\n end\n end\n end", "def breakers_service\n return @service if defined?(@service)\n\n @service = create_new_breakers_service(breakers_matcher, breakers_exception_handler)\n end", "def create_instance request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_create_instance_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "def create!\n EC2.clone_interface!(instance.eth0, description)\n tag!\n puts \"Created secondary ENI (#{interface.id})\"\n end", "def create_service_line\n @service_line = ServicePaymentEob.new(:details=>{:date_of_service_from_ocr_output=>\"\"})\n @insurance_payment_eob.service_payment_eobs << @service_line\n @service_line.save(:validate => false)\n return @service_line\n end", "def create(state)\n info(\"Creating instance #{instance.name}\")\n return if state[:server_id]\n\n domain = create_domain\n state[:server_id] = domain.id\n state[:hostname] = domain.public_ip_address\n\n instance.transport.connection(state).wait_until_ready\n\n info(\"Libvirt instance #{domain.name} created.\")\n end", "def create\n\t type = @params[0].split('.')\n\n\t if type[1]\n\n\t if @params[1]\n\t FileUtils.touch(@params[1]+'/'+@params[0])\n\t else\n\t FileUtils.touch(@params[0])\n\t end\n\t else\n\t if @params[1]\n\t FileUtils::mkdir_p @params[1]+'/'+@params[0]\n\t else\n\t FileUtils::mkdir_p @params[0]\n\t end\n\t end\n\t end", "def create\n @service = @page.services.new(params[:service])\n @service.user = current_user\n \n respond_to do |format|\n if @service.save\n format.html { redirect_to service_url(@page, @service), notice: 'Service was successfully created.' }\n format.json { render json: @service, status: :created, location: @service }\n else\n format.html { render action: \"new\" }\n format.json { render json: @service.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.641914", "0.6407304", "0.6389548", "0.6346785", "0.6294748", "0.61593324", "0.61350405", "0.6092666", "0.59620816", "0.59549654", "0.59512955", "0.58955264", "0.5891125", "0.5820004", "0.5810055", "0.5797039", "0.5743813", "0.5697255", "0.56704134", "0.56704134", "0.5629569", "0.5612746", "0.56121606", "0.56120867", "0.5595422", "0.55819863", "0.55755013", "0.55701065", "0.55624324", "0.55542654", "0.5537579", "0.55084676", "0.5495219", "0.54913", "0.54913", "0.5490814", "0.54750454", "0.54549557", "0.5440482", "0.5439391", "0.5430212", "0.5415133", "0.5410624", "0.5402255", "0.5380744", "0.5366225", "0.535935", "0.53530693", "0.53511786", "0.5345302", "0.533997", "0.5328324", "0.53178746", "0.5311674", "0.52930325", "0.5288225", "0.5283257", "0.528082", "0.5262429", "0.5253497", "0.5245681", "0.52310055", "0.5228137", "0.52224237", "0.5215437", "0.52091545", "0.520895", "0.51980376", "0.51920193", "0.5190951", "0.5190638", "0.51883286", "0.5188144", "0.5182421", "0.5165025", "0.5163688", "0.5161954", "0.5160869", "0.5158865", "0.51545465", "0.5152052", "0.51477647", "0.5147616", "0.5143291", "0.5136405", "0.51352715", "0.5131386", "0.51279503", "0.5124642", "0.5121808", "0.5115205", "0.5110818", "0.5109843", "0.5103604", "0.5098826", "0.50881654", "0.5080306", "0.50665027", "0.50653607", "0.5064723", "0.5062799" ]
0.0
-1
Create Tier1 BYOD service instance Create Tier1 BYOD Service Instance which represents instance of service definition created on manager.
def patch_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_byod_policy_service_instance ...' end # verify the required parameter 'tier_1_id' is set if @api_client.config.client_side_validation && tier_1_id.nil? fail ArgumentError, "Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_byod_policy_service_instance" end # verify the required parameter 'locale_service_id' is set if @api_client.config.client_side_validation && locale_service_id.nil? fail ArgumentError, "Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_byod_policy_service_instance" end # verify the required parameter 'service_instance_id' is set if @api_client.config.client_side_validation && service_instance_id.nil? fail ArgumentError, "Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_byod_policy_service_instance" end # verify the required parameter 'byod_policy_service_instance' is set if @api_client.config.client_side_validation && byod_policy_service_instance.nil? fail ArgumentError, "Missing the required parameter 'byod_policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_byod_policy_service_instance" end # resource path local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(byod_policy_service_instance) auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#patch_tier1_byod_policy_service_instance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n super(@@service)\n end", "def create_service_instance(name, space_guid, service_plan_id)\n service_plan_instance = CFoundry::V2::ServicePlan.new(service_plan_id, @client)\n service_instance = @client.managed_service_instance\n service_instance.name = name\n service_instance.service_plan = service_plan_instance\n service_instance.space = @client.space(space_guid)\n service_instance.create!\n service_instance\n end", "def new\n @service = Service.new\n end", "def create_service\n # Check signals here to be nice and abort early if possible.\n check_signals!\n # Enable automatically creates the service with Runit.\n directory \"/var/log/#{new_resource.service_name}\" do\n owner 'root'\n group 'root'\n mode '700'\n end\n end", "def create_service\n super.tap do |service_template|\n service_template.cookbook('poise-service')\n create_monit_config\n end\n end", "def create_service(data=nil)\n if (!data.blank? && data.is_a?(Hash))\n @service = Service.create(data)\n else\n @service = Service.create(:name => \"Test Service #{rand(1..1000)}\", :description => \"Test service description.\", :active => true, :probe => \"dummy\", :probe_config => {:value => 1}, :interval => 60, :clean_interval => 86400, :priority => Service::PRIORITY_NORMAL, :resume => :mean_value)\n end\n end", "def service_create(name, display_name, executable_on_host,startup=2)\n\t\tif session_has_services_depend?\n\t\t\tmeterpreter_service_create(name, display_name, executable_on_host,startup)\n\t\telse\n\t\t\tshell_service_create(name, display_name, executable_on_host,startup)\n\t\tend\n\tend", "def create_instance\n create_instances(1).first\n end", "def create\n @service = Service.create(service_params)\n end", "def start_service\n object = DBusObject.new(@main, self)\n service = @bus.request_service(SERVICE)\n service.export object\n end", "def initialize_service_for_create\n @service = service_class.new(hashified_params, service_options)\n end", "def instantiate_service\n @service = ContestService.new\n end", "def create_and_register_service(service_hash)\n # SystemDebug.debug(SystemDebug.services, :attach_ing_create_and_egister_service, service_hash)\n create_and_register_managed_service(service_hash)\n end", "def create\n service = current_account.services.build\n create_service = ServiceCreator.new(service: service)\n create_service.call(service_params.to_h)\n service.reload if service.persisted? # It has been touched\n respond_with(service)\n end", "def new\n @service = Service.new\n\n # If a valid type is received, apply to the host to create.\n check_priority_param\n @service.priority = @priority if([email protected]?)\n\n # Add custom views paths\n prepend_view_path \"app/views/services\"\n prepend_view_path \"lib/probes/#{@service.probe}/views\"\n\n respond_to do |format|\n format.html\n end\n end", "def create\n service = current_account.services.build\n create_service = ServiceCreator.new(service: service)\n create_service.call(service_params)\n service.reload if service.persisted? # It has been touched\n respond_with(service)\n end", "def new_service(service)\n \tOrder.new(\n \t\torderNumber: 37592,\n \t\tservice: service,\n\t\t\torderType: \"установка розетки\",\n\t\t\tnameOrFIO: \"Нибелунг Зигфрид Беовульфыч\",\n\t\t\tstreet: \"бул. Амурский\",\n\t\t\thouse: 10,\n\t\t\tresponsiblePerson: \"Витя Кабан\",\n\t\t\tpersonType: \"Физ лицо\",\n\t\t\tformingDate: \"2013-11-13\")\n end", "def start_service\n DRb.start_service \n @space = Rinda::TupleSpaceProxy.new(DRbObject.new(nil, @uri))\n end", "def get_instance(payload)\n ServiceInstance.new(@version, payload)\n end", "def get_instance(payload)\n ServiceInstance.new(@version, payload)\n end", "def create\n submenu_item 'services-new'\n @service = Service.new(params[:service])\n @service_type = @service.type\n service_param\n\n @service.tenant_id = current_user.tenant_id\n\n # service_params = Service.extract_params(params[:service])\n # service_params = Service.extract_thresholds(service_params)\n # @service = Service.new(service_params)\n\n respond_to do |format|\n if @service.save\n flash[:notice] = \"#{@service.name}创建成功\"\n format.html { redirect_to(@service) }\n else\n dictionary\n format.html { render :action => \"new\" }\n end\n end\n end", "def call\n # Update service and update context\n self.service = Entities::Service.find_by_system_name(remote: threescale_client,\n system_name: service_system_name)\n if service.nil?\n # Create service and update context\n self.service = Entities::Service.create(remote: threescale_client,\n service_params: service_settings)\n logger.info \"Created service id: #{service.id}, name: #{service_name}\"\n else\n service.update(service_settings)\n logger.info \"Updated service id: #{service.id}, name: #{service_name}\"\n end\n\n report['id'] = service.id\n report['system_name'] = service.system_name\n report['name'] = service.name\n report['backend_version'] = api_spec.service_backend_version\n end", "def service\n StockManagementService.new\n end", "def start\n service.pool_action uuid, :create\n end", "def start(klass, *args)\n # Get the hardcore alias.\n hals = \"#{klass}\" + klass.hardcore_alias(*args)\n\n # Has a service already been constructed for this guy? If so, increment\n # its reference count like it aint no thang.\n if (inst = self[hals])\n inst.ref\n return inst\n end\n\n inst = klass.new(*args)\n als = inst.alias\n\n # Find an alias that isn't taken.\n if (self[als])\n cnt = 1\n cnt += 1 while (self[als + \" #{cnt}\"])\n als = inst.alias + \" #{cnt}\"\n end\n\n # Extend the instance as a service.\n inst.extend(Rex::Service)\n\n # Re-aliases the instance.\n inst.alias = als\n\n # Fire up the engines. If an error occurs an exception will be\n # raised.\n inst.start\n\n # Alias associate and initialize reference counting\n self[als] = self[hals] = inst.refinit\n\n # Pass the caller a reference\n inst.ref\n\n inst\n end", "def start_instance\n @instance = Task.find(@task).instances.create\n end", "def create_instance(supervisor)\n Instance.new(supervisor, self, get_instance_id)\n end", "def service(nickname, reserved, distribution, type)\n end", "def create\n @idti_service = IdtiService.new(idti_service_params)\n\n respond_to do |format|\n if @idti_service.save\n format.html { redirect_to @idti_service, notice: 'Idti service was successfully created.' }\n format.json { render :show, status: :created, location: @idti_service }\n else\n format.html { render :new }\n format.json { render json: @idti_service.errors, status: :unprocessable_entity }\n end\n end\n end", "def instantiate_service!(service, request)\n definition = service.kind_of?(Hash) ? service : service_definition_for(service.to_s)\n raise NoSuchService.new(\"Service '#{service}'' does not exist in umlaut-services.yml\") if definition.nil?\n className = definition[\"type\"] || definition[\"service_id\"]\n classConst = Kernel.const_get(className)\n service = classConst.new(definition)\n service.request = request\n return service\n end", "def algolia_new_service\n services = Algolia::Index.new(\"services\")\n res = services.add_object({\"title\" => self.title, \"user_id\" => self.user_id, \"id\" => self.id, \"price\" => self.price, \"due_date\" => self.due_date,\n \"youtube_url\" => self.youtube_url, \"category\" => self.category, \"sub_category\" => self.sub_category, \"description\" => self.description,\n \"refund\" => self.refund, \"status\" => self.status, \"title_seo\" => self.title_seo})\n self.algolia_id = res[\"objectID\"]\n self.save\n end", "def create(name)\n object = new(name)\n @instances.push(object)\n object\n end", "def create\n Puppet.debug \"starting create #{self.class.to_s}\"\n dns_service = get_dns_service(get_fqdn)\n dns_service.create_record(get_fqdn, get_type, get_ip) if dns_service != nil\n Puppet.debug \"done with create #{self.class.to_s}\"\n end", "def new_climate_service\r\n @climate_service = ClimateService.new\r\n end", "def new_climate_service\r\n @climate_service = ClimateService.new\r\n end", "def create_target_mock\n ref = self.service_name.downcase.gsub(/ /, '-')\n create_row = {\n ref: ref,\n display_name: self.service_name,\n type: 'instance',\n iaas_type: 'ec2',\n iaas_properties: {},\n project_id: self.project.id\n }\n Model.create_from_row(self.project.model_handle(:target), create_row, convert: true, ret_obj: { model_name: :target_instance })\n end", "def create_service(opts = {})\n data, _status_code, _headers = create_service_with_http_info(opts)\n data\n end", "def create_instance(credentials, image_id, opts)\n racks = new_client( credentials )\n hwp_id = opts[:hwp_id] || 1\n name = Time.now.to_s\n if (opts[:name]) then name = opts[:name] end\n safely do\n return convert_srv_to_instance(racks.start_server(image_id, hwp_id, name))\n end\n end", "def create_service_by_names(name, space_guid, service_plan_name, service_type_name)\n service = @client.services.select{ |srv| srv.label == service_type_name }\n\n if service != []\n service_plan_id = @client.service_plans_by_service_guid(service.first.guid).each.find { |current_plan| current_plan.name == service_plan_name }.guid\n create_service_instance(name, space_guid, service_plan_id)\n else\n return false\n end\n end", "def instance(*options)\n all_options = @options.merge(options.to_options_hash)\n Rush::ServiceInstance.factory(@name, @box, all_options)\n end", "def create\n req = VCAP::Services::Api::ServiceOfferingRequest.decode(request_body)\n logger.debug(\"Create service request: #{req.extract.inspect}\")\n\n # Should we worry about a race here?\n\n success = nil\n svc = Service.find_by_label(req.label)\n if svc\n raise CloudError.new(CloudError::FORBIDDEN) unless svc.verify_auth_token(@service_auth_token)\n attrs = req.extract.dup\n attrs.delete(:label)\n # Keep DB in sync with configs if the token changes in the config\n attrs[:token] = @service_auth_token if svc.is_builtin?\n svc.update_attributes!(attrs)\n else\n # Service doesn't exist yet. This can only happen for builtin services since service providers must\n # register with us to get a token.\n svc = Service.new(req.extract)\n raise CloudError.new(CloudError::FORBIDDEN) unless svc.is_builtin? && svc.verify_auth_token(@service_auth_token)\n svc.token = @service_auth_token\n svc.save!\n end\n\n render :json => {}\n end", "def generate\n\t\ttemplate('service.tt', \"lib/services/#{name.underscore}_service.rb\")\n\tend", "def create_driver\n parse_service_description\n\n @driver = SOAP::RPC::Driver.new @control_url, @type\n\n mapping_registry = UPnP::SOAPRegistry.new\n\n @actions.each do |name, arguments|\n soapaction = \"#{@type}##{name}\"\n qname = XSD::QName.new @type, name\n\n # TODO map ranges, enumerations\n arguments = arguments.map do |direction, arg_name, variable|\n type, = @variables[variable]\n\n schema_name = XSD::QName.new nil, arg_name\n\n mapping_registry.register :class => type, :schema_name => schema_name\n\n [direction, arg_name, @variables[variable].first]\n end\n\n @driver.proxy.add_rpc_method qname, soapaction, name, arguments\n @driver.send :add_rpc_method_interface, name, arguments\n end\n\n @driver.mapping_registry = mapping_registry\n\n @variables = nil\n end", "def create(name, command, description = nil, options = {})\n defaults = {\n :service_type => Win32::Service::WIN32_OWN_PROCESS,\n :start_type => Win32::Service::AUTO_START,\n :error_control => Win32::Service::ERROR_NORMAL\n }\n defaults.merge!(options)\n name = n(name)\n options = defaults.merge(\n :display_name => name,\n :description => description || name,\n :binary_path_name => command\n )\n Win32::Service.create(name, nil, options)\n end", "def createVehicle _obj, _args\n \"_obj createVehicle _args;\" \n end", "def create_tier1_byod_policy_service_instance_0(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts = {})\n data, _status_code, _headers = create_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts)\n data\n end", "def start_service(*args)\n end", "def run_instance\n Souffle::Log.info \"Single instance runs are not currently implemented...\"\n # system = Souffle::System.from_hash(data)\n # provider = Souffle::Provider.plugin(system.try_opt(:provider)).new\n # system_tag = provider.create_system(system)\n end", "def create_object\n definition.sought_type.new\n end", "def create\n service = current_account.create_service(service_params)\n service.reload if service.persisted? # It has been touched\n respond_with(service)\n end", "def create_service(resource, actions)\n service_name = get_service_name()\n\n case resource.service_type\n when \"upstart\"\n service service_name do\n provider Chef::Provider::Service::Upstart\n supports :status => true, :restart => true, :reload => true\n action actions\n end\n when \"init.d\"\n service service_name do\n supports :status => true, :restart => true, :reload => true\n action actions\n end\n else\n raise \"dashing: Unknown service_type '#{resource.service_type}'\"\n end\nend", "def create_service(name, description)\n response = @client.post(\"/api/v1/services\", { \"name\" => name, \"description\" => description })\n return JSON.parse(response.body)\n end", "def newServiceCorp(corpConf)\n klass = SavServiceCorp.getSubClassByName(corpConf[:class]) ;\n corp = klass.new(@simulator, corpConf) ;\n return corp ;\n end", "def create_tier1_byod_policy_service_instance(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts = {})\n data, _status_code, _headers = create_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts)\n data\n end", "def create_offering(args)\n params = {\n 'command' => 'createServiceOffering',\n 'name' => args[:name],\n 'cpunumber' => args[:cpunumber],\n 'cpuspeed' => args[:cpuspeed],\n 'displaytext' => args[:displaytext],\n 'memory' => args[:memory]\n }\n\n if args['domain']\n params['domainid'] = list_domains(args['domain']).first[\"id\"]\n end\n\n params['tags'] = args[:tags] if args[:tags]\n params['offerha'] = 'true' if args[:ha]\n\n json = send_request(params)\n json['serviceoffering'].first\n end", "def spawn(name)\n if service_list.include?(name)\n VinData::Services.const_get(classify_name(name)).new\n else\n valids = service_list.map(&:inspect).join(\", \")\n raise ConfigurationError, \"Please specify a valid service for VinData \" +\n \"(#{name.inspect} is not one of: #{valids}).\"\n end\n end", "def create\n @emt_service = EmtService.new(emt_service_params)\n\n respond_to do |format|\n if @emt_service.save\n format.html { redirect_to @emt_service, notice: 'Emt service was successfully created.' }\n format.json { render action: 'show', status: :created, location: @emt_service }\n else\n format.html { render action: 'new' }\n format.json { render json: @emt_service.errors, status: :unprocessable_entity }\n end\n end\n end", "def create(label_options)\n create_label File.join(LABEL_URL, 'domestic'), label_options\n end", "def init_service (service_name, service_class)\n\n if service_name\n #\n # if there is a service previously registered under the same name,\n # make sure to stop before it gets 'overriden' in the\n # application context\n\n s = @application_context[service_name]\n s.stop if s.respond_to?(:stop)\n end\n\n s = service_class.new(service_name, @application_context)\n\n unless service_name\n #\n # making sure to register the service. service#new doesn't\n # register when there is no service_name\n\n s.service_name = \"#{service_class.name}::#{s.object_id}\"\n @application_context[s.service_name.to_s] = s\n end\n\n s\n end", "def service\n @service ||= service_class.new(self, assessment: @assessment, submission: @submission)\n end", "def create_worker(id, worker_klasses)\n worker = Service::Worker.new(id: id, supervisor: self, klasses: worker_klasses)\n @workers[id] = worker\n worker\n end", "def run\n super\n opt_port = _get_option \"port\"\n opt_protocol = _get_option \"protocol\"\n _create_network_service_entity(@entity,opt_port,opt_protocol,{})\n end", "def create(id, name: nil, type: :PRODUCTION, labels: nil, clusters: nil)\n end", "def space_service_create(entity, opts = {})\n data, _status_code, _headers = space_service_create_with_http_info(entity, opts)\n return data\n end", "def create\n @service = Service.new(params[:service])\n\n respond_to do |format|\n if @service.save\n format.html { redirect_to(admin_service_path(@service), :notice => 'Service was successfully created.') }\n format.xml { render :xml => @service, :status => :created, :location => @service }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @service.errors, :status => :unprocessable_entity }\n end\n end\n end", "def install\n kit_klass = ServiceKit.const_get self.service_type.capitalize\n kit = kit_klass.new comms, container, host\n kit.configure_service!\n end", "def service(service_name, api_client)\n klazz = service_class(service_name)\n\n # raise an error unless the class inherits from Service\n unless klazz < Core::ServiceLayer::Service\n raise ServiceParentError,\n \"service #{klazz.name} is not a subclass of \\\n Core::ServiceLayer::Service\"\n end\n\n # create an instance of the service class\n klazz.try(:new, api_client)\n end", "def create_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'byod_policy_service_instance' is set\n if @api_client.config.client_side_validation && byod_policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'byod_policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(byod_policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_byod_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @tech_serv = TechServ.new(tech_serv_params)\n\n respond_to do |format|\n if @tech_serv.save\n format.html { redirect_to [:admin, @tech_serv], notice: '技术服务创建成功.' }\n format.json { render action: 'show', status: :created, location: @tech_serv }\n else\n format.html { render action: 'new' }\n format.json { render json: @tech_serv.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @servicetype = Servicetype.new(params[:servicetype])\n\n respond_to do |format|\n if @servicetype.save\n format.html { redirect_to @servicetype, notice: 'Servicetype was successfully created.' }\n format.json { render json: @servicetype, status: :created, location: @servicetype }\n else\n format.html { render action: \"new\" }\n format.json { render json: @servicetype.errors, status: :unprocessable_entity }\n end\n end\n end", "def initialize(name, domain)\n raise Exception.new(\"#{name} is not a valid service name\") unless valid_directory_name(name.to_s)\n \n @name = name\n @booted = false\n @domain = domain\n @full_name = \"#{domain.name}::#{@name}\"\n @path = \"#{SERVICES_PATH}/#{domain.name}/#{@name}\"\n @port_in = $port_start+=1\n @port_out = $port_start+=1\n @status = \"stopped\"\n @runtime = JJRuby.newInstance()\n \n # Create the domain directory if not present\n FileUtils.mkdir_p(@path, :mode => 0755)\n \n # And finally set the meta-data for the service\n @meta_data = ServiceMetaData.new(self)\n ContainerLogger.debug \"Service added #{domain.name}::#{name}\" \n end", "def service; end", "def create\n @admin_service = Admin::Service.new(admin_service_regex_params)\n\n respond_to do |format|\n if @admin_service.save\n format.html { redirect_to @admin_service, notice: 'Platform was successfully created.' }\n format.json { render :show, status: :created, location: @admin_service }\n else\n format.html { render :new }\n format.json { render json: @admin_service.errors, status: :unprocessable_entity }\n end\n end\n end", "def create params\n raise_start_server unless Server::node\n new params\n end", "def create_carrier_service\n puts \" ____________ CREATE CARRIER SERVICE ______\"\n connectApi\n ShopifyAPI::CarrierService.create({\n \"carrier_service\": {\n \"name\": \"Livraison à domicile avec Urbit\",\n \"callback_url\": \"https://conticini-urbit.herokuapp.com/shipping\",\n \"service_discovery\": true\n }\n })\n end", "def create(_instance)\n raise Errors::Backend::NotImplementedError, 'Requested functionality is not implemented'\n end", "def create_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'byod_policy_service_instance' is set\n if @api_client.config.client_side_validation && byod_policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'byod_policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(byod_policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_byod_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @tb_servicio = TbServicio.new(tb_servicio_params)\n\n respond_to do |format|\n if @tb_servicio.save\n format.html { redirect_to @tb_servicio, notice: 'Tb servicio was successfully created.' }\n format.json { render :show, status: :created, location: @tb_servicio }\n else\n format.html { render :new }\n format.json { render json: @tb_servicio.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_service_dir( sname, instance = nil )\n sdir = service_dir( sname, instance )\n mkdir_run_user( sdir )\n end", "def new()\n trace(\"Instance #{index} created\")\n index += 1\n end", "def service_discovery_create_manager(title, configurations:, load_balancer: nil, custom_build_method: nil, interval: 3)\n super\n end", "def newMicroServiceType(name,abbr,style,opmode,min=1,max=1)\n\nend", "def create\n @servicetype = Servicetype.new(params[:servicetype])\n\n respond_to do |format|\n if @servicetype.save\n format.html { redirect_to @servicetype, :notice => 'Servicetype was successfully created.' }\n format.json { render :json => @servicetype, :status => :created, :location => @servicetype }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @servicetype.errors, :status => :unprocessable_entity }\n end\n end\n end", "def service(name)\n name = name.to_sym\n\n service_info = SERVICES[name]\n if service_info.nil?\n raise ArgumentError, sprintf('No service found with name %s', name)\n end\n\n require_path = sprintf(SERVICE_PATH, @path_version,\n service_info.first)\n require require_path\n\n class_path = sprintf(SERVICE_CLASS_PATH, @version, service_info.last)\n return class_for_path(class_path)\n end", "def create\n @taxi_sevice = TaxiSevice.new(taxi_sevice_params)\n\n respond_to do |format|\n if @taxi_sevice.save\n format.html { redirect_to action: \"index\" }\n else\n format.html { render :new }\n format.json { render json: @taxi_sevice.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_instance(credentials, image_id, opts)\n new_vapp = nil\n vapp_opts = {} #assemble options to pass to Fog::Terremark::Real.instantiate_vapp_template\n terremark_hwp = hardware_profiles(credentials, {:name => 'default'}).first #sanity check values against default\n name = opts[:name]\n if not name\n name = \"inst#{Time.now.to_i}\"\n end\n if name.length > USER_NAME_MAX\n raise \"Parameter name must be #{USER_NAME_MAX} characters or less\"\n end\n unless ( (terremark_hwp.include?(:cpu, opts[:hwp_cpu].to_i)) &&\n (terremark_hwp.include?(:memory, opts[:hwp_memory].to_i)) ) then\n raise Deltacloud::Exceptions::ValidationFailure.new(\n StandardError.new(\"Error with cpu and/or memory values. you said cpu->#{opts[:hwp_cpu]} and mem->#{opts[:hwp_memory]}\")\n )\n end\n vapp_opts['cpus'] = opts[:hwp_cpu]\n vapp_opts['memory'] = opts[:hwp_memory]\n safely do\n terremark_client = new_client(credentials)\n#######\n#FIXME# what happens if there is an issue getting the new vapp id? (eg even though created succesfully)\n#######\n vapp_id = terremark_client.instantiate_vapp_template(name, image_id, vapp_opts).body['href'].split('/').last\n new_vapp = terremark_client.get_vapp(vapp_id)\n return convert_instance(new_vapp, terremark_client, credentials.user) #return an Instance object\n end\n end", "def start\n create('start')\n end", "def create\n @one_time_stop = OneTimeStop.new(params[:one_time_stop])\n\n respond_to do |format|\n if @one_time_stop.save\n format.html { redirect_to @one_time_stop, notice: 'One time stop was successfully created.' }\n format.json { render json: @one_time_stop, status: :created, location: @one_time_stop }\n else\n format.html { render action: \"new\" }\n format.json { render json: @one_time_stop.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n begin\n enterMaintenanceMode\n rescue\n Puppet.err 'Could not find Host system.Either Host is not exist or disconnected'\n end\n end", "def create\n @recreation_service_typology = RecreationServiceTypology.new(recreation_service_typology_params)\n\n respond_to do |format|\n if @recreation_service_typology.save\n format.html { redirect_to @recreation_service_typology, notice: 'Recreation service typology was successfully created.' }\n format.json { render action: 'show', status: :created, location: @recreation_service_typology }\n else\n format.html { render action: 'new' }\n format.json { render json: @recreation_service_typology.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n Puppet.debug \"starting create #{self.class.to_s}\"\n dns_service = get_dns_service(get_zone)\n dns_service.create_zone(get_zone, get_email, get_ttl) if dns_service != nil\n Puppet.debug \"done with create #{self.class.to_s}\"\n end", "def initialize(type, id = nil)\n client = OpenNebula::Client.new\n\n @type = type\n\n case type\n when 'Cluster'\n if !id\n xml = OpenNebula::Cluster.build_xml\n\n @one = OpenNebula::Cluster.new(xml, client)\n else\n @one = OpenNebula::Cluster.new_with_id(id, client)\n @one.info\n end\n\n @pool = OpenNebula::ClusterPool.new(client)\n when 'Datastore'\n xml = OpenNebula::Datastore.build_xml\n\n @one = OpenNebula::Datastore.new(xml, client)\n @pool = OpenNebula::DatastorePool.new(client)\n when 'Host'\n if !id\n xml = OpenNebula::Host.build_xml\n\n @one = OpenNebula::Host.new(xml, client)\n else\n @one = OpenNebula::Host.new_with_id(id, client)\n @one.info\n end\n\n @pool = OpenNebula::HostPool.new(client)\n when 'Vnet'\n xml = OpenNebula::VirtualNetwork.build_xml\n\n @one = OpenNebula::VirtualNetwork.new(xml, client)\n @pool = OpenNebula::VirtualNetworkPool.new(client)\n end\n end", "def create(cluster_id)\n # create ONE object\n new_object\n\n rc = @one.allocate(format_template(@p_template), cluster_id)\n Utils.exception(rc)\n rc = @one.info\n Utils.exception(rc)\n\n OneProvisionLogger.debug(\n \"#{@type} created with ID: #{@one.id}\"\n )\n\n Integer(@one.id)\n end", "def create\n @serviceordemservice = Serviceordemservice.new(serviceordemservice_params)\n\n respond_to do |format|\n if @serviceordemservice.save\n format.html { redirect_to @serviceordemservice, notice: 'Serviceordemservice was successfully created.' }\n format.json { render :show, status: :created, location: @serviceordemservice }\n else\n format.html { render :new }\n format.json { render json: @serviceordemservice.errors, status: :unprocessable_entity }\n end\n end\n end", "def breakers_service\n return @service if defined?(@service)\n\n @service = create_new_breakers_service(breakers_matcher, breakers_exception_handler)\n end", "def create_instance request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_create_instance_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "def create!\n EC2.clone_interface!(instance.eth0, description)\n tag!\n puts \"Created secondary ENI (#{interface.id})\"\n end", "def create_service_line\n @service_line = ServicePaymentEob.new(:details=>{:date_of_service_from_ocr_output=>\"\"})\n @insurance_payment_eob.service_payment_eobs << @service_line\n @service_line.save(:validate => false)\n return @service_line\n end", "def create(state)\n info(\"Creating instance #{instance.name}\")\n return if state[:server_id]\n\n domain = create_domain\n state[:server_id] = domain.id\n state[:hostname] = domain.public_ip_address\n\n instance.transport.connection(state).wait_until_ready\n\n info(\"Libvirt instance #{domain.name} created.\")\n end", "def create\n\t type = @params[0].split('.')\n\n\t if type[1]\n\n\t if @params[1]\n\t FileUtils.touch(@params[1]+'/'+@params[0])\n\t else\n\t FileUtils.touch(@params[0])\n\t end\n\t else\n\t if @params[1]\n\t FileUtils::mkdir_p @params[1]+'/'+@params[0]\n\t else\n\t FileUtils::mkdir_p @params[0]\n\t end\n\t end\n\t end", "def create\n @service = @page.services.new(params[:service])\n @service.user = current_user\n \n respond_to do |format|\n if @service.save\n format.html { redirect_to service_url(@page, @service), notice: 'Service was successfully created.' }\n format.json { render json: @service, status: :created, location: @service }\n else\n format.html { render action: \"new\" }\n format.json { render json: @service.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.641914", "0.6407304", "0.6389548", "0.6346785", "0.6294748", "0.61593324", "0.61350405", "0.6092666", "0.59620816", "0.59549654", "0.59512955", "0.58955264", "0.5891125", "0.5820004", "0.5810055", "0.5797039", "0.5743813", "0.5697255", "0.56704134", "0.56704134", "0.5629569", "0.5612746", "0.56121606", "0.56120867", "0.5595422", "0.55819863", "0.55755013", "0.55701065", "0.55624324", "0.55542654", "0.5537579", "0.55084676", "0.5495219", "0.54913", "0.54913", "0.5490814", "0.54750454", "0.54549557", "0.5440482", "0.5439391", "0.5430212", "0.5415133", "0.5410624", "0.5402255", "0.5380744", "0.5366225", "0.535935", "0.53530693", "0.53511786", "0.5345302", "0.533997", "0.5328324", "0.53178746", "0.5311674", "0.52930325", "0.5288225", "0.5283257", "0.528082", "0.5262429", "0.5253497", "0.5245681", "0.52310055", "0.5228137", "0.52224237", "0.5215437", "0.52091545", "0.520895", "0.51980376", "0.51920193", "0.5190951", "0.5190638", "0.51883286", "0.5188144", "0.5182421", "0.5165025", "0.5163688", "0.5161954", "0.5160869", "0.5158865", "0.51545465", "0.5152052", "0.51477647", "0.5147616", "0.5143291", "0.5136405", "0.51352715", "0.5131386", "0.51279503", "0.5124642", "0.5121808", "0.5115205", "0.5110818", "0.5109843", "0.5103604", "0.5098826", "0.50881654", "0.5080306", "0.50665027", "0.50653607", "0.5064723", "0.5062799" ]
0.0
-1
Create Tier1 BYOD service instance Create Tier1 BYOD Service Instance which represents instance of service definition created on manager.
def patch_tier1_byod_policy_service_instance_0(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts = {}) patch_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts) nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n super(@@service)\n end", "def create_service_instance(name, space_guid, service_plan_id)\n service_plan_instance = CFoundry::V2::ServicePlan.new(service_plan_id, @client)\n service_instance = @client.managed_service_instance\n service_instance.name = name\n service_instance.service_plan = service_plan_instance\n service_instance.space = @client.space(space_guid)\n service_instance.create!\n service_instance\n end", "def new\n @service = Service.new\n end", "def create_service\n # Check signals here to be nice and abort early if possible.\n check_signals!\n # Enable automatically creates the service with Runit.\n directory \"/var/log/#{new_resource.service_name}\" do\n owner 'root'\n group 'root'\n mode '700'\n end\n end", "def create_service\n super.tap do |service_template|\n service_template.cookbook('poise-service')\n create_monit_config\n end\n end", "def create_service(data=nil)\n if (!data.blank? && data.is_a?(Hash))\n @service = Service.create(data)\n else\n @service = Service.create(:name => \"Test Service #{rand(1..1000)}\", :description => \"Test service description.\", :active => true, :probe => \"dummy\", :probe_config => {:value => 1}, :interval => 60, :clean_interval => 86400, :priority => Service::PRIORITY_NORMAL, :resume => :mean_value)\n end\n end", "def service_create(name, display_name, executable_on_host,startup=2)\n\t\tif session_has_services_depend?\n\t\t\tmeterpreter_service_create(name, display_name, executable_on_host,startup)\n\t\telse\n\t\t\tshell_service_create(name, display_name, executable_on_host,startup)\n\t\tend\n\tend", "def create_instance\n create_instances(1).first\n end", "def create\n @service = Service.create(service_params)\n end", "def start_service\n object = DBusObject.new(@main, self)\n service = @bus.request_service(SERVICE)\n service.export object\n end", "def initialize_service_for_create\n @service = service_class.new(hashified_params, service_options)\n end", "def instantiate_service\n @service = ContestService.new\n end", "def create_and_register_service(service_hash)\n # SystemDebug.debug(SystemDebug.services, :attach_ing_create_and_egister_service, service_hash)\n create_and_register_managed_service(service_hash)\n end", "def create\n service = current_account.services.build\n create_service = ServiceCreator.new(service: service)\n create_service.call(service_params.to_h)\n service.reload if service.persisted? # It has been touched\n respond_with(service)\n end", "def new\n @service = Service.new\n\n # If a valid type is received, apply to the host to create.\n check_priority_param\n @service.priority = @priority if([email protected]?)\n\n # Add custom views paths\n prepend_view_path \"app/views/services\"\n prepend_view_path \"lib/probes/#{@service.probe}/views\"\n\n respond_to do |format|\n format.html\n end\n end", "def create\n service = current_account.services.build\n create_service = ServiceCreator.new(service: service)\n create_service.call(service_params)\n service.reload if service.persisted? # It has been touched\n respond_with(service)\n end", "def new_service(service)\n \tOrder.new(\n \t\torderNumber: 37592,\n \t\tservice: service,\n\t\t\torderType: \"установка розетки\",\n\t\t\tnameOrFIO: \"Нибелунг Зигфрид Беовульфыч\",\n\t\t\tstreet: \"бул. Амурский\",\n\t\t\thouse: 10,\n\t\t\tresponsiblePerson: \"Витя Кабан\",\n\t\t\tpersonType: \"Физ лицо\",\n\t\t\tformingDate: \"2013-11-13\")\n end", "def start_service\n DRb.start_service \n @space = Rinda::TupleSpaceProxy.new(DRbObject.new(nil, @uri))\n end", "def get_instance(payload)\n ServiceInstance.new(@version, payload)\n end", "def get_instance(payload)\n ServiceInstance.new(@version, payload)\n end", "def create\n submenu_item 'services-new'\n @service = Service.new(params[:service])\n @service_type = @service.type\n service_param\n\n @service.tenant_id = current_user.tenant_id\n\n # service_params = Service.extract_params(params[:service])\n # service_params = Service.extract_thresholds(service_params)\n # @service = Service.new(service_params)\n\n respond_to do |format|\n if @service.save\n flash[:notice] = \"#{@service.name}创建成功\"\n format.html { redirect_to(@service) }\n else\n dictionary\n format.html { render :action => \"new\" }\n end\n end\n end", "def call\n # Update service and update context\n self.service = Entities::Service.find_by_system_name(remote: threescale_client,\n system_name: service_system_name)\n if service.nil?\n # Create service and update context\n self.service = Entities::Service.create(remote: threescale_client,\n service_params: service_settings)\n logger.info \"Created service id: #{service.id}, name: #{service_name}\"\n else\n service.update(service_settings)\n logger.info \"Updated service id: #{service.id}, name: #{service_name}\"\n end\n\n report['id'] = service.id\n report['system_name'] = service.system_name\n report['name'] = service.name\n report['backend_version'] = api_spec.service_backend_version\n end", "def start\n service.pool_action uuid, :create\n end", "def service\n StockManagementService.new\n end", "def start(klass, *args)\n # Get the hardcore alias.\n hals = \"#{klass}\" + klass.hardcore_alias(*args)\n\n # Has a service already been constructed for this guy? If so, increment\n # its reference count like it aint no thang.\n if (inst = self[hals])\n inst.ref\n return inst\n end\n\n inst = klass.new(*args)\n als = inst.alias\n\n # Find an alias that isn't taken.\n if (self[als])\n cnt = 1\n cnt += 1 while (self[als + \" #{cnt}\"])\n als = inst.alias + \" #{cnt}\"\n end\n\n # Extend the instance as a service.\n inst.extend(Rex::Service)\n\n # Re-aliases the instance.\n inst.alias = als\n\n # Fire up the engines. If an error occurs an exception will be\n # raised.\n inst.start\n\n # Alias associate and initialize reference counting\n self[als] = self[hals] = inst.refinit\n\n # Pass the caller a reference\n inst.ref\n\n inst\n end", "def start_instance\n @instance = Task.find(@task).instances.create\n end", "def create_instance(supervisor)\n Instance.new(supervisor, self, get_instance_id)\n end", "def service(nickname, reserved, distribution, type)\n end", "def create\n @idti_service = IdtiService.new(idti_service_params)\n\n respond_to do |format|\n if @idti_service.save\n format.html { redirect_to @idti_service, notice: 'Idti service was successfully created.' }\n format.json { render :show, status: :created, location: @idti_service }\n else\n format.html { render :new }\n format.json { render json: @idti_service.errors, status: :unprocessable_entity }\n end\n end\n end", "def instantiate_service!(service, request)\n definition = service.kind_of?(Hash) ? service : service_definition_for(service.to_s)\n raise NoSuchService.new(\"Service '#{service}'' does not exist in umlaut-services.yml\") if definition.nil?\n className = definition[\"type\"] || definition[\"service_id\"]\n classConst = Kernel.const_get(className)\n service = classConst.new(definition)\n service.request = request\n return service\n end", "def algolia_new_service\n services = Algolia::Index.new(\"services\")\n res = services.add_object({\"title\" => self.title, \"user_id\" => self.user_id, \"id\" => self.id, \"price\" => self.price, \"due_date\" => self.due_date,\n \"youtube_url\" => self.youtube_url, \"category\" => self.category, \"sub_category\" => self.sub_category, \"description\" => self.description,\n \"refund\" => self.refund, \"status\" => self.status, \"title_seo\" => self.title_seo})\n self.algolia_id = res[\"objectID\"]\n self.save\n end", "def create(name)\n object = new(name)\n @instances.push(object)\n object\n end", "def create\n Puppet.debug \"starting create #{self.class.to_s}\"\n dns_service = get_dns_service(get_fqdn)\n dns_service.create_record(get_fqdn, get_type, get_ip) if dns_service != nil\n Puppet.debug \"done with create #{self.class.to_s}\"\n end", "def new_climate_service\r\n @climate_service = ClimateService.new\r\n end", "def new_climate_service\r\n @climate_service = ClimateService.new\r\n end", "def create_target_mock\n ref = self.service_name.downcase.gsub(/ /, '-')\n create_row = {\n ref: ref,\n display_name: self.service_name,\n type: 'instance',\n iaas_type: 'ec2',\n iaas_properties: {},\n project_id: self.project.id\n }\n Model.create_from_row(self.project.model_handle(:target), create_row, convert: true, ret_obj: { model_name: :target_instance })\n end", "def create_service(opts = {})\n data, _status_code, _headers = create_service_with_http_info(opts)\n data\n end", "def create_instance(credentials, image_id, opts)\n racks = new_client( credentials )\n hwp_id = opts[:hwp_id] || 1\n name = Time.now.to_s\n if (opts[:name]) then name = opts[:name] end\n safely do\n return convert_srv_to_instance(racks.start_server(image_id, hwp_id, name))\n end\n end", "def create_service_by_names(name, space_guid, service_plan_name, service_type_name)\n service = @client.services.select{ |srv| srv.label == service_type_name }\n\n if service != []\n service_plan_id = @client.service_plans_by_service_guid(service.first.guid).each.find { |current_plan| current_plan.name == service_plan_name }.guid\n create_service_instance(name, space_guid, service_plan_id)\n else\n return false\n end\n end", "def instance(*options)\n all_options = @options.merge(options.to_options_hash)\n Rush::ServiceInstance.factory(@name, @box, all_options)\n end", "def create\n req = VCAP::Services::Api::ServiceOfferingRequest.decode(request_body)\n logger.debug(\"Create service request: #{req.extract.inspect}\")\n\n # Should we worry about a race here?\n\n success = nil\n svc = Service.find_by_label(req.label)\n if svc\n raise CloudError.new(CloudError::FORBIDDEN) unless svc.verify_auth_token(@service_auth_token)\n attrs = req.extract.dup\n attrs.delete(:label)\n # Keep DB in sync with configs if the token changes in the config\n attrs[:token] = @service_auth_token if svc.is_builtin?\n svc.update_attributes!(attrs)\n else\n # Service doesn't exist yet. This can only happen for builtin services since service providers must\n # register with us to get a token.\n svc = Service.new(req.extract)\n raise CloudError.new(CloudError::FORBIDDEN) unless svc.is_builtin? && svc.verify_auth_token(@service_auth_token)\n svc.token = @service_auth_token\n svc.save!\n end\n\n render :json => {}\n end", "def generate\n\t\ttemplate('service.tt', \"lib/services/#{name.underscore}_service.rb\")\n\tend", "def create_driver\n parse_service_description\n\n @driver = SOAP::RPC::Driver.new @control_url, @type\n\n mapping_registry = UPnP::SOAPRegistry.new\n\n @actions.each do |name, arguments|\n soapaction = \"#{@type}##{name}\"\n qname = XSD::QName.new @type, name\n\n # TODO map ranges, enumerations\n arguments = arguments.map do |direction, arg_name, variable|\n type, = @variables[variable]\n\n schema_name = XSD::QName.new nil, arg_name\n\n mapping_registry.register :class => type, :schema_name => schema_name\n\n [direction, arg_name, @variables[variable].first]\n end\n\n @driver.proxy.add_rpc_method qname, soapaction, name, arguments\n @driver.send :add_rpc_method_interface, name, arguments\n end\n\n @driver.mapping_registry = mapping_registry\n\n @variables = nil\n end", "def create(name, command, description = nil, options = {})\n defaults = {\n :service_type => Win32::Service::WIN32_OWN_PROCESS,\n :start_type => Win32::Service::AUTO_START,\n :error_control => Win32::Service::ERROR_NORMAL\n }\n defaults.merge!(options)\n name = n(name)\n options = defaults.merge(\n :display_name => name,\n :description => description || name,\n :binary_path_name => command\n )\n Win32::Service.create(name, nil, options)\n end", "def createVehicle _obj, _args\n \"_obj createVehicle _args;\" \n end", "def create_tier1_byod_policy_service_instance_0(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts = {})\n data, _status_code, _headers = create_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts)\n data\n end", "def start_service(*args)\n end", "def run_instance\n Souffle::Log.info \"Single instance runs are not currently implemented...\"\n # system = Souffle::System.from_hash(data)\n # provider = Souffle::Provider.plugin(system.try_opt(:provider)).new\n # system_tag = provider.create_system(system)\n end", "def create_object\n definition.sought_type.new\n end", "def create\n service = current_account.create_service(service_params)\n service.reload if service.persisted? # It has been touched\n respond_with(service)\n end", "def create_service(resource, actions)\n service_name = get_service_name()\n\n case resource.service_type\n when \"upstart\"\n service service_name do\n provider Chef::Provider::Service::Upstart\n supports :status => true, :restart => true, :reload => true\n action actions\n end\n when \"init.d\"\n service service_name do\n supports :status => true, :restart => true, :reload => true\n action actions\n end\n else\n raise \"dashing: Unknown service_type '#{resource.service_type}'\"\n end\nend", "def create_service(name, description)\n response = @client.post(\"/api/v1/services\", { \"name\" => name, \"description\" => description })\n return JSON.parse(response.body)\n end", "def newServiceCorp(corpConf)\n klass = SavServiceCorp.getSubClassByName(corpConf[:class]) ;\n corp = klass.new(@simulator, corpConf) ;\n return corp ;\n end", "def create_tier1_byod_policy_service_instance(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts = {})\n data, _status_code, _headers = create_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts)\n data\n end", "def create_offering(args)\n params = {\n 'command' => 'createServiceOffering',\n 'name' => args[:name],\n 'cpunumber' => args[:cpunumber],\n 'cpuspeed' => args[:cpuspeed],\n 'displaytext' => args[:displaytext],\n 'memory' => args[:memory]\n }\n\n if args['domain']\n params['domainid'] = list_domains(args['domain']).first[\"id\"]\n end\n\n params['tags'] = args[:tags] if args[:tags]\n params['offerha'] = 'true' if args[:ha]\n\n json = send_request(params)\n json['serviceoffering'].first\n end", "def spawn(name)\n if service_list.include?(name)\n VinData::Services.const_get(classify_name(name)).new\n else\n valids = service_list.map(&:inspect).join(\", \")\n raise ConfigurationError, \"Please specify a valid service for VinData \" +\n \"(#{name.inspect} is not one of: #{valids}).\"\n end\n end", "def create\n @emt_service = EmtService.new(emt_service_params)\n\n respond_to do |format|\n if @emt_service.save\n format.html { redirect_to @emt_service, notice: 'Emt service was successfully created.' }\n format.json { render action: 'show', status: :created, location: @emt_service }\n else\n format.html { render action: 'new' }\n format.json { render json: @emt_service.errors, status: :unprocessable_entity }\n end\n end\n end", "def create(label_options)\n create_label File.join(LABEL_URL, 'domestic'), label_options\n end", "def init_service (service_name, service_class)\n\n if service_name\n #\n # if there is a service previously registered under the same name,\n # make sure to stop before it gets 'overriden' in the\n # application context\n\n s = @application_context[service_name]\n s.stop if s.respond_to?(:stop)\n end\n\n s = service_class.new(service_name, @application_context)\n\n unless service_name\n #\n # making sure to register the service. service#new doesn't\n # register when there is no service_name\n\n s.service_name = \"#{service_class.name}::#{s.object_id}\"\n @application_context[s.service_name.to_s] = s\n end\n\n s\n end", "def service\n @service ||= service_class.new(self, assessment: @assessment, submission: @submission)\n end", "def create_worker(id, worker_klasses)\n worker = Service::Worker.new(id: id, supervisor: self, klasses: worker_klasses)\n @workers[id] = worker\n worker\n end", "def run\n super\n opt_port = _get_option \"port\"\n opt_protocol = _get_option \"protocol\"\n _create_network_service_entity(@entity,opt_port,opt_protocol,{})\n end", "def create(id, name: nil, type: :PRODUCTION, labels: nil, clusters: nil)\n end", "def space_service_create(entity, opts = {})\n data, _status_code, _headers = space_service_create_with_http_info(entity, opts)\n return data\n end", "def create\n @service = Service.new(params[:service])\n\n respond_to do |format|\n if @service.save\n format.html { redirect_to(admin_service_path(@service), :notice => 'Service was successfully created.') }\n format.xml { render :xml => @service, :status => :created, :location => @service }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @service.errors, :status => :unprocessable_entity }\n end\n end\n end", "def install\n kit_klass = ServiceKit.const_get self.service_type.capitalize\n kit = kit_klass.new comms, container, host\n kit.configure_service!\n end", "def service(service_name, api_client)\n klazz = service_class(service_name)\n\n # raise an error unless the class inherits from Service\n unless klazz < Core::ServiceLayer::Service\n raise ServiceParentError,\n \"service #{klazz.name} is not a subclass of \\\n Core::ServiceLayer::Service\"\n end\n\n # create an instance of the service class\n klazz.try(:new, api_client)\n end", "def create_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'byod_policy_service_instance' is set\n if @api_client.config.client_side_validation && byod_policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'byod_policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(byod_policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_byod_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @tech_serv = TechServ.new(tech_serv_params)\n\n respond_to do |format|\n if @tech_serv.save\n format.html { redirect_to [:admin, @tech_serv], notice: '技术服务创建成功.' }\n format.json { render action: 'show', status: :created, location: @tech_serv }\n else\n format.html { render action: 'new' }\n format.json { render json: @tech_serv.errors, status: :unprocessable_entity }\n end\n end\n end", "def initialize(name, domain)\n raise Exception.new(\"#{name} is not a valid service name\") unless valid_directory_name(name.to_s)\n \n @name = name\n @booted = false\n @domain = domain\n @full_name = \"#{domain.name}::#{@name}\"\n @path = \"#{SERVICES_PATH}/#{domain.name}/#{@name}\"\n @port_in = $port_start+=1\n @port_out = $port_start+=1\n @status = \"stopped\"\n @runtime = JJRuby.newInstance()\n \n # Create the domain directory if not present\n FileUtils.mkdir_p(@path, :mode => 0755)\n \n # And finally set the meta-data for the service\n @meta_data = ServiceMetaData.new(self)\n ContainerLogger.debug \"Service added #{domain.name}::#{name}\" \n end", "def create\n @servicetype = Servicetype.new(params[:servicetype])\n\n respond_to do |format|\n if @servicetype.save\n format.html { redirect_to @servicetype, notice: 'Servicetype was successfully created.' }\n format.json { render json: @servicetype, status: :created, location: @servicetype }\n else\n format.html { render action: \"new\" }\n format.json { render json: @servicetype.errors, status: :unprocessable_entity }\n end\n end\n end", "def service; end", "def create\n @admin_service = Admin::Service.new(admin_service_regex_params)\n\n respond_to do |format|\n if @admin_service.save\n format.html { redirect_to @admin_service, notice: 'Platform was successfully created.' }\n format.json { render :show, status: :created, location: @admin_service }\n else\n format.html { render :new }\n format.json { render json: @admin_service.errors, status: :unprocessable_entity }\n end\n end\n end", "def create params\n raise_start_server unless Server::node\n new params\n end", "def create_carrier_service\n puts \" ____________ CREATE CARRIER SERVICE ______\"\n connectApi\n ShopifyAPI::CarrierService.create({\n \"carrier_service\": {\n \"name\": \"Livraison à domicile avec Urbit\",\n \"callback_url\": \"https://conticini-urbit.herokuapp.com/shipping\",\n \"service_discovery\": true\n }\n })\n end", "def create(_instance)\n raise Errors::Backend::NotImplementedError, 'Requested functionality is not implemented'\n end", "def create_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'byod_policy_service_instance' is set\n if @api_client.config.client_side_validation && byod_policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'byod_policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(byod_policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_byod_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @tb_servicio = TbServicio.new(tb_servicio_params)\n\n respond_to do |format|\n if @tb_servicio.save\n format.html { redirect_to @tb_servicio, notice: 'Tb servicio was successfully created.' }\n format.json { render :show, status: :created, location: @tb_servicio }\n else\n format.html { render :new }\n format.json { render json: @tb_servicio.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_service_dir( sname, instance = nil )\n sdir = service_dir( sname, instance )\n mkdir_run_user( sdir )\n end", "def new()\n trace(\"Instance #{index} created\")\n index += 1\n end", "def service_discovery_create_manager(title, configurations:, load_balancer: nil, custom_build_method: nil, interval: 3)\n super\n end", "def newMicroServiceType(name,abbr,style,opmode,min=1,max=1)\n\nend", "def create\n @servicetype = Servicetype.new(params[:servicetype])\n\n respond_to do |format|\n if @servicetype.save\n format.html { redirect_to @servicetype, :notice => 'Servicetype was successfully created.' }\n format.json { render :json => @servicetype, :status => :created, :location => @servicetype }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @servicetype.errors, :status => :unprocessable_entity }\n end\n end\n end", "def service(name)\n name = name.to_sym\n\n service_info = SERVICES[name]\n if service_info.nil?\n raise ArgumentError, sprintf('No service found with name %s', name)\n end\n\n require_path = sprintf(SERVICE_PATH, @path_version,\n service_info.first)\n require require_path\n\n class_path = sprintf(SERVICE_CLASS_PATH, @version, service_info.last)\n return class_for_path(class_path)\n end", "def create\n @taxi_sevice = TaxiSevice.new(taxi_sevice_params)\n\n respond_to do |format|\n if @taxi_sevice.save\n format.html { redirect_to action: \"index\" }\n else\n format.html { render :new }\n format.json { render json: @taxi_sevice.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_instance(credentials, image_id, opts)\n new_vapp = nil\n vapp_opts = {} #assemble options to pass to Fog::Terremark::Real.instantiate_vapp_template\n terremark_hwp = hardware_profiles(credentials, {:name => 'default'}).first #sanity check values against default\n name = opts[:name]\n if not name\n name = \"inst#{Time.now.to_i}\"\n end\n if name.length > USER_NAME_MAX\n raise \"Parameter name must be #{USER_NAME_MAX} characters or less\"\n end\n unless ( (terremark_hwp.include?(:cpu, opts[:hwp_cpu].to_i)) &&\n (terremark_hwp.include?(:memory, opts[:hwp_memory].to_i)) ) then\n raise Deltacloud::Exceptions::ValidationFailure.new(\n StandardError.new(\"Error with cpu and/or memory values. you said cpu->#{opts[:hwp_cpu]} and mem->#{opts[:hwp_memory]}\")\n )\n end\n vapp_opts['cpus'] = opts[:hwp_cpu]\n vapp_opts['memory'] = opts[:hwp_memory]\n safely do\n terremark_client = new_client(credentials)\n#######\n#FIXME# what happens if there is an issue getting the new vapp id? (eg even though created succesfully)\n#######\n vapp_id = terremark_client.instantiate_vapp_template(name, image_id, vapp_opts).body['href'].split('/').last\n new_vapp = terremark_client.get_vapp(vapp_id)\n return convert_instance(new_vapp, terremark_client, credentials.user) #return an Instance object\n end\n end", "def start\n create('start')\n end", "def create\n @one_time_stop = OneTimeStop.new(params[:one_time_stop])\n\n respond_to do |format|\n if @one_time_stop.save\n format.html { redirect_to @one_time_stop, notice: 'One time stop was successfully created.' }\n format.json { render json: @one_time_stop, status: :created, location: @one_time_stop }\n else\n format.html { render action: \"new\" }\n format.json { render json: @one_time_stop.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n begin\n enterMaintenanceMode\n rescue\n Puppet.err 'Could not find Host system.Either Host is not exist or disconnected'\n end\n end", "def create\n @recreation_service_typology = RecreationServiceTypology.new(recreation_service_typology_params)\n\n respond_to do |format|\n if @recreation_service_typology.save\n format.html { redirect_to @recreation_service_typology, notice: 'Recreation service typology was successfully created.' }\n format.json { render action: 'show', status: :created, location: @recreation_service_typology }\n else\n format.html { render action: 'new' }\n format.json { render json: @recreation_service_typology.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n Puppet.debug \"starting create #{self.class.to_s}\"\n dns_service = get_dns_service(get_zone)\n dns_service.create_zone(get_zone, get_email, get_ttl) if dns_service != nil\n Puppet.debug \"done with create #{self.class.to_s}\"\n end", "def initialize(type, id = nil)\n client = OpenNebula::Client.new\n\n @type = type\n\n case type\n when 'Cluster'\n if !id\n xml = OpenNebula::Cluster.build_xml\n\n @one = OpenNebula::Cluster.new(xml, client)\n else\n @one = OpenNebula::Cluster.new_with_id(id, client)\n @one.info\n end\n\n @pool = OpenNebula::ClusterPool.new(client)\n when 'Datastore'\n xml = OpenNebula::Datastore.build_xml\n\n @one = OpenNebula::Datastore.new(xml, client)\n @pool = OpenNebula::DatastorePool.new(client)\n when 'Host'\n if !id\n xml = OpenNebula::Host.build_xml\n\n @one = OpenNebula::Host.new(xml, client)\n else\n @one = OpenNebula::Host.new_with_id(id, client)\n @one.info\n end\n\n @pool = OpenNebula::HostPool.new(client)\n when 'Vnet'\n xml = OpenNebula::VirtualNetwork.build_xml\n\n @one = OpenNebula::VirtualNetwork.new(xml, client)\n @pool = OpenNebula::VirtualNetworkPool.new(client)\n end\n end", "def create(cluster_id)\n # create ONE object\n new_object\n\n rc = @one.allocate(format_template(@p_template), cluster_id)\n Utils.exception(rc)\n rc = @one.info\n Utils.exception(rc)\n\n OneProvisionLogger.debug(\n \"#{@type} created with ID: #{@one.id}\"\n )\n\n Integer(@one.id)\n end", "def create\n @serviceordemservice = Serviceordemservice.new(serviceordemservice_params)\n\n respond_to do |format|\n if @serviceordemservice.save\n format.html { redirect_to @serviceordemservice, notice: 'Serviceordemservice was successfully created.' }\n format.json { render :show, status: :created, location: @serviceordemservice }\n else\n format.html { render :new }\n format.json { render json: @serviceordemservice.errors, status: :unprocessable_entity }\n end\n end\n end", "def breakers_service\n return @service if defined?(@service)\n\n @service = create_new_breakers_service(breakers_matcher, breakers_exception_handler)\n end", "def create_instance request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_create_instance_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "def create!\n EC2.clone_interface!(instance.eth0, description)\n tag!\n puts \"Created secondary ENI (#{interface.id})\"\n end", "def create_service_line\n @service_line = ServicePaymentEob.new(:details=>{:date_of_service_from_ocr_output=>\"\"})\n @insurance_payment_eob.service_payment_eobs << @service_line\n @service_line.save(:validate => false)\n return @service_line\n end", "def create\n\t type = @params[0].split('.')\n\n\t if type[1]\n\n\t if @params[1]\n\t FileUtils.touch(@params[1]+'/'+@params[0])\n\t else\n\t FileUtils.touch(@params[0])\n\t end\n\t else\n\t if @params[1]\n\t FileUtils::mkdir_p @params[1]+'/'+@params[0]\n\t else\n\t FileUtils::mkdir_p @params[0]\n\t end\n\t end\n\t end", "def create(state)\n info(\"Creating instance #{instance.name}\")\n return if state[:server_id]\n\n domain = create_domain\n state[:server_id] = domain.id\n state[:hostname] = domain.public_ip_address\n\n instance.transport.connection(state).wait_until_ready\n\n info(\"Libvirt instance #{domain.name} created.\")\n end", "def create\n @service = @page.services.new(params[:service])\n @service.user = current_user\n \n respond_to do |format|\n if @service.save\n format.html { redirect_to service_url(@page, @service), notice: 'Service was successfully created.' }\n format.json { render json: @service, status: :created, location: @service }\n else\n format.html { render action: \"new\" }\n format.json { render json: @service.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.6418922", "0.64067155", "0.6388593", "0.63469553", "0.62953347", "0.6158955", "0.6135113", "0.6091988", "0.59614605", "0.5954381", "0.59508234", "0.5894851", "0.5890975", "0.58192974", "0.58097225", "0.5796319", "0.5743458", "0.5697263", "0.56687385", "0.56687385", "0.5630251", "0.5613308", "0.5612594", "0.56113946", "0.5595408", "0.55807954", "0.5573267", "0.55695796", "0.5562321", "0.5552716", "0.5538381", "0.5507209", "0.5495003", "0.5490917", "0.5490917", "0.54894805", "0.5473521", "0.5453391", "0.5441545", "0.54380625", "0.5429398", "0.5415598", "0.5410167", "0.54013526", "0.5380385", "0.5365774", "0.5359506", "0.5353106", "0.53505796", "0.5344115", "0.5339709", "0.5328441", "0.5316783", "0.53107285", "0.5292412", "0.5287967", "0.52819556", "0.5280858", "0.5262117", "0.52526903", "0.52453387", "0.5231983", "0.52285194", "0.5220909", "0.52148855", "0.52105063", "0.52085626", "0.51988214", "0.51915634", "0.5191517", "0.51905555", "0.5188794", "0.51878273", "0.5182093", "0.5165825", "0.5163233", "0.5162598", "0.5160805", "0.5158872", "0.51538634", "0.5152766", "0.5147411", "0.5147265", "0.5143025", "0.51361674", "0.5133712", "0.5131815", "0.51276577", "0.5123145", "0.5121719", "0.5114962", "0.5111241", "0.5110304", "0.510314", "0.50989634", "0.50871354", "0.5079718", "0.50668156", "0.50652754", "0.50643057", "0.5063262" ]
0.0
-1
Create Tier1 BYOD service instance Create Tier1 BYOD Service Instance which represents instance of service definition created on manager.
def patch_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_byod_policy_service_instance_0 ...' end # verify the required parameter 'tier_1_id' is set if @api_client.config.client_side_validation && tier_1_id.nil? fail ArgumentError, "Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_byod_policy_service_instance_0" end # verify the required parameter 'locale_service_id' is set if @api_client.config.client_side_validation && locale_service_id.nil? fail ArgumentError, "Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_byod_policy_service_instance_0" end # verify the required parameter 'service_instance_id' is set if @api_client.config.client_side_validation && service_instance_id.nil? fail ArgumentError, "Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_byod_policy_service_instance_0" end # verify the required parameter 'byod_policy_service_instance' is set if @api_client.config.client_side_validation && byod_policy_service_instance.nil? fail ArgumentError, "Missing the required parameter 'byod_policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_byod_policy_service_instance_0" end # resource path local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(byod_policy_service_instance) auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#patch_tier1_byod_policy_service_instance_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n super(@@service)\n end", "def create_service_instance(name, space_guid, service_plan_id)\n service_plan_instance = CFoundry::V2::ServicePlan.new(service_plan_id, @client)\n service_instance = @client.managed_service_instance\n service_instance.name = name\n service_instance.service_plan = service_plan_instance\n service_instance.space = @client.space(space_guid)\n service_instance.create!\n service_instance\n end", "def new\n @service = Service.new\n end", "def create_service\n # Check signals here to be nice and abort early if possible.\n check_signals!\n # Enable automatically creates the service with Runit.\n directory \"/var/log/#{new_resource.service_name}\" do\n owner 'root'\n group 'root'\n mode '700'\n end\n end", "def create_service\n super.tap do |service_template|\n service_template.cookbook('poise-service')\n create_monit_config\n end\n end", "def create_service(data=nil)\n if (!data.blank? && data.is_a?(Hash))\n @service = Service.create(data)\n else\n @service = Service.create(:name => \"Test Service #{rand(1..1000)}\", :description => \"Test service description.\", :active => true, :probe => \"dummy\", :probe_config => {:value => 1}, :interval => 60, :clean_interval => 86400, :priority => Service::PRIORITY_NORMAL, :resume => :mean_value)\n end\n end", "def service_create(name, display_name, executable_on_host,startup=2)\n\t\tif session_has_services_depend?\n\t\t\tmeterpreter_service_create(name, display_name, executable_on_host,startup)\n\t\telse\n\t\t\tshell_service_create(name, display_name, executable_on_host,startup)\n\t\tend\n\tend", "def create_instance\n create_instances(1).first\n end", "def create\n @service = Service.create(service_params)\n end", "def start_service\n object = DBusObject.new(@main, self)\n service = @bus.request_service(SERVICE)\n service.export object\n end", "def initialize_service_for_create\n @service = service_class.new(hashified_params, service_options)\n end", "def instantiate_service\n @service = ContestService.new\n end", "def create_and_register_service(service_hash)\n # SystemDebug.debug(SystemDebug.services, :attach_ing_create_and_egister_service, service_hash)\n create_and_register_managed_service(service_hash)\n end", "def create\n service = current_account.services.build\n create_service = ServiceCreator.new(service: service)\n create_service.call(service_params.to_h)\n service.reload if service.persisted? # It has been touched\n respond_with(service)\n end", "def new\n @service = Service.new\n\n # If a valid type is received, apply to the host to create.\n check_priority_param\n @service.priority = @priority if([email protected]?)\n\n # Add custom views paths\n prepend_view_path \"app/views/services\"\n prepend_view_path \"lib/probes/#{@service.probe}/views\"\n\n respond_to do |format|\n format.html\n end\n end", "def create\n service = current_account.services.build\n create_service = ServiceCreator.new(service: service)\n create_service.call(service_params)\n service.reload if service.persisted? # It has been touched\n respond_with(service)\n end", "def new_service(service)\n \tOrder.new(\n \t\torderNumber: 37592,\n \t\tservice: service,\n\t\t\torderType: \"установка розетки\",\n\t\t\tnameOrFIO: \"Нибелунг Зигфрид Беовульфыч\",\n\t\t\tstreet: \"бул. Амурский\",\n\t\t\thouse: 10,\n\t\t\tresponsiblePerson: \"Витя Кабан\",\n\t\t\tpersonType: \"Физ лицо\",\n\t\t\tformingDate: \"2013-11-13\")\n end", "def start_service\n DRb.start_service \n @space = Rinda::TupleSpaceProxy.new(DRbObject.new(nil, @uri))\n end", "def get_instance(payload)\n ServiceInstance.new(@version, payload)\n end", "def get_instance(payload)\n ServiceInstance.new(@version, payload)\n end", "def create\n submenu_item 'services-new'\n @service = Service.new(params[:service])\n @service_type = @service.type\n service_param\n\n @service.tenant_id = current_user.tenant_id\n\n # service_params = Service.extract_params(params[:service])\n # service_params = Service.extract_thresholds(service_params)\n # @service = Service.new(service_params)\n\n respond_to do |format|\n if @service.save\n flash[:notice] = \"#{@service.name}创建成功\"\n format.html { redirect_to(@service) }\n else\n dictionary\n format.html { render :action => \"new\" }\n end\n end\n end", "def call\n # Update service and update context\n self.service = Entities::Service.find_by_system_name(remote: threescale_client,\n system_name: service_system_name)\n if service.nil?\n # Create service and update context\n self.service = Entities::Service.create(remote: threescale_client,\n service_params: service_settings)\n logger.info \"Created service id: #{service.id}, name: #{service_name}\"\n else\n service.update(service_settings)\n logger.info \"Updated service id: #{service.id}, name: #{service_name}\"\n end\n\n report['id'] = service.id\n report['system_name'] = service.system_name\n report['name'] = service.name\n report['backend_version'] = api_spec.service_backend_version\n end", "def service\n StockManagementService.new\n end", "def start\n service.pool_action uuid, :create\n end", "def start(klass, *args)\n # Get the hardcore alias.\n hals = \"#{klass}\" + klass.hardcore_alias(*args)\n\n # Has a service already been constructed for this guy? If so, increment\n # its reference count like it aint no thang.\n if (inst = self[hals])\n inst.ref\n return inst\n end\n\n inst = klass.new(*args)\n als = inst.alias\n\n # Find an alias that isn't taken.\n if (self[als])\n cnt = 1\n cnt += 1 while (self[als + \" #{cnt}\"])\n als = inst.alias + \" #{cnt}\"\n end\n\n # Extend the instance as a service.\n inst.extend(Rex::Service)\n\n # Re-aliases the instance.\n inst.alias = als\n\n # Fire up the engines. If an error occurs an exception will be\n # raised.\n inst.start\n\n # Alias associate and initialize reference counting\n self[als] = self[hals] = inst.refinit\n\n # Pass the caller a reference\n inst.ref\n\n inst\n end", "def start_instance\n @instance = Task.find(@task).instances.create\n end", "def create_instance(supervisor)\n Instance.new(supervisor, self, get_instance_id)\n end", "def service(nickname, reserved, distribution, type)\n end", "def create\n @idti_service = IdtiService.new(idti_service_params)\n\n respond_to do |format|\n if @idti_service.save\n format.html { redirect_to @idti_service, notice: 'Idti service was successfully created.' }\n format.json { render :show, status: :created, location: @idti_service }\n else\n format.html { render :new }\n format.json { render json: @idti_service.errors, status: :unprocessable_entity }\n end\n end\n end", "def instantiate_service!(service, request)\n definition = service.kind_of?(Hash) ? service : service_definition_for(service.to_s)\n raise NoSuchService.new(\"Service '#{service}'' does not exist in umlaut-services.yml\") if definition.nil?\n className = definition[\"type\"] || definition[\"service_id\"]\n classConst = Kernel.const_get(className)\n service = classConst.new(definition)\n service.request = request\n return service\n end", "def algolia_new_service\n services = Algolia::Index.new(\"services\")\n res = services.add_object({\"title\" => self.title, \"user_id\" => self.user_id, \"id\" => self.id, \"price\" => self.price, \"due_date\" => self.due_date,\n \"youtube_url\" => self.youtube_url, \"category\" => self.category, \"sub_category\" => self.sub_category, \"description\" => self.description,\n \"refund\" => self.refund, \"status\" => self.status, \"title_seo\" => self.title_seo})\n self.algolia_id = res[\"objectID\"]\n self.save\n end", "def create(name)\n object = new(name)\n @instances.push(object)\n object\n end", "def create\n Puppet.debug \"starting create #{self.class.to_s}\"\n dns_service = get_dns_service(get_fqdn)\n dns_service.create_record(get_fqdn, get_type, get_ip) if dns_service != nil\n Puppet.debug \"done with create #{self.class.to_s}\"\n end", "def new_climate_service\r\n @climate_service = ClimateService.new\r\n end", "def new_climate_service\r\n @climate_service = ClimateService.new\r\n end", "def create_target_mock\n ref = self.service_name.downcase.gsub(/ /, '-')\n create_row = {\n ref: ref,\n display_name: self.service_name,\n type: 'instance',\n iaas_type: 'ec2',\n iaas_properties: {},\n project_id: self.project.id\n }\n Model.create_from_row(self.project.model_handle(:target), create_row, convert: true, ret_obj: { model_name: :target_instance })\n end", "def create_service(opts = {})\n data, _status_code, _headers = create_service_with_http_info(opts)\n data\n end", "def create_instance(credentials, image_id, opts)\n racks = new_client( credentials )\n hwp_id = opts[:hwp_id] || 1\n name = Time.now.to_s\n if (opts[:name]) then name = opts[:name] end\n safely do\n return convert_srv_to_instance(racks.start_server(image_id, hwp_id, name))\n end\n end", "def create_service_by_names(name, space_guid, service_plan_name, service_type_name)\n service = @client.services.select{ |srv| srv.label == service_type_name }\n\n if service != []\n service_plan_id = @client.service_plans_by_service_guid(service.first.guid).each.find { |current_plan| current_plan.name == service_plan_name }.guid\n create_service_instance(name, space_guid, service_plan_id)\n else\n return false\n end\n end", "def instance(*options)\n all_options = @options.merge(options.to_options_hash)\n Rush::ServiceInstance.factory(@name, @box, all_options)\n end", "def create\n req = VCAP::Services::Api::ServiceOfferingRequest.decode(request_body)\n logger.debug(\"Create service request: #{req.extract.inspect}\")\n\n # Should we worry about a race here?\n\n success = nil\n svc = Service.find_by_label(req.label)\n if svc\n raise CloudError.new(CloudError::FORBIDDEN) unless svc.verify_auth_token(@service_auth_token)\n attrs = req.extract.dup\n attrs.delete(:label)\n # Keep DB in sync with configs if the token changes in the config\n attrs[:token] = @service_auth_token if svc.is_builtin?\n svc.update_attributes!(attrs)\n else\n # Service doesn't exist yet. This can only happen for builtin services since service providers must\n # register with us to get a token.\n svc = Service.new(req.extract)\n raise CloudError.new(CloudError::FORBIDDEN) unless svc.is_builtin? && svc.verify_auth_token(@service_auth_token)\n svc.token = @service_auth_token\n svc.save!\n end\n\n render :json => {}\n end", "def generate\n\t\ttemplate('service.tt', \"lib/services/#{name.underscore}_service.rb\")\n\tend", "def create_driver\n parse_service_description\n\n @driver = SOAP::RPC::Driver.new @control_url, @type\n\n mapping_registry = UPnP::SOAPRegistry.new\n\n @actions.each do |name, arguments|\n soapaction = \"#{@type}##{name}\"\n qname = XSD::QName.new @type, name\n\n # TODO map ranges, enumerations\n arguments = arguments.map do |direction, arg_name, variable|\n type, = @variables[variable]\n\n schema_name = XSD::QName.new nil, arg_name\n\n mapping_registry.register :class => type, :schema_name => schema_name\n\n [direction, arg_name, @variables[variable].first]\n end\n\n @driver.proxy.add_rpc_method qname, soapaction, name, arguments\n @driver.send :add_rpc_method_interface, name, arguments\n end\n\n @driver.mapping_registry = mapping_registry\n\n @variables = nil\n end", "def create(name, command, description = nil, options = {})\n defaults = {\n :service_type => Win32::Service::WIN32_OWN_PROCESS,\n :start_type => Win32::Service::AUTO_START,\n :error_control => Win32::Service::ERROR_NORMAL\n }\n defaults.merge!(options)\n name = n(name)\n options = defaults.merge(\n :display_name => name,\n :description => description || name,\n :binary_path_name => command\n )\n Win32::Service.create(name, nil, options)\n end", "def createVehicle _obj, _args\n \"_obj createVehicle _args;\" \n end", "def create_tier1_byod_policy_service_instance_0(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts = {})\n data, _status_code, _headers = create_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts)\n data\n end", "def start_service(*args)\n end", "def run_instance\n Souffle::Log.info \"Single instance runs are not currently implemented...\"\n # system = Souffle::System.from_hash(data)\n # provider = Souffle::Provider.plugin(system.try_opt(:provider)).new\n # system_tag = provider.create_system(system)\n end", "def create_object\n definition.sought_type.new\n end", "def create\n service = current_account.create_service(service_params)\n service.reload if service.persisted? # It has been touched\n respond_with(service)\n end", "def create_service(resource, actions)\n service_name = get_service_name()\n\n case resource.service_type\n when \"upstart\"\n service service_name do\n provider Chef::Provider::Service::Upstart\n supports :status => true, :restart => true, :reload => true\n action actions\n end\n when \"init.d\"\n service service_name do\n supports :status => true, :restart => true, :reload => true\n action actions\n end\n else\n raise \"dashing: Unknown service_type '#{resource.service_type}'\"\n end\nend", "def create_service(name, description)\n response = @client.post(\"/api/v1/services\", { \"name\" => name, \"description\" => description })\n return JSON.parse(response.body)\n end", "def newServiceCorp(corpConf)\n klass = SavServiceCorp.getSubClassByName(corpConf[:class]) ;\n corp = klass.new(@simulator, corpConf) ;\n return corp ;\n end", "def create_tier1_byod_policy_service_instance(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts = {})\n data, _status_code, _headers = create_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts)\n data\n end", "def create_offering(args)\n params = {\n 'command' => 'createServiceOffering',\n 'name' => args[:name],\n 'cpunumber' => args[:cpunumber],\n 'cpuspeed' => args[:cpuspeed],\n 'displaytext' => args[:displaytext],\n 'memory' => args[:memory]\n }\n\n if args['domain']\n params['domainid'] = list_domains(args['domain']).first[\"id\"]\n end\n\n params['tags'] = args[:tags] if args[:tags]\n params['offerha'] = 'true' if args[:ha]\n\n json = send_request(params)\n json['serviceoffering'].first\n end", "def spawn(name)\n if service_list.include?(name)\n VinData::Services.const_get(classify_name(name)).new\n else\n valids = service_list.map(&:inspect).join(\", \")\n raise ConfigurationError, \"Please specify a valid service for VinData \" +\n \"(#{name.inspect} is not one of: #{valids}).\"\n end\n end", "def create\n @emt_service = EmtService.new(emt_service_params)\n\n respond_to do |format|\n if @emt_service.save\n format.html { redirect_to @emt_service, notice: 'Emt service was successfully created.' }\n format.json { render action: 'show', status: :created, location: @emt_service }\n else\n format.html { render action: 'new' }\n format.json { render json: @emt_service.errors, status: :unprocessable_entity }\n end\n end\n end", "def create(label_options)\n create_label File.join(LABEL_URL, 'domestic'), label_options\n end", "def init_service (service_name, service_class)\n\n if service_name\n #\n # if there is a service previously registered under the same name,\n # make sure to stop before it gets 'overriden' in the\n # application context\n\n s = @application_context[service_name]\n s.stop if s.respond_to?(:stop)\n end\n\n s = service_class.new(service_name, @application_context)\n\n unless service_name\n #\n # making sure to register the service. service#new doesn't\n # register when there is no service_name\n\n s.service_name = \"#{service_class.name}::#{s.object_id}\"\n @application_context[s.service_name.to_s] = s\n end\n\n s\n end", "def service\n @service ||= service_class.new(self, assessment: @assessment, submission: @submission)\n end", "def create_worker(id, worker_klasses)\n worker = Service::Worker.new(id: id, supervisor: self, klasses: worker_klasses)\n @workers[id] = worker\n worker\n end", "def run\n super\n opt_port = _get_option \"port\"\n opt_protocol = _get_option \"protocol\"\n _create_network_service_entity(@entity,opt_port,opt_protocol,{})\n end", "def create(id, name: nil, type: :PRODUCTION, labels: nil, clusters: nil)\n end", "def space_service_create(entity, opts = {})\n data, _status_code, _headers = space_service_create_with_http_info(entity, opts)\n return data\n end", "def create\n @service = Service.new(params[:service])\n\n respond_to do |format|\n if @service.save\n format.html { redirect_to(admin_service_path(@service), :notice => 'Service was successfully created.') }\n format.xml { render :xml => @service, :status => :created, :location => @service }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @service.errors, :status => :unprocessable_entity }\n end\n end\n end", "def install\n kit_klass = ServiceKit.const_get self.service_type.capitalize\n kit = kit_klass.new comms, container, host\n kit.configure_service!\n end", "def service(service_name, api_client)\n klazz = service_class(service_name)\n\n # raise an error unless the class inherits from Service\n unless klazz < Core::ServiceLayer::Service\n raise ServiceParentError,\n \"service #{klazz.name} is not a subclass of \\\n Core::ServiceLayer::Service\"\n end\n\n # create an instance of the service class\n klazz.try(:new, api_client)\n end", "def create_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'byod_policy_service_instance' is set\n if @api_client.config.client_side_validation && byod_policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'byod_policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(byod_policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_byod_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @tech_serv = TechServ.new(tech_serv_params)\n\n respond_to do |format|\n if @tech_serv.save\n format.html { redirect_to [:admin, @tech_serv], notice: '技术服务创建成功.' }\n format.json { render action: 'show', status: :created, location: @tech_serv }\n else\n format.html { render action: 'new' }\n format.json { render json: @tech_serv.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @servicetype = Servicetype.new(params[:servicetype])\n\n respond_to do |format|\n if @servicetype.save\n format.html { redirect_to @servicetype, notice: 'Servicetype was successfully created.' }\n format.json { render json: @servicetype, status: :created, location: @servicetype }\n else\n format.html { render action: \"new\" }\n format.json { render json: @servicetype.errors, status: :unprocessable_entity }\n end\n end\n end", "def initialize(name, domain)\n raise Exception.new(\"#{name} is not a valid service name\") unless valid_directory_name(name.to_s)\n \n @name = name\n @booted = false\n @domain = domain\n @full_name = \"#{domain.name}::#{@name}\"\n @path = \"#{SERVICES_PATH}/#{domain.name}/#{@name}\"\n @port_in = $port_start+=1\n @port_out = $port_start+=1\n @status = \"stopped\"\n @runtime = JJRuby.newInstance()\n \n # Create the domain directory if not present\n FileUtils.mkdir_p(@path, :mode => 0755)\n \n # And finally set the meta-data for the service\n @meta_data = ServiceMetaData.new(self)\n ContainerLogger.debug \"Service added #{domain.name}::#{name}\" \n end", "def service; end", "def create\n @admin_service = Admin::Service.new(admin_service_regex_params)\n\n respond_to do |format|\n if @admin_service.save\n format.html { redirect_to @admin_service, notice: 'Platform was successfully created.' }\n format.json { render :show, status: :created, location: @admin_service }\n else\n format.html { render :new }\n format.json { render json: @admin_service.errors, status: :unprocessable_entity }\n end\n end\n end", "def create params\n raise_start_server unless Server::node\n new params\n end", "def create_carrier_service\n puts \" ____________ CREATE CARRIER SERVICE ______\"\n connectApi\n ShopifyAPI::CarrierService.create({\n \"carrier_service\": {\n \"name\": \"Livraison à domicile avec Urbit\",\n \"callback_url\": \"https://conticini-urbit.herokuapp.com/shipping\",\n \"service_discovery\": true\n }\n })\n end", "def create(_instance)\n raise Errors::Backend::NotImplementedError, 'Requested functionality is not implemented'\n end", "def create_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'byod_policy_service_instance' is set\n if @api_client.config.client_side_validation && byod_policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'byod_policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(byod_policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_byod_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @tb_servicio = TbServicio.new(tb_servicio_params)\n\n respond_to do |format|\n if @tb_servicio.save\n format.html { redirect_to @tb_servicio, notice: 'Tb servicio was successfully created.' }\n format.json { render :show, status: :created, location: @tb_servicio }\n else\n format.html { render :new }\n format.json { render json: @tb_servicio.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_service_dir( sname, instance = nil )\n sdir = service_dir( sname, instance )\n mkdir_run_user( sdir )\n end", "def new()\n trace(\"Instance #{index} created\")\n index += 1\n end", "def service_discovery_create_manager(title, configurations:, load_balancer: nil, custom_build_method: nil, interval: 3)\n super\n end", "def newMicroServiceType(name,abbr,style,opmode,min=1,max=1)\n\nend", "def create\n @servicetype = Servicetype.new(params[:servicetype])\n\n respond_to do |format|\n if @servicetype.save\n format.html { redirect_to @servicetype, :notice => 'Servicetype was successfully created.' }\n format.json { render :json => @servicetype, :status => :created, :location => @servicetype }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @servicetype.errors, :status => :unprocessable_entity }\n end\n end\n end", "def service(name)\n name = name.to_sym\n\n service_info = SERVICES[name]\n if service_info.nil?\n raise ArgumentError, sprintf('No service found with name %s', name)\n end\n\n require_path = sprintf(SERVICE_PATH, @path_version,\n service_info.first)\n require require_path\n\n class_path = sprintf(SERVICE_CLASS_PATH, @version, service_info.last)\n return class_for_path(class_path)\n end", "def create\n @taxi_sevice = TaxiSevice.new(taxi_sevice_params)\n\n respond_to do |format|\n if @taxi_sevice.save\n format.html { redirect_to action: \"index\" }\n else\n format.html { render :new }\n format.json { render json: @taxi_sevice.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_instance(credentials, image_id, opts)\n new_vapp = nil\n vapp_opts = {} #assemble options to pass to Fog::Terremark::Real.instantiate_vapp_template\n terremark_hwp = hardware_profiles(credentials, {:name => 'default'}).first #sanity check values against default\n name = opts[:name]\n if not name\n name = \"inst#{Time.now.to_i}\"\n end\n if name.length > USER_NAME_MAX\n raise \"Parameter name must be #{USER_NAME_MAX} characters or less\"\n end\n unless ( (terremark_hwp.include?(:cpu, opts[:hwp_cpu].to_i)) &&\n (terremark_hwp.include?(:memory, opts[:hwp_memory].to_i)) ) then\n raise Deltacloud::Exceptions::ValidationFailure.new(\n StandardError.new(\"Error with cpu and/or memory values. you said cpu->#{opts[:hwp_cpu]} and mem->#{opts[:hwp_memory]}\")\n )\n end\n vapp_opts['cpus'] = opts[:hwp_cpu]\n vapp_opts['memory'] = opts[:hwp_memory]\n safely do\n terremark_client = new_client(credentials)\n#######\n#FIXME# what happens if there is an issue getting the new vapp id? (eg even though created succesfully)\n#######\n vapp_id = terremark_client.instantiate_vapp_template(name, image_id, vapp_opts).body['href'].split('/').last\n new_vapp = terremark_client.get_vapp(vapp_id)\n return convert_instance(new_vapp, terremark_client, credentials.user) #return an Instance object\n end\n end", "def start\n create('start')\n end", "def create\n @one_time_stop = OneTimeStop.new(params[:one_time_stop])\n\n respond_to do |format|\n if @one_time_stop.save\n format.html { redirect_to @one_time_stop, notice: 'One time stop was successfully created.' }\n format.json { render json: @one_time_stop, status: :created, location: @one_time_stop }\n else\n format.html { render action: \"new\" }\n format.json { render json: @one_time_stop.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n begin\n enterMaintenanceMode\n rescue\n Puppet.err 'Could not find Host system.Either Host is not exist or disconnected'\n end\n end", "def create\n @recreation_service_typology = RecreationServiceTypology.new(recreation_service_typology_params)\n\n respond_to do |format|\n if @recreation_service_typology.save\n format.html { redirect_to @recreation_service_typology, notice: 'Recreation service typology was successfully created.' }\n format.json { render action: 'show', status: :created, location: @recreation_service_typology }\n else\n format.html { render action: 'new' }\n format.json { render json: @recreation_service_typology.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n Puppet.debug \"starting create #{self.class.to_s}\"\n dns_service = get_dns_service(get_zone)\n dns_service.create_zone(get_zone, get_email, get_ttl) if dns_service != nil\n Puppet.debug \"done with create #{self.class.to_s}\"\n end", "def initialize(type, id = nil)\n client = OpenNebula::Client.new\n\n @type = type\n\n case type\n when 'Cluster'\n if !id\n xml = OpenNebula::Cluster.build_xml\n\n @one = OpenNebula::Cluster.new(xml, client)\n else\n @one = OpenNebula::Cluster.new_with_id(id, client)\n @one.info\n end\n\n @pool = OpenNebula::ClusterPool.new(client)\n when 'Datastore'\n xml = OpenNebula::Datastore.build_xml\n\n @one = OpenNebula::Datastore.new(xml, client)\n @pool = OpenNebula::DatastorePool.new(client)\n when 'Host'\n if !id\n xml = OpenNebula::Host.build_xml\n\n @one = OpenNebula::Host.new(xml, client)\n else\n @one = OpenNebula::Host.new_with_id(id, client)\n @one.info\n end\n\n @pool = OpenNebula::HostPool.new(client)\n when 'Vnet'\n xml = OpenNebula::VirtualNetwork.build_xml\n\n @one = OpenNebula::VirtualNetwork.new(xml, client)\n @pool = OpenNebula::VirtualNetworkPool.new(client)\n end\n end", "def create(cluster_id)\n # create ONE object\n new_object\n\n rc = @one.allocate(format_template(@p_template), cluster_id)\n Utils.exception(rc)\n rc = @one.info\n Utils.exception(rc)\n\n OneProvisionLogger.debug(\n \"#{@type} created with ID: #{@one.id}\"\n )\n\n Integer(@one.id)\n end", "def create\n @serviceordemservice = Serviceordemservice.new(serviceordemservice_params)\n\n respond_to do |format|\n if @serviceordemservice.save\n format.html { redirect_to @serviceordemservice, notice: 'Serviceordemservice was successfully created.' }\n format.json { render :show, status: :created, location: @serviceordemservice }\n else\n format.html { render :new }\n format.json { render json: @serviceordemservice.errors, status: :unprocessable_entity }\n end\n end\n end", "def breakers_service\n return @service if defined?(@service)\n\n @service = create_new_breakers_service(breakers_matcher, breakers_exception_handler)\n end", "def create_instance request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_create_instance_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "def create!\n EC2.clone_interface!(instance.eth0, description)\n tag!\n puts \"Created secondary ENI (#{interface.id})\"\n end", "def create_service_line\n @service_line = ServicePaymentEob.new(:details=>{:date_of_service_from_ocr_output=>\"\"})\n @insurance_payment_eob.service_payment_eobs << @service_line\n @service_line.save(:validate => false)\n return @service_line\n end", "def create(state)\n info(\"Creating instance #{instance.name}\")\n return if state[:server_id]\n\n domain = create_domain\n state[:server_id] = domain.id\n state[:hostname] = domain.public_ip_address\n\n instance.transport.connection(state).wait_until_ready\n\n info(\"Libvirt instance #{domain.name} created.\")\n end", "def create\n\t type = @params[0].split('.')\n\n\t if type[1]\n\n\t if @params[1]\n\t FileUtils.touch(@params[1]+'/'+@params[0])\n\t else\n\t FileUtils.touch(@params[0])\n\t end\n\t else\n\t if @params[1]\n\t FileUtils::mkdir_p @params[1]+'/'+@params[0]\n\t else\n\t FileUtils::mkdir_p @params[0]\n\t end\n\t end\n\t end", "def create\n @service = @page.services.new(params[:service])\n @service.user = current_user\n \n respond_to do |format|\n if @service.save\n format.html { redirect_to service_url(@page, @service), notice: 'Service was successfully created.' }\n format.json { render json: @service, status: :created, location: @service }\n else\n format.html { render action: \"new\" }\n format.json { render json: @service.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.641914", "0.6407304", "0.6389548", "0.6346785", "0.6294748", "0.61593324", "0.61350405", "0.6092666", "0.59620816", "0.59549654", "0.59512955", "0.58955264", "0.5891125", "0.5820004", "0.5810055", "0.5797039", "0.5743813", "0.5697255", "0.56704134", "0.56704134", "0.5629569", "0.5612746", "0.56121606", "0.56120867", "0.5595422", "0.55819863", "0.55755013", "0.55701065", "0.55624324", "0.55542654", "0.5537579", "0.55084676", "0.5495219", "0.54913", "0.54913", "0.5490814", "0.54750454", "0.54549557", "0.5440482", "0.5439391", "0.5430212", "0.5415133", "0.5410624", "0.5402255", "0.5380744", "0.5366225", "0.535935", "0.53530693", "0.53511786", "0.5345302", "0.533997", "0.5328324", "0.53178746", "0.5311674", "0.52930325", "0.5288225", "0.5283257", "0.528082", "0.5262429", "0.5253497", "0.5245681", "0.52310055", "0.5228137", "0.52224237", "0.5215437", "0.52091545", "0.520895", "0.51980376", "0.51920193", "0.5190951", "0.5190638", "0.51883286", "0.5188144", "0.5182421", "0.5165025", "0.5163688", "0.5161954", "0.5160869", "0.5158865", "0.51545465", "0.5152052", "0.51477647", "0.5147616", "0.5143291", "0.5136405", "0.51352715", "0.5131386", "0.51279503", "0.5124642", "0.5121808", "0.5115205", "0.5110818", "0.5109843", "0.5103604", "0.5098826", "0.50881654", "0.5080306", "0.50665027", "0.50653607", "0.5064723", "0.5062799" ]
0.0
-1
Create Tier1 service instance Create Tier1 Service Instance. Please note that, only display_name, description and deployment_spec_name are allowed to be modified in an exisiting entity. If the deployment spec name is changed, it will trigger the upgrade operation for the SVMs.
def patch_tier1_policy_service_instance(tier_1_id, locale_service_id, service_instance_id, policy_service_instance, opts = {}) patch_tier1_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, policy_service_instance, opts) nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create(name, config)\n # @step: validate the user defined options\n validate(config)\n\n # @step: create the infrastructure deployment\n begin\n provision_aks(name, config)\n rescue StandardError => e\n raise InfrastructureError, \"failed to provision cluster, error: #{e}\"\n end\n\n # @step: bootstrap the cluster\n begin\n provision_cluster(name, config)\n rescue StandardError => e\n raise InfrastructureError, \"failed to bootstrap cluster, error: #{e}\"\n end\n end", "def create_or_replace_tier1(tier_1_id, tier1, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_with_http_info(tier_1_id, tier1, opts)\n data\n end", "def create_tier1_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance\"\n end\n # verify the required parameter 'policy_service_instance' is set\n if @api_client.config.client_side_validation && policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_tier1_0(tier_1_id, tier1, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_0_with_http_info(tier_1_id, tier1, opts)\n data\n end", "def create_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'policy_service_instance' is set\n if @api_client.config.client_side_validation && policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_tier1_service_instance_endpoint_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint' is set\n if @api_client.config.client_side_validation && service_instance_endpoint.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_instance_endpoint)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInstanceEndpoint')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_service_instance_endpoint_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_tier1_service_instance_endpoint_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_endpoint' is set\n if @api_client.config.client_side_validation && service_instance_endpoint.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_instance_endpoint)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInstanceEndpoint')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_service_instance_endpoint\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_kvm_instance(name, opts={})\n cmd = \"virt-install -n #{name} --ram #{opts[:memory]} --disk \" <<\n \"path=#{File.join(KVM_HOME, 'storage', \"#{name}.qcow2\")},device=disk,bus=virtio,format=qcow2 \" <<\n \"-v --import --noautoconsole --vcpus=#{opts[:vcpus]},maxvcpus=#{opts[:maxvcpus]}\" \n unless(system(cmd))\n raise \"Failed to create KVM instance!\"\n end \nend", "def create_service\n super.tap do |service_template|\n service_template.cookbook('poise-service')\n create_monit_config\n end\n end", "def add_tier\n begin\n with_transaction do\n Tier.create!(\n name: params[:name],\n stage: params[:stage],\n pipeline_id: @pipeline.id\n )\n\n render json: tiers_for_pipeline_view\n end\n rescue Exception => e\n error = \"#{ConfluxErrors::TierCreationFailed} - #{e}\"\n logger.error { error }\n render json: { message: error }, status: 500\n end\n end", "def create_kubernetes_virtual_machine_instance_type_with_http_info(kubernetes_virtual_machine_instance_type, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: KubernetesApi.create_kubernetes_virtual_machine_instance_type ...'\n end\n # verify the required parameter 'kubernetes_virtual_machine_instance_type' is set\n if @api_client.config.client_side_validation && kubernetes_virtual_machine_instance_type.nil?\n fail ArgumentError, \"Missing the required parameter 'kubernetes_virtual_machine_instance_type' when calling KubernetesApi.create_kubernetes_virtual_machine_instance_type\"\n end\n # resource path\n local_var_path = '/api/v1/kubernetes/VirtualMachineInstanceTypes'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(kubernetes_virtual_machine_instance_type)\n\n # return_type\n return_type = opts[:debug_return_type] || 'KubernetesVirtualMachineInstanceType'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"KubernetesApi.create_kubernetes_virtual_machine_instance_type\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: KubernetesApi#create_kubernetes_virtual_machine_instance_type\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def service_create(name, display_name, executable_on_host,startup=2)\n\t\tif session_has_services_depend?\n\t\t\tmeterpreter_service_create(name, display_name, executable_on_host,startup)\n\t\telse\n\t\t\tshell_service_create(name, display_name, executable_on_host,startup)\n\t\tend\n\tend", "def create_kvm(kvm_name, template, options)\n ensure_name_availability!(kvm_name)\n clone_kvm(kvm_name, template)\n device = mount_kvm_volume(kvm_name)\n address = update_kvm_ip(kvm_name)\n update_hostname(kvm_name)\n make_console_accessible(kvm_name)\n unmount_kvm_volume(kvm_name, device)\n create_kvm_instance(kvm_name, options)\n puts \"KVM Node #{kvm_name} available at: #{address}\"\nend", "def create_or_replace_tier1_with_http_info(tier_1_id, tier1, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1\"\n end\n # verify the required parameter 'tier1' is set\n if @api_client.config.client_side_validation && tier1.nil?\n fail ArgumentError, \"Missing the required parameter 'tier1' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(tier1)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#create_or_replace_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_instance(credentials, image_id, opts)\n new_vapp = nil\n vapp_opts = {} #assemble options to pass to Fog::Terremark::Real.instantiate_vapp_template\n terremark_hwp = hardware_profiles(credentials, {:name => 'default'}).first #sanity check values against default\n name = opts[:name]\n if not name\n name = \"inst#{Time.now.to_i}\"\n end\n if name.length > USER_NAME_MAX\n raise \"Parameter name must be #{USER_NAME_MAX} characters or less\"\n end\n unless ( (terremark_hwp.include?(:cpu, opts[:hwp_cpu].to_i)) &&\n (terremark_hwp.include?(:memory, opts[:hwp_memory].to_i)) ) then\n raise Deltacloud::Exceptions::ValidationFailure.new(\n StandardError.new(\"Error with cpu and/or memory values. you said cpu->#{opts[:hwp_cpu]} and mem->#{opts[:hwp_memory]}\")\n )\n end\n vapp_opts['cpus'] = opts[:hwp_cpu]\n vapp_opts['memory'] = opts[:hwp_memory]\n safely do\n terremark_client = new_client(credentials)\n#######\n#FIXME# what happens if there is an issue getting the new vapp id? (eg even though created succesfully)\n#######\n vapp_id = terremark_client.instantiate_vapp_template(name, image_id, vapp_opts).body['href'].split('/').last\n new_vapp = terremark_client.get_vapp(vapp_id)\n return convert_instance(new_vapp, terremark_client, credentials.user) #return an Instance object\n end\n end", "def create_or_replace_tier1_0_with_http_info(tier_1_id, tier1, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1_0\"\n end\n # verify the required parameter 'tier1' is set\n if @api_client.config.client_side_validation && tier1.nil?\n fail ArgumentError, \"Missing the required parameter 'tier1' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(tier1)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#create_or_replace_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_service_instance(name, space_guid, service_plan_id)\n service_plan_instance = CFoundry::V2::ServicePlan.new(service_plan_id, @client)\n service_instance = @client.managed_service_instance\n service_instance.name = name\n service_instance.service_plan = service_plan_instance\n service_instance.space = @client.space(space_guid)\n service_instance.create!\n service_instance\n end", "def create\n @t1 = T1.new(params[:t1])\n\n respond_to do |format|\n if @t1.save\n flash[:notice] = 'T1 was successfully created.'\n format.html { redirect_to(@t1) }\n format.xml { render :xml => @t1, :status => :created, :location => @t1 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @t1.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create_instance\n create_instances(1).first\n end", "def create_virtual_machine(params, options = {})\n image = get_image(params[:image])\n options[:os_type] = image.os_type\n validate_deployment_params(params, options)\n options[:deployment_name] ||= options[:cloud_service_name]\n Azure::Loggerx.info 'Creating deployment...'\n\n options[:cloud_service_name] ||= generate_cloud_service_name(params[:vm_name])\n options[:storage_account_name] ||= generate_storage_account_name(params[:vm_name])\n optionals = {}\n if options[:virtual_network_name]\n virtual_network_service = client.network_management\n virtual_networks = virtual_network_service.list_virtual_networks.select { |x| x.name == options[:virtual_network_name] }\n if virtual_networks.empty?\n Azure::Loggerx.error_with_exit \"Virtual network #{options[:virtual_network_name]} doesn't exists\"\n else\n vnet = virtual_networks.first\n if !vnet.affinity_group.empty?\n options[:affinity_group_name] = vnet.affinity_group\n else\n optionals[:location] = vnet.location\n end\n end\n elsif options[:affinity_group_name]\n optionals[:affinity_group_name] = options[:affinity_group_name]\n else\n optionals[:location] = params[:location]\n end\n cloud_service = client.cloud_service_management\n cloud_service.create_cloud_service(options[:cloud_service_name], optionals)\n cloud_service.upload_certificate(options[:cloud_service_name], params[:certificate]) unless params[:certificate].empty?\n unless image.category == 'User'\n options[:storage_account_name] ||= generate_storage_account_name(params[:vm_name])\n client.storage_management.create_storage_account(options[:storage_account_name], optionals)\n end\n body = Serialization.deployment_to_xml(params, image, options)\n path = \"/services/hostedservices/#{options[:cloud_service_name]}/deployments\"\n Azure::Loggerx.info 'Deployment in progress...'\n request = client.management_request(:post, path, body)\n request.call\n get_virtual_machine(params[:vm_name], options[:cloud_service_name])\n rescue Exception => e\n Azure::Loggerx.error_with_exit \"Failed to create virtual machine : \"+e.message\n end", "def create(id, name: nil, type: :PRODUCTION, labels: nil, clusters: nil)\n end", "def create\n @instance_name = InstanceName.new(params[:instance_name])\n\n respond_to do |format|\n if @instance_name.save\n flash[:notice] = 'InstanceName was successfully created.'\n format.html { redirect_to(@instance_name) }\n format.xml { render :xml => @instance_name, :status => :created, :location => @instance_name }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @instance_name.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'byod_policy_service_instance' is set\n if @api_client.config.client_side_validation && byod_policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'byod_policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(byod_policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_byod_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'byod_policy_service_instance' is set\n if @api_client.config.client_side_validation && byod_policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'byod_policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(byod_policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_byod_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_deployment\n @api.account_id = @options[:src]\n inputs = format_inputs(@old_deployment.show.inputs)\n\n params = {\n :deployment => {\n :name => @old_deployment.name,\n :description => @old_deployment.description\n }\n }\n\n puts \"\\nCreating deployment: \\\"#{params[:deployment][:name]}\\\" in account: #{@options[:dst]} ...\\n\\n\"\n\n @api.account_id = @options[:dst]\n result = @api.deployments.create(params)\n @new_deployment = result.href\n\n # Set deployment level inputs. Cannot set them at create time, so do it now\n deployment = @api.resource(@new_deployment)\n deployment_inputs = {}\n deployment_inputs[:inputs] = inputs\n deployment.inputs.multi_update(deployment_inputs)\nend", "def create\n @servicetype = Servicetype.new(params[:servicetype])\n\n respond_to do |format|\n if @servicetype.save\n format.html { redirect_to @servicetype, notice: 'Servicetype was successfully created.' }\n format.json { render json: @servicetype, status: :created, location: @servicetype }\n else\n format.html { render action: \"new\" }\n format.json { render json: @servicetype.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch_tier1_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_policy_service_instance\"\n end\n # verify the required parameter 'policy_service_instance' is set\n if @api_client.config.client_side_validation && policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#patch_tier1_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @instance_type = InstanceType.new(params[:instance_type])\n\n respond_to do |format|\n if @instance_type.save\n format.html { redirect_to @instance_type, notice: 'Instance type was successfully created.' }\n format.json { render json: @instance_type, status: :created, location: @instance_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @instance_type.errors, status: :unprocessable_entity }\n end\n end\n end", "def create(name, config)\n # @step: build the paramaters\n parameters = [\n { parameter_key: 'AvailabilityZones', parameter_value: config[:availability_zones] },\n { parameter_key: 'BucketName', parameter_value: @templates_bucket },\n { parameter_key: 'BucketVersion', parameter_value: @templates_version },\n { parameter_key: 'ClusterAutoScaler', parameter_value: 'Enabled' },\n { parameter_key: 'ClusterName', parameter_value: name },\n { parameter_key: 'KeyPairName', parameter_value: config[:ssh_keypair] },\n { parameter_key: 'KubernetesVersion', parameter_value: config[:version] },\n { parameter_key: 'NodeGroupName', parameter_value: 'compute' },\n { parameter_key: 'NodeInstanceType', parameter_value: config[:machine_type] },\n { parameter_key: 'NodeVolumeSize', parameter_value: config[:disk_size_gb].to_s },\n { parameter_key: 'NumberOfAZs', parameter_value: config[:availability_zones].split(',').size.to_s },\n { parameter_key: 'NumberOfNodes', parameter_value: config[:size].to_s },\n { parameter_key: 'PrivateSubnet1CIDR', parameter_value: config[:private_subnet1_cidr] },\n { parameter_key: 'PrivateSubnet2CIDR', parameter_value: config[:private_subnet2_cidr] },\n { parameter_key: 'PrivateSubnet3CIDR', parameter_value: config[:private_subnet3_cidr] },\n { parameter_key: 'PublicSubnet1CIDR', parameter_value: config[:public_subnet1_cidr] },\n { parameter_key: 'PublicSubnet2CIDR', parameter_value: config[:public_subnet2_cidr] },\n { parameter_key: 'PublicSubnet3CIDR', parameter_value: config[:public_subnet3_cidr] },\n { parameter_key: 'RemoteAccessCIDR', parameter_value: '0.0.0.0/0' },\n { parameter_key: 'VPCCIDR', parameter_value: config[:network] }\n ]\n\n # @step: provision the cloudformation stacks\n stack_name = 'aws-cluster'\n info \"provisioning the cloudFormation: #{stack_name}\"\n info \"using the template from: #{template_path(stack_name)}\"\n\n outputs = cloudformation(name, template_url: template_path(stack_name), parameters: parameters)\n\n info 'waiting for the kube apiserver to become available'\n client = HubClustersCreator::Kube.new(outputs['EKSEndpoint'], token: build_token(name))\n client.wait_for_kubeapi\n\n # @step: check if the awa-auth configmap exists already, we never overwrite\n unless client.exists?('aws-auth', 'kube-system', 'configmaps')\n info 'provition the aws-auth configureation configmap'\n client.kubectl(default_aws_auth(name))\n\n # @step: ensure we have some nodes\n info 'waiting for some nodes to become available'\n client.wait('aws-node', 'kube-system', 'daemonsets', version: 'extensions/v1beta1') do |x|\n x.status.numberReady.positive?\n end\n end\n\n # @step: provision the cluster\n info 'bootstraping the eks cluster'\n config[:credentials] = {\n access_id: @access_id,\n access_key: @access_key,\n account_id: @account_id,\n region: @region\n }\n\n result = HubClustersCreator::Providers::Bootstrap.new(name, 'eks', client, config).bootstrap\n {\n cluster: {\n ca: outputs['EKSCA'],\n endpoint: outputs['EKSEndpoint'],\n service_account_name: 'sysadmin',\n service_account_namespace: 'kube-system',\n service_account_token: Base64.decode64(client.account('sysadmin'))\n },\n config: config,\n services: result\n }\n end", "def create # rubocop:disable Metrics/AbcSize\n inst_details = AttrFinder.new(@instanceparameters)\n inst_details.options = @options\n inst_details.validate = @validate\n inst_details.function = 'server'\n BmcAuthenticate.new(@options)\n request = OracleBMC::Core::Models::LaunchInstanceDetails.new\n ssh_public_key = @instanceparameters['server']['ssh-key']\n request.availability_domain = inst_details.ad\n request.compartment_id = inst_details.compartment\n request.display_name = @instanceparameters['server']['display_name']\n request.image_id = inst_details.image\n request.shape = @instanceparameters['server']['shape']\n request.subnet_id = inst_details.subnet\n request.metadata = { 'ssh_authorized_keys' => ssh_public_key }\n api = OracleBMC::Core::ComputeClient.new\n response = api.launch_instance(request)\n @instance_id = response.data.id\n compartment(inst_details.compartment)\n running_instance = api.get_instance(@instance_id).wait_until(:lifecycle_state,\n OracleBMC::Core::Models::Instance::LIFECYCLE_STATE_RUNNING,\n max_interval_seconds: 5, max_wait_seconds: 300)\n if @instanceparameters['server']['attachments']\n @instanceparameters['server']['attachments'].each do |vol|\n attach(@instance_id, vol['volume'])\n end\n end\n running_instance\n end", "def create_tier1_policy_service_instance_0(tier_1_id, locale_service_id, service_instance_id, policy_service_instance, opts = {})\n data, _status_code, _headers = create_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, policy_service_instance, opts)\n data\n end", "def create_tier1_service_interface(tier_1_id, locale_service_id, interface_id, service_interface, opts = {})\n data, _status_code, _headers = create_tier1_service_interface_with_http_info(tier_1_id, locale_service_id, interface_id, service_interface, opts)\n data\n end", "def create_virtual_machine(params, options={})\n options[:os_type] = get_os_type(params[:image])\n options[:image_type] = get_image_type(params[:image])\n validate_deployment_params(params, options)\n options[:cloud_service_name] = generate_cloud_service_name(params[:vm_name]) unless options[:cloud_service_name]\n options[:storage_account_name] = generate_storage_account_name(params[:vm_name]) unless options[:storage_account_name] \n optionals = {}\n if options[:virtual_network_name]\n virtual_network_service = Azure::VirtualNetworkManagementService.new\n virtual_networks = virtual_network_service.list_virtual_networks.select{|x| x.name == options[:virtual_network_name]}\n if virtual_networks.empty?\n Loggerx.error_with_exit \"Virtual network #{options[:virtual_network_name]} doesn't exists\"\n else\n optionals[:affinity_group_name] = virtual_networks.first.affinity_group\n end\n elsif options[:affinity_group_name]\n optionals[:affinity_group_name] = options[:affinity_group_name]\n else\n optionals[:location] = params[:location]\n end \n cloud_service = Azure::CloudServiceManagementService.new\n cloud_service.create_cloud_service(options[:cloud_service_name], optionals)\n cloud_service.upload_certificate(options[:cloud_service_name],params[:certificate]) unless params[:certificate].empty?\n Azure::StorageManagementService.new.create_storage_account(options[:storage_account_name], optionals)\n\n body = Serialization.deployment_to_xml(params,options)\n path = \"/services/hostedservices/#{options[:cloud_service_name]}/deployments\"\n Loggerx.info \"Deployment in progress...\"\n request = ManagementHttpRequest.new(:post, path, body)\n request.call\n get_virtual_machine(params[:vm_name],options[:cloud_service_name])\n rescue Exception => e\n e.message\n end", "def create_pvm_instance(instance_hash)\n post(\"cloud-instances/#{guid}/pvm-instances\", instance_hash.to_json)\n end", "def create_tier1_service_instance_endpoint(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n data, _status_code, _headers = create_tier1_service_instance_endpoint_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts)\n data\n end", "def create\n @servicetype = Servicetype.new(params[:servicetype])\n\n respond_to do |format|\n if @servicetype.save\n format.html { redirect_to @servicetype, :notice => 'Servicetype was successfully created.' }\n format.json { render :json => @servicetype, :status => :created, :location => @servicetype }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @servicetype.errors, :status => :unprocessable_entity }\n end\n end\n end", "def patch_tier1_service_instance_endpoint_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_endpoint' is set\n if @api_client.config.client_side_validation && service_instance_endpoint.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_instance_endpoint)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#patch_tier1_service_instance_endpoint\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @instance_type = InstanceType.new(instance_type_params)\n\n respond_to do |format|\n if @instance_type.save\n format.html { redirect_to @instance_type, notice: 'Instance type was successfully created.' }\n format.json { render action: 'show', status: :created, location: @instance_type }\n else\n format.html { render action: 'new' }\n format.json { render json: @instance_type.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch_tier1_service_instance_endpoint_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint' is set\n if @api_client.config.client_side_validation && service_instance_endpoint.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_instance_endpoint)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#patch_tier1_service_instance_endpoint_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def post_compute(request)\n # --- Create the new Instance ---\n vm = VirtualMachineOCCI.new(\n VirtualMachine.build_xml,\n @client,\n request.body.read,\n @config[:instance_types],\n @config[:template_location])\n\n # --- Generate the template and Allocate the new Instance ---\n template = vm.to_one_template\n return template, 500 if OpenNebula.is_error?(template)\n\n rc = vm.allocate(template)\n if OpenNebula.is_error?(rc)\n return rc, CloudServer::HTTP_ERROR_CODE[rc.errno]\n end\n\n # --- Prepare XML Response ---\n vm.info\n return to_occi_xml(vm, :code=>201)\n end", "def create_service(resource, actions)\n service_name = get_service_name()\n\n case resource.service_type\n when \"upstart\"\n service service_name do\n provider Chef::Provider::Service::Upstart\n supports :status => true, :restart => true, :reload => true\n action actions\n end\n when \"init.d\"\n service service_name do\n supports :status => true, :restart => true, :reload => true\n action actions\n end\n else\n raise \"dashing: Unknown service_type '#{resource.service_type}'\"\n end\nend", "def start_pvm_instance(instance_id)\n post(\n \"cloud-instances/#{guid}/pvm-instances/#{instance_id}/action\",\n {\"action\" => \"start\"}.to_json\n )\n end", "def patch_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'policy_service_instance' is set\n if @api_client.config.client_side_validation && policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#patch_tier1_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_service(data=nil)\n if (!data.blank? && data.is_a?(Hash))\n @service = Service.create(data)\n else\n @service = Service.create(:name => \"Test Service #{rand(1..1000)}\", :description => \"Test service description.\", :active => true, :probe => \"dummy\", :probe_config => {:value => 1}, :interval => 60, :clean_interval => 86400, :priority => Service::PRIORITY_NORMAL, :resume => :mean_value)\n end\n end", "def create\n @instance = Instance.new(params[:instance])\n\n respond_to do |format|\n if @instance.save\n\n system(\"ssh root@#{CloudGui::Application.config.hypervisor_ip} \\\"exec /data/cloud/scripts/provision.sh #{params[:instance][:cpus]} #{params[:instance][:memory]} #{params[:instance][:baseimage]} 2>&1 | tee /data/cloud/logs/cloud_gui.log\\\"\")\n\n format.html { redirect_to @instance, notice: 'Instance was successfully created.' }\n format.json { render json: @instance, status: :created, location: @instance }\n else\n format.html { render action: \"new\" }\n format.json { render json: @instance.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n submenu_item 'services-new'\n @service = Service.new(params[:service])\n @service_type = @service.type\n service_param\n\n @service.tenant_id = current_user.tenant_id\n\n # service_params = Service.extract_params(params[:service])\n # service_params = Service.extract_thresholds(service_params)\n # @service = Service.new(service_params)\n\n respond_to do |format|\n if @service.save\n flash[:notice] = \"#{@service.name}创建成功\"\n format.html { redirect_to(@service) }\n else\n dictionary\n format.html { render :action => \"new\" }\n end\n end\n end", "def create_tier1_service_instance_endpoint_0(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n data, _status_code, _headers = create_tier1_service_instance_endpoint_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts)\n data\n end", "def create_or_patch_tier1_l2_vpn_service_0_with_http_info(tier_1_id, locale_service_id, service_id, l2_vpn_service, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'service_id' is set\n if @api_client.config.client_side_validation && service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'l2_vpn_service' is set\n if @api_client.config.client_side_validation && l2_vpn_service.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_vpn_service' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/l2vpn-services/{service-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-id' + '}', service_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_vpn_service)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi#create_or_patch_tier1_l2_vpn_service_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_service\n # Check signals here to be nice and abort early if possible.\n check_signals!\n # Enable automatically creates the service with Runit.\n directory \"/var/log/#{new_resource.service_name}\" do\n owner 'root'\n group 'root'\n mode '700'\n end\n end", "def create_tier1_service_interface_with_http_info(tier_1_id, locale_service_id, interface_id, service_interface, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface\"\n end\n # verify the required parameter 'service_interface' is set\n if @api_client.config.client_side_validation && service_interface.nil?\n fail ArgumentError, \"Missing the required parameter 'service_interface' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_interface)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#create_tier1_service_interface\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @recreation_service_typology = RecreationServiceTypology.new(recreation_service_typology_params)\n\n respond_to do |format|\n if @recreation_service_typology.save\n format.html { redirect_to @recreation_service_typology, notice: 'Recreation service typology was successfully created.' }\n format.json { render action: 'show', status: :created, location: @recreation_service_typology }\n else\n format.html { render action: 'new' }\n format.json { render json: @recreation_service_typology.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_vm(opts = {})\n opts = opts.with_indifferent_access.reverse_merge(\n VSphereConfig.create_vm_defaults.symbolize_keys || {}\n )\n\n opts[:template_path] = compute.image if compute.image\n\n VSphere.with_connection do |vs|\n dest_folder = opts[:dest_folder]\n vm_name = opts[:name] || \"#{compute.image}-\"\\\n \"#{SecureRandom.hex(4)}-#{Time.new.strftime(\"%Y%m%d\")}\"\n exception_cb = lambda do |_p1|\n LabManager.logger.warn(\n \"Failed attempt to create virtual machine: template_name: #{opts[:template_path]}\"\\\n \", vm_name: #{vm_name}\"\n )\n end\n\n Retryable.retryable(\n tries: VSphereConfig.create_vm_defaults[:vm_clone_retry_count],\n on: [RbVmomi::Fault, CreateVMError, Fog::Compute::Vsphere::NotFound],\n exception_cb: exception_cb,\n sleep: ->(n) { Random.rand(n*3..n*3+10.0) }\n ) do\n LabManager.logger.info \"creating machine with name: #{vm_name} options: #{opts.inspect}\"\n machine = vs.vm_clone(\n 'datacenter' => opts[:datacenter],\n 'datastore' => opts[:datastore],\n 'template_path' => opts[:template_path],\n 'name' => vm_name,\n 'cluster' => opts[:cluster],\n 'linked_clone' => opts[:linked_clone],\n 'dest_folder' => dest_folder,\n 'power_on' => opts[:power_on],\n 'wait' => true\n )\n\n setup_network_interfaces({\n uuid: machine['new_vm']['uuid'],\n connection: vs,\n network_name: VSphereConfig.create_vm_defaults[:network_interface_name]\n })\n\n fail CreateVMError, \"Creation of (#{vm_name}) machine failed, retrying\" unless machine || machine['vm_ref']\n set_provider_data(machine['new_vm'], vs: vs)\n end\n\n add_machine_to_drs_rule(\n vs,\n group: opts[:add_to_drs_group],\n machine: \"#{dest_folder}/#{vm_name}\",\n datacenter: opts[:datacenter]\n ) if opts[:add_to_drs_group]\n end\n poweron_vm unless compute.provider_data['power_state'] == 'poweredOn'\n rescue\n # Try to free unsuccessfully started/configured/... VM\n begin\n terminate_vm\n rescue\n nil\n end if instance_uuid\n raise\n end", "def create_virtual_machine(vm)\n kubevirt_client.create_virtual_machine(vm)\n end", "def create_tier1_policy_service_instance(tier_1_id, locale_service_id, service_instance_id, policy_service_instance, opts = {})\n data, _status_code, _headers = create_tier1_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, policy_service_instance, opts)\n data\n end", "def create_tier1_byod_policy_service_instance_0(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts = {})\n data, _status_code, _headers = create_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts)\n data\n end", "def new\n @service = Service.new\n\n # If a valid type is received, apply to the host to create.\n check_priority_param\n @service.priority = @priority if([email protected]?)\n\n # Add custom views paths\n prepend_view_path \"app/views/services\"\n prepend_view_path \"lib/probes/#{@service.probe}/views\"\n\n respond_to do |format|\n format.html\n end\n end", "def createEc2Instance\n\n instance_descriptor = {\n :image_id => @config[\"image_id\"],\n :key_name => @deploy.ssh_key_name,\n :instance_type => @config[\"size\"],\n :disable_api_termination => true,\n :min_count => 1,\n :max_count => 1\n }\n\n instance_descriptor[:iam_instance_profile] = getIAMProfile\n\n security_groups = myFirewallRules.map { |fw| fw.cloud_id }\n if security_groups.size > 0\n instance_descriptor[:security_group_ids] = security_groups\n else\n raise MuError, \"Didn't get any security groups assigned to be in #{@mu_name}, that shouldn't happen\"\n end\n\n if @config['private_ip']\n instance_descriptor[:private_ip_address] = @config['private_ip']\n end\n\n if [email protected]? and @config.has_key?(\"vpc\")\n subnet = mySubnets.sample\n if subnet.nil?\n raise MuError, \"Got null subnet id out of #{@config['vpc']}\"\n end\n MU.log \"Deploying #{@mu_name} into VPC #{@vpc.cloud_id} Subnet #{subnet.cloud_id}\"\n allowBastionAccess\n instance_descriptor[:subnet_id] = subnet.cloud_id\n end\n\n if [email protected]? and [email protected]?\n instance_descriptor[:user_data] = Base64.encode64(@userdata)\n end\n\n MU::Cloud::AWS::Server.waitForAMI(@config[\"image_id\"], region: @region, credentials: @credentials)\n\n instance_descriptor[:block_device_mappings] = MU::Cloud::AWS::Server.configureBlockDevices(image_id: @config[\"image_id\"], storage: @config['storage'], region: @region, credentials: @credentials)\n\n instance_descriptor[:monitoring] = {enabled: @config['monitoring']}\n\n if @tags and @tags.size > 0\n instance_descriptor[:tag_specifications] = [{\n :resource_type => \"instance\",\n :tags => @tags.keys.map { |k|\n { :key => k, :value => @tags[k] }\n }\n }]\n end\n\n MU.log \"Creating EC2 instance #{@mu_name}\", details: instance_descriptor\n\n instance = resp = nil\n loop_if = Proc.new {\n instance = resp.instances.first if resp and resp.instances\n resp.nil? or resp.instances.nil? or instance.nil?\n }\n\n bad_subnets = []\n mysubnet_ids = if mySubnets\n mySubnets.map { |s| s.cloud_id }\n end\n begin\n MU.retrier([Aws::EC2::Errors::InvalidGroupNotFound, Aws::EC2::Errors::InvalidSubnetIDNotFound, Aws::EC2::Errors::InvalidParameterValue], loop_if: loop_if, loop_msg: \"Waiting for run_instances to return #{@mu_name}\") {\n resp = MU::Cloud::AWS.ec2(region: @region, credentials: @credentials).run_instances(instance_descriptor)\n }\n rescue Aws::EC2::Errors::Unsupported => e\n bad_subnets << instance_descriptor[:subnet_id]\n better_subnet = (mysubnet_ids - bad_subnets).sample\n if e.message !~ /is not supported in your requested Availability Zone/ and\n (mysubnet_ids.nil? or mysubnet_ids.empty? or\n mysubnet_ids.size == bad_subnets.size or\n better_subnet.nil? or better_subnet == \"\")\n raise MuError.new e.message, details: mysubnet_ids\n end\n instance_descriptor[:subnet_id] = (mysubnet_ids - bad_subnets).sample\n if instance_descriptor[:subnet_id].nil?\n raise MuError.new \"Specified subnet#{bad_subnets.size > 1 ? \"s do\" : \" does\"} not support instance type #{instance_descriptor[:instance_type]}\", details: bad_subnets\n end\n MU.log \"One or more subnets does not support instance type #{instance_descriptor[:instance_type]}, attempting with #{instance_descriptor[:subnet_id]} instead\", MU::WARN, details: bad_subnets\n retry\n rescue Aws::EC2::Errors::InvalidRequest => e\n MU.log e.message, MU::ERR, details: instance_descriptor\n raise e\n end\n\n MU.log \"#{@mu_name} (#{instance.instance_id}) coming online\"\n\n instance\n end", "def create\n req = VCAP::Services::Api::ServiceOfferingRequest.decode(request_body)\n logger.debug(\"Create service request: #{req.extract.inspect}\")\n\n # Should we worry about a race here?\n\n success = nil\n svc = Service.find_by_label(req.label)\n if svc\n raise CloudError.new(CloudError::FORBIDDEN) unless svc.verify_auth_token(@service_auth_token)\n attrs = req.extract.dup\n attrs.delete(:label)\n # Keep DB in sync with configs if the token changes in the config\n attrs[:token] = @service_auth_token if svc.is_builtin?\n svc.update_attributes!(attrs)\n else\n # Service doesn't exist yet. This can only happen for builtin services since service providers must\n # register with us to get a token.\n svc = Service.new(req.extract)\n raise CloudError.new(CloudError::FORBIDDEN) unless svc.is_builtin? && svc.verify_auth_token(@service_auth_token)\n svc.token = @service_auth_token\n svc.save!\n end\n\n render :json => {}\n end", "def create\n @idti_service = IdtiService.new(idti_service_params)\n\n respond_to do |format|\n if @idti_service.save\n format.html { redirect_to @idti_service, notice: 'Idti service was successfully created.' }\n format.json { render :show, status: :created, location: @idti_service }\n else\n format.html { render :new }\n format.json { render json: @idti_service.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_tier1_service_interface_0_with_http_info(tier_1_id, locale_service_id, interface_id, service_interface, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface_0\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface_0\"\n end\n # verify the required parameter 'service_interface' is set\n if @api_client.config.client_side_validation && service_interface.nil?\n fail ArgumentError, \"Missing the required parameter 'service_interface' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_interface)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#create_tier1_service_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def createEc2Instance\n\t\t name = @server[\"name\"]\n\t\t node = @server['mu_name']\n\t\t\tbegin\n\t\t\t\t@server['iam_role'] = MU::Server.createIAMProfile(\"Server-\"+name, base_profile: @server['iam_role'], extra_policies: @server['iam_policies'])\n\t\t\trescue Aws::EC2::Errors::RequestLimitExceeded => e\n\t\t\t\tsleep 10\n\t\t\t\tretry\n\t\t\tend\n\t\t\t@server['iam_role'] = @server['iam_role']\n\n\t\t\tbegin\n\t\t\t\[email protected]\n\t\t\trescue Aws::EC2::Errors::RequestLimitExceeded => e\n\t\t\t\tsleep 10\n\t\t\t\tretry\n\t\t\tend\n\n\t\t instance_descriptor = {\n\t\t :image_id => @server[\"ami_id\"],\n\t\t :key_name => @deploy.keypairname,\n\t\t :instance_type => @server[\"size\"],\n\t\t :disable_api_termination => true,\n\t\t :min_count => 1,\n\t\t :max_count => 1,\n\t\t\t\t:network_interfaces => [\n\t\t\t\t\t{\n\t\t\t\t\t\t:associate_public_ip_address => name[\"associate_public_ip\"]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t }\n\t\t\t\n\t\t\tif !@server['private_ip'].nil?\n\t\t\t\tinstance_descriptor[:private_ip_address] = @server['private_ip']\n\t\t\tend\n\n\t\t\tvpc_id=subnet_id=nat_host_name=nat_ssh_user = nil\n\t\t\tsubnet_retries = 0\n\t\t\tif !@server[\"vpc\"].nil?\n\t\t\t\tbegin\n\t\t\t\t\tvpc_id, subnet_ids, nat_host_name, nat_ssh_user = MU::VPC.parseVPC(@server['vpc'])\n\t\t\t\trescue Aws::EC2::Errors::ServiceError => e\n\t\t\t\t\tMU.log e.message, MU::ERR, details: @server\n\t\t\t\t\tif subnet_retries < 5\n\t\t\t\t\t subnet_retries = subnet_retries + 1\n\t\t\t\t\t sleep 15\n\t\t\t\t\t retry\n\t\t\t\t\tend\n\t\t\t\t\traise e\n\t\t\t\tend\n\t\t\t\tsubnet_id = subnet_ids.first\n\t\t\t\tif subnet_id.nil? or subnet_id.empty?\n\t\t\t\t\tMU.log \"Got null Subnet id out of #{@server['vpc']}\", MU::ERR\n\t\t\t\t\traise \"deploy failure\"\n\t\t\t\tend\n\n\t\t\t\tMU.log \"Deploying #{node} into VPC #{vpc_id} Subnet #{subnet_id}\"\n\n\t\t\t\tif !@server[\"vpc\"][\"nat_host_name\"].nil? or !@server[\"vpc\"][\"nat_host_id\"].nil?\n\t\t\t\t\tadmin_sg = MU::Server.punchAdminNAT(@server, node)\n\t\t\t\telse\n\t\t\t\t\tadmin_sg = MU::FirewallRule.setAdminSG(vpc_id: vpc_id, region: @server['region'])\n\t\t\t\tend\n\n\t\t\t\tinstance_descriptor[:subnet_id] = subnet_id\n\t\t\t\tnode_sg = MU::FirewallRule.createEc2SG(\n\t\t\t\t\t\t@server[\"name\"].upcase,\n\t\t\t\t\t\t@server[\"ingress_rules\"],\n\t\t\t\t\t\tdescription: \"SG holes for #{node}\",\n\t\t\t\t\t\tvpc_id: vpc_id,\n\t\t\t\t\t\tregion: @server['region']\n\t\t\t\t)\n\t\t\telse\n\t\t\t\tadmin_sg = MU::FirewallRule.setAdminSG(region: @server['region'])\n\t\t\t\tnode_sg = MU::FirewallRule.createEc2SG(\n\t\t\t\t\t\t@server[\"name\"].upcase,\n\t\t\t\t\t\t@server[\"ingress_rules\"],\n\t\t\t\t\t\tdescription: \"SG holes for #{node}\",\n\t\t\t\t\t\tregion: @server['region']\n\t\t\t\t)\n\t\t\tend\n\t\t\tsecurity_groups = Array.new\n\t\t\tsecurity_groups << admin_sg\n\t\t\tsecurity_groups << node_sg\n\t\t\tif !@server[\"add_firewall_rules\"].nil?\n\t\t\t\t@server[\"add_firewall_rules\"].each { |acl|\n\t\t\t\t\tsg = MU::FirewallRule.find(sg_id: acl[\"rule_id\"], name: acl[\"rule_name\"], region: @server['region'])\n\t\t\t\t\tif sg.nil?\n\t\t\t\t\t\tMU.log \"Couldn't find dependent security group #{acl} for server #{node}\", MU::ERR\n\t\t\t\t\t\traise \"deploy failure\"\n\t\t\t\t\tend\n\t\t\t\t\tsecurity_groups << sg.group_id\n\t\t\t\t}\n\t\t\tend\n\n\t\t\tinstance_descriptor[:security_group_ids] = security_groups\n\n\t\t if [email protected]? and [email protected]?\n\t\t instance_descriptor[:user_data] = Base64.encode64(@userdata)\n\t\t end\n\n\t\t if !@server[\"iam_role\"].nil?\n\t\t instance_descriptor[:iam_instance_profile] = { name: @server[\"iam_role\"]}\n\t\t end\n\n\t\t\tconfigured_storage = Array.new\n\t\t\tif @server[\"storage\"]\n\t\t\t\t@server[\"storage\"].each { |vol|\n\t\t\t\t\tconfigured_storage << MU::Server.convertBlockDeviceMapping(vol)\n\t\t\t\t}\n\t\t\tend\n\t\t\n\t\t\tMU::Server.waitForAMI(@server[\"ami_id\"], region: @server['region'])\n\n\t\t\tinstance_descriptor[:block_device_mappings] = configured_storage\n\t\t\tinstance_descriptor[:block_device_mappings].concat(@ephemeral_mappings)\n\n\t\t\tinstance_descriptor[:monitoring] = { enabled: @server['monitoring'] }\n\n\t\t\tMU.log \"Creating EC2 instance #{node}\"\n\t\t\tMU.log \"Instance details for #{node}: #{instance_descriptor}\", MU::DEBUG\n#\t\t\t\tif instance_descriptor[:block_device_mappings].empty?\n#\t\t\t\t\tinstance_descriptor.delete(:block_device_mappings)\n#\t\t\t\tend\n#pp instance_descriptor[:block_device_mappings]\n\t\t\tretries = 0\n\t\t\tbegin\n\t\t\t\tresponse = MU.ec2(@server['region']).run_instances(instance_descriptor)\n\t\t\trescue Aws::EC2::Errors::InvalidGroupNotFound, Aws::EC2::Errors::InvalidSubnetIDNotFound, Aws::EC2::Errors::InvalidParameterValue, Aws::EC2::Errors::RequestLimitExceeded => e\n\t\t\t\tif retries < 10\n\t\t\t\t\tif retries > 7\n\t\t\t\t\t\tMU.log \"Seeing #{e.inspect} while trying to launch #{node}, retrying a few more times...\", MU::WARN, details: instance_descriptor\n\t\t\t\t\tend\n\t\t\t\t\tsleep 10\n\t\t\t\t\tretries = retries + 1\n\t\t\t\t\tretry\n\t\t\t\telse\n\t\t\t\t\traise e\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tinstance = response.instances.first\n\t\t\tMU.log \"#{node} (#{instance.instance_id}) coming online\"\n\n\n\t\t\treturn instance\n\n\t\tend", "def execute\n log.info 'Creating the Basic VM'\n placement_spec = VMPlacementHelper.get_placementspec_vm(service_manager.vapi_config, datacenter_name, folder_name, datastore_name)\n standard_network = NetworkHelper.get_standard_network_mapping(service_manager.vapi_config, @datacenter_name, standard_portgroup_name)\n boot_disk = VCENTER_HARDWARE_DISK_CLASS::CreateSpec.new('type' => VCENTER_HARDWARE_DISK_CLASS::HostBusAdapterType::SCSI,\n 'scsi' => VCENTER_HARDWARE_MODULE::ScsiAddressSpec.new('bus'=>0,'unit'=>0),\n 'new_vmdk' => VCENTER_HARDWARE_DISK_CLASS::VmdkCreateSpec.new() )\n data_disk = VCENTER_HARDWARE_DISK_CLASS::CreateSpec.new('new_vmdk' => VCENTER_HARDWARE_DISK_CLASS::VmdkCreateSpec.new())\n ethernet_nic_0 = VCENTER_HARDWARE_ETHERNET_CLASS::CreateSpec.new('start_connected' => true,\n 'backing' => VCENTER_HARDWARE_ETHERNET_CLASS::BackingSpec.new(\n 'type' => VCENTER_HARDWARE_ETHERNET_CLASS::BackingType::STANDARD_PORTGROUP,\n 'network' => standard_network))\n boot_device_order = [VCENTER_HARDWARE_BOOT_DEVICE_CLASS::EntryCreateSpec.new('type' => VCENTER_HARDWARE_BOOT_DEVICE_CLASS::Type::ETHERNET),\n VCENTER_HARDWARE_BOOT_DEVICE_CLASS::EntryCreateSpec.new('type' => VCENTER_HARDWARE_BOOT_DEVICE_CLASS::Type::DISK)]\n vm_create_spec = VCENTER_VM_CLASS::CreateSpec.new('name' => vm_name,\n 'guest_OS' => VCENTER_VM_GUESTOS_CLASS::WINDOWS_8_64,\n 'placement' => placement_spec,\n 'disks' => [boot_disk, data_disk],\n 'nics' => [ethernet_nic_0],\n 'boot_devices' => boot_device_order)\n log.info 'The CreateVM Spec is '\n #Pretty print the create spec of the VM.\n pp vm_create_spec\n vm_id = vm_svc.create(vm_create_spec)\n log.info \"Created vm #{vm_name} with the VM Identifier #{vm_id}\"\n end", "def create\n @deployment = Deployment.new(deployment_params)\n\n respond_to do |format|\n if @deployment.save\n format.html { redirect_to @deployment, notice: 'Deployment was successfully created.' }\n format.json { render :show, status: :created, location: @deployment }\n else\n format.html { render :new }\n format.json { render json: @deployment.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_instance_template request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n uri, body, query_string_params = transcode_set_instance_template_request request_pb\n response = @client_stub.make_post_request(\n uri: uri,\n body: body,\n params: query_string_params,\n options: options\n )\n result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true\n\n yield result, response if block_given?\n result\n end", "def create\n params[:deployment_id] = Deployment.find_key(params[:deployment]).id if params.has_key? :deployment\n params[:deployment_id] ||= Deployment.system\n params.require(:name)\n params.require(:deployment_id)\n default_net = nil\n Node.transaction do\n @node = Node.create!(params.permit(:name,\n :description,\n :admin,\n :deployment_id,\n :allocated,\n :alive,\n :system,\n :available,\n :bootenv))\n # Keep suport for mac and ip hints in short form around for legacy Sledgehammer purposes\n if params[:ip]\n default_net = Network.lookup_network(params[:ip]) ||\n Network.find_by_name(\"unmanaged\")\n Attrib.set(\"hint-#{default_net.name}-v4addr\",@node,params[:ip]) if default_net\n Attrib.set(\"hint-admin-macs\", @node, [params[:mac]]) if params[:mac]\n end\n end\n default_net.make_node_role(@node) if default_net\n render api_show @node\n end", "def create\n super(@@service)\n end", "def delete_tier1_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#delete_tier1_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_patch_tier1_l2_vpn_service_with_http_info(tier_1_id, locale_service_id, service_id, l2_vpn_service, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service\"\n end\n # verify the required parameter 'service_id' is set\n if @api_client.config.client_side_validation && service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service\"\n end\n # verify the required parameter 'l2_vpn_service' is set\n if @api_client.config.client_side_validation && l2_vpn_service.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_vpn_service' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/l2vpn-services/{service-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-id' + '}', service_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_vpn_service)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi#create_or_patch_tier1_l2_vpn_service\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @deployment = current_user.deployments.new(params[:deployment])\n\n respond_to do |format|\n if @deployment.save\n unless @deployment.environment.running?\n @deployment.environment.start!\n end\n format.html { redirect_to(@deployment.app, :notice => 'Application was successfully deployed.') }\n format.xml { render :xml => @deployment, :status => :created, :location => @deployment }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @deployment.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @deployment = Deployment.new(params[:deployment])\n\n respond_to do |format|\n if @deployment.save\n format.html { redirect_to @deployment, notice: 'Deployment was successfully created.' }\n format.json { render json: @deployment, status: :created, location: @deployment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @deployment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_tier1_byod_policy_service_instance(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts = {})\n data, _status_code, _headers = create_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts)\n data\n end", "def create\n @instance = @provider.instances.new(params[:instance])\n @instance.state = \"Building\"\n respond_to do |format|\n if @instance.save\n @instance.create_instance(@provider.connect!)\n format.html { redirect_to cloud_provider_instance_path(@provider,@instance), notice: 'Instance was successfully created.' }\n format.json { render json: @instance, status: :created, location: @instance }\n else\n format.html { render action: \"new\" }\n format.json { render json: @instance.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_resource(env)\n env[:ui].info(\"Creating machine\")\n\n config = env[:machine].provider_config\n vra = env[:vra]\n\n EntitledItemsCollection.fetch(env[:vra])\n .find_by_id(config.catalog_item_id)\n .request(cpus: config.cpus,\n memory: config.memory,\n requested_for: config.requested_for,\n subtenant_id: config.subtenant_id,\n lease_days: config.lease_days) { |req|\n config.extra_entries.types.each do |type|\n config.extra_entries.of_type(type).each do |k,v|\n req.set_parameter(k, type, v)\n end\n end\n }\n .join\n .machine\n end", "def create\n @instance_fault = InstanceFault.new(params[:instance_fault])\n\n respond_to do |format|\n if @instance_fault.save\n format.html { redirect_to @instance_fault, notice: 'Instance fault was successfully created.' }\n format.json { render json: @instance_fault, status: :created, location: @instance_fault }\n else\n format.html { render action: \"new\" }\n format.json { render json: @instance_fault.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tb_servicio = TbServicio.new(tb_servicio_params)\n\n respond_to do |format|\n if @tb_servicio.save\n format.html { redirect_to @tb_servicio, notice: 'Tb servicio was successfully created.' }\n format.json { render :show, status: :created, location: @tb_servicio }\n else\n format.html { render :new }\n format.json { render json: @tb_servicio.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @taxi_sevice = TaxiSevice.new(taxi_sevice_params)\n\n respond_to do |format|\n if @taxi_sevice.save\n format.html { redirect_to action: \"index\" }\n else\n format.html { render :new }\n format.json { render json: @taxi_sevice.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_update_tier1_l2_vpn_service_0_with_http_info(tier_1_id, locale_service_id, service_id, l2_vpn_service, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'service_id' is set\n if @api_client.config.client_side_validation && service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'l2_vpn_service' is set\n if @api_client.config.client_side_validation && l2_vpn_service.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_vpn_service' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/l2vpn-services/{service-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-id' + '}', service_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_vpn_service)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2VPNService')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi#create_or_update_tier1_l2_vpn_service_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_on_backend\n lab = Lab.find(self.lab_id)\n Rails.logger.info \"Creating tenant #{self.name} on openstack backend #{lab.name}.\"\n\n # First, run through some checks to ensure we can create the whole tenant properly\n # Check if an external network exists\n admin_network_c = lab.get_neutron(lab.auth_tenant) \n ext_network = admin_network_c.list_networks.select {|n| n.external == true}\n if ext_network.empty?\n Rails.logger.error \"There are no external networks on the OpenStack host\"\n return false\n end\n\n # Check if there are enough available floating ips\n # There does not appear to be an api endpoint to check ips available for an instance to check out\n # TODO - Take another look at this.\n\n # Create the tenant\n identity_c = get_connection(\"identity\")\n identity_c.create_tenant({:name => self.name, :description => \"Created by OpenShift Labs app\", :enabled => true})\n tenant = identity_c.tenants.select {|t| t.name == self.name}.first\n if tenant.nil?\n Rails.logger.error \"Attempted to create tenant with name #{self.name}, but tenant does not exist after creation.\"\n return false\n else\n Rails.logger.info \"Created tenant #{self.name} with tenant id #{tenant.id}.\"\n self.uuid = tenant.id\n end\n\n # If any of the following fails, we need to be sure we delete the OpenStack backend tenant\n begin\n\n # Add the lab's user to the tenant\n # TODO the below assumes an admin role exists. Need to verify that this is always the case.\n role = identity_c.list_roles.select {|r| r[:name] == \"admin\"}.first\n admin_user = identity_c.list_users.select {|u| u.name == lab.username }.first\n Rails.logger.info \"Adding user #{admin_user.name} to the #{self.name} tenant.\"\n identity_c.add_user_to_tenant({:tenant_id => tenant.id, :role_id => role[:id], :user_id => admin_user.id})\n\n # Get the compute and neutron connections\n compute_c = get_connection(\"compute\")\n network_c = get_connection(\"network\")\n\n # Set the quotas appropriately\n # Works needs to be done in the ruby-openstack gem to support this.\n Rails.logger.info \"Setting #{self.name} tenant quotas.\"\n compute_c.set_limits(tenant.id, {:cores => lab.default_quota_cores,\n :floating_ips => lab.default_quota_instances,\n :instances => lab.default_quota_instances,\n :ram => lab.default_quota_ram\n })\n\n # Create a network\n network_name = self.name + \"-network\"\n Rails.logger.info \"Creating network with name #{network_name} for tenant #{self.name}.\"\n network = network_c.create_network(network_name, {:admin_state_up => true})\n self.network = network_name\n\n # Create a subnet\n subnet_name = self.name + \"-subnet\"\n # TODO nameservers are hard-coded, but could change. Need to have them entered somewhere.\n Rails.logger.info \"Creating subnet with name #{subnet_name} for tenant #{self.name}.\"\n subnet = network_c.create_subnet(network.id, \"192.168.1.0/24\", \"4\", {:name => subnet_name, :gateway_ip => \"192.168.1.1\", :enable_dhcp => true, :dns_nameservers => ['10.11.5.3', '10.11.5.4']})\n\n # Create a router and add interface to subnet\n router_name = self.name + \"-router\"\n # TODO we grab the first external network, we should have a user specify which one to use somewhere, in case there are multiple\n external_network = network_c.list_networks.select {|n| n.external == true }.first\n Rails.logger.info \"Creating router with name #{router_name} for tenant #{self.name}.\"\n router = network_c.create_router(router_name, true, {:external_gateway_info => {:network_id => external_network.id}})\n Rails.logger.info \"Adding router interface for subnet #{subnet_name} on router #{router_name}.\"\n network_c.add_router_interface(router.id, subnet.id)\n\n # Get the default security group\n # TODO we assume there is a default security group, probably not the best way to go about this.\n security_group = compute_c.security_groups.select {|k,v| v[:name] == \"default\"}\n self.security_group = \"default\"\n security_group_id = security_group.keys.first\n\n # Delete default security group rules\n Rails.logger.info \"Removing default Ingress security group rules for tenant #{self.name}.\"\n security_group[security_group_id][:rules].each do |rule|\n compute_c.delete_security_group_rule(rule[:id])\n end\n\n # Create necessary security group rules\n Rails.logger.info \"Creating all-open security groups rules for tcp, udp, and icmp on tenant #{self.name}\"\n compute_c.create_security_group_rule(security_group_id, \n {:ip_protocol => \"tcp\", :from_port => 1, :to_port => 65535, :cidr => \"0.0.0.0/0\"})\n compute_c.create_security_group_rule(security_group_id, \n {:ip_protocol => \"udp\", :from_port => 1, :to_port => 65535, :cidr => \"0.0.0.0/0\"})\n compute_c.create_security_group_rule(security_group_id, \n {:ip_protocol => \"icmp\", :from_port => -1, :to_port => -1, :cidr => \"0.0.0.0/0\"})\n\n # Allocate all necessary floating ips\n # TODO shouldn't just get the first pool, should have a dropdown and database entry in project\n Rails.logger.info \"Allocating #{lab.default_quota_instances} floating ips to tenant #{self.name}\"\n floating_ip_pool = compute_c.get_floating_ip_pools.first[\"name\"]\n lab.default_quota_instances.times do\n compute_c.create_floating_ip(:pool => floating_ip_pool)\n end\n \n Rails.logger.info \"Tenant #{self.name} creation completed.\"\n rescue => e\n Rails.logger.error \"Could not create OpenStack backend tenant due to:\"\n Rails.logger.error e.message\n Rails.logger.error e.backtrace\n destroy_backend\n end\n\n end", "def create\n @item_tier = ItemTier.new(item_tier_params)\n\n respond_to do |format|\n if @item_tier.save\n format.html { redirect_to @item_tier, notice: 'Item tier was successfully created.' }\n format.json { render :show, status: :created, location: @item_tier }\n else\n format.html { render :new }\n format.json { render json: @item_tier.errors, status: :unprocessable_entity }\n end\n end\n end", "def create(cluster_id)\n # create ONE object\n new_object\n\n rc = @one.allocate(format_template(@p_template), cluster_id)\n Utils.exception(rc)\n rc = @one.info\n Utils.exception(rc)\n\n OneProvisionLogger.debug(\n \"#{@type} created with ID: #{@one.id}\"\n )\n\n Integer(@one.id)\n end", "def create_tier1_service_interface_0(tier_1_id, locale_service_id, interface_id, service_interface, opts = {})\n data, _status_code, _headers = create_tier1_service_interface_0_with_http_info(tier_1_id, locale_service_id, interface_id, service_interface, opts)\n data\n end", "def new\n @tier_setting = TierSetting.new(tier: @week.next_missing_tier)\n end", "def create\n @tc_detail_step = TcDetailStep.new(params[:tc_detail_step])\n\n respond_to do |format|\n if @tc_detail_step.save\n format.html { redirect_to @tc_detail_step, notice: 'Tc detail step was successfully created.' }\n format.json { render json: @tc_detail_step, status: :created, location: @tc_detail_step }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tc_detail_step.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n deploy\n end", "def delete_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#delete_tier1_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def start\n service.pool_action uuid, :create\n end", "def create_or_replace_tier1_locale_services_0_with_http_info(tier_1_id, locale_services_id, locale_services, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services_0\"\n end\n # verify the required parameter 'locale_services' is set\n if @api_client.config.client_side_validation && locale_services.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(locale_services)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#create_or_replace_tier1_locale_services_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_sap_pvm_instance(instance_hash)\n post(\"cloud-instances/#{guid}/sap\", instance_hash.to_json)\n end", "def create\n @tm_dev1 = TmDev1.new(params[:tm_dev1])\n\n respond_to do |format|\n if @tm_dev1.save\n flash[:notice] = 'TmDev1 was successfully created.'\n format.html { redirect_to(@tm_dev1) }\n format.xml { render :xml => @tm_dev1, :status => :created, :location => @tm_dev1 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @tm_dev1.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create_or_replace_tier1_locale_services_with_http_info(tier_1_id, locale_services_id, locale_services, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services\"\n end\n # verify the required parameter 'locale_services' is set\n if @api_client.config.client_side_validation && locale_services.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(locale_services)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#create_or_replace_tier1_locale_services\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n response.add(exec: \"kubectl create ns #{namespace}\", env: kube_env)\n response.add(exec: \"kubectl label namespace #{namespace} istio-injection=enabled --overwrite\", env: kube_env)\n # errors.add(:kubectl_label_namespace, stderr) if exit_code.positive? and stderr.index('AlreadyExists').nil?\n\n # deploy helm into namespace\n # TODO: Need to generate tiller-rbac\n response.add(exec: kubectl(\"apply -f #{target.write_path}/tiller-k8s-ns.yml\"), env: kube_env)\n response.add(exec: 'helm init --upgrade --wait --service-account tiller', env: kube_env)\n end", "def read_tier1_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def add_instance(opts)\n unless %w[app util].include?(opts[:role].to_s)\n # Fail immediately because we don't have valid arguments.\n raise InvalidInstanceRole, \"Instance role must be one of: app, util\"\n end\n\n # Sanitize the name to remove whitespace if there is any\n if opts[:name]\n name = opts[:name].gsub(/\\s+/, '')\n end\n\n if opts[:role] == 'util'\n unless name && name.length > 0\n raise InvalidInstanceName, \"When specifying a util instance you must also specify a name.\"\n end\n end\n \n request = { \"role\" => opts[:role], \"name\" => opts[:name] }\n request['snapshot_id'] = opts[:snapshot_id] if opts.key?(:snapshot_id)\n request['instance_size'] = opts[:instance_size] if opts.key?(:instance_size)\n\n # We know opts[:role] is right, name can be passed straight to the API.\n # Return the response body for error output, logging, etc.\n return api.post(\"/environments/#{id}/add_instances\", :request => request)\n end", "def create_vm\n if new_resource.clone\n clone_vm\n else\n data = {\n vmid: vmid,\n bootdisk: 'virtio0',\n cores: INSTANCE_SIZE[new_resource.size]['cpu'],\n memory: INSTANCE_SIZE[new_resource.size]['memory'],\n ide2: \"#{new_resource.cdrom},media=cdrom\",\n numa: (new_resource.numa ? 1 : 0),\n ostype: get_type(new_resource.ostype),\n sockets: 1,\n virtio0: \"#{new_resource.storage}:/vm-#{vmid}-disk-1.qcow2,size=#{new_resource.disk}\"\n }.merge(new_resource.net)\n data.merge(hugepages: new_resource.hugepages) if new_resource.hugepages\n api.post(\"/nodes/#{new_resource.host}/qemu\", data)\n end\nend", "def server_create(server_name, template)\n # calculate instance id\n Puppet.debug \"template keys => \" + JSON.pretty_generate(template)\n\n server_id, server_host = ::Pinas::Common.extract_instance_id_from(server_name)\n\n # 1. setup the default options\n options = {\n :name => server_name,\n :flavor_ref => get_flavor(template[:flavor_name]), # For Openstack provider\n :image_ref => get_image(template[:image_name]), # For Openstack provider\n :flavor_id => get_flavor(template[:flavor_name]), # For HPCloud provider\n :image_id => get_image(template[:image_name]), # For HPCloud provider\n :key_name => template[:key_name],\n :security_groups => template[:security_groups],\n }\n Puppet.debug \"setup default options = >\" + JSON.pretty_generate(options)\n # 2. setup the meta data/user data for the server, for boot hooks\n begin\n options[:metadata] = meta_to_hash(ERB.new(template[:meta_data]).result(binding)) if template.has_key?(:meta_data)\n rescue Exception => e\n Puppet.crit \"servers.create in running erb for :metadata, Error: #{e}\"\n raise Puppet::Error, \"Error : #{e}\"\n end\n begin\n options[:user_data] = ERB.new(File.read(template[:user_data])).result(binding) if template.has_key?(:user_data)\n rescue Exception => e\n Puppet.crit \"servers.create in running erb for :user_data, Error: #{e}\"\n raise Puppet::Error, \"Error : #{e}\"\n end\n Puppet.debug \"added metadata and user_data\"\n Puppet.debug \"has network_name key ? #{template.has_key?(:network_name)}\"\n Puppet.debug \"network class => #{network.class}\"\n Puppet.debug \"template[:network_name] => #{template[:network_name]}\"\n Puppet.debug \"template[:network_name] => #{template['network_name']}\"\n # 3. get the network uuid and name\n if @network != nil and template.has_key?(:network_name) and template[:network_name] != ''\n Puppet.debug \"adding network #{template[:network_name]}\"\n networks = Array.new\n nics = Array.new\n nics << get_networkid(template[:network_name])\n # nics << template[:network_name]\n Puppet.debug \"working on nics => #{nics}.\"\n begin\n nics.each do |net|\n Puppet.debug \"working on net => #{net}\"\n network = find_match(@network.networks, net)\n networks.push('net_id' => network.id) if network\n end\n options[:nics] = networks\n rescue Exception => e\n raise Puppet::Error, \"Problem assigning nics, #{e}\"\n end\n Puppet.debug \"after options, got = >\" + JSON.pretty_generate(options)\n end\n # 4. create new server and wait for it to be ready.\n # TODO: implement retryable and wait for code. need to confirm we have a timeout in fog.\n # server = @compute.servers.create(options)\n # retryable(on: Timeout::Error, tries: 200) do\n # begin\n # server.wait_for(30) { ready? }\n # rescue RuntimeError, Fog::Errors::TimeoutError => e\n # end\n # end\n Puppet.debug \"attempting to create server #{server_name}\"\n new_server = nil\n begin\n new_server = @compute.servers.create(options)\n new_server.wait_for { ready?}\n new_server.wait_for { !addresses.nil? }\n rescue Exception => e\n Puppet.crit \"servers.create Error: #{e}\"\n raise Puppet::Error, \"Error : #{e}\"\n end\n\n Puppet.notice \"server created #{server_name} on net #{template[:network_name]} \"\n begin\n newserver_ip_assign(new_server)\n rescue Exception => e\n Puppet.crit \"server_ip_assign Error: #{e}\"\n raise Puppet::Error, \"Error : #{e}\"\n end\n\n end", "def create\n @tech_serv = TechServ.new(tech_serv_params)\n\n respond_to do |format|\n if @tech_serv.save\n format.html { redirect_to [:admin, @tech_serv], notice: '技术服务创建成功.' }\n format.json { render action: 'show', status: :created, location: @tech_serv }\n else\n format.html { render action: 'new' }\n format.json { render json: @tech_serv.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @service = Service.create(service_params)\n end", "def create_instance project_id:, instance_id:\n # [START spanner_create_instance]\n # project_id = \"Your Google Cloud project ID\"\n # instance_id = \"Your Spanner instance ID\"\n\n require \"google/cloud/spanner\"\n require \"google/cloud/spanner/admin/instance\"\n\n instance_admin_client = Google::Cloud::Spanner::Admin::Instance.instance_admin\n\n project_path = instance_admin_client.project_path project: project_id\n instance_path = instance_admin_client.instance_path project: project_id, instance: instance_id\n instance_config_path = instance_admin_client.instance_config_path project: project_id, instance_config: \"regional-us-central1\"\n\n job = instance_admin_client.create_instance parent: project_path,\n instance_id: instance_id,\n instance: { name: instance_path,\n config: instance_config_path,\n display_name: instance_id,\n node_count: 2,\n labels: { cloud_spanner_samples: \"true\" } }\n\n puts \"Waiting for create instance operation to complete\"\n\n job.wait_until_done!\n\n if job.error?\n puts job.error\n else\n puts \"Created instance #{instance_id}\"\n end\n # [END spanner_create_instance]\nend", "def call\n # Update service and update context\n self.service = Entities::Service.find_by_system_name(remote: threescale_client,\n system_name: service_system_name)\n if service.nil?\n # Create service and update context\n self.service = Entities::Service.create(remote: threescale_client,\n service_params: service_settings)\n logger.info \"Created service id: #{service.id}, name: #{service_name}\"\n else\n service.update(service_settings)\n logger.info \"Updated service id: #{service.id}, name: #{service_name}\"\n end\n\n report['id'] = service.id\n report['system_name'] = service.system_name\n report['name'] = service.name\n report['backend_version'] = api_spec.service_backend_version\n end", "def start\n debug \"Call 'start' for Pacemaker service '#{name}' on node '#{hostname}'\"\n disable_basic_service_on_action :start\n\n enable unless primitive_is_managed? name\n\n if pacemaker_options[:cleanup_on_start]\n if not pacemaker_options[:cleanup_only_if_failures] or primitive_has_failures? name, hostname\n cleanup\n end\n end\n\n if pacemaker_options[:add_location_constraint]\n service_location_add full_name, hostname unless service_location_exists? full_name, hostname\n end\n\n if primitive_is_multistate? name\n service_start_mode pacemaker_options[:start_mode_multistate]\n elsif primitive_is_clone? name\n service_start_mode pacemaker_options[:start_mode_clone]\n else\n service_start_mode pacemaker_options[:start_mode_simple]\n end\n\n debug cluster_debug_report \"#{@resource} start\"\n end", "def deploy(id, host, xml_text, lcm_state, deploy_id)\n # Restore if we need to\n if lcm_state != \"BOOT\" && lcm_state != \"BOOT_FAILURE\"\n restore(deploy_id)\n return deploy_id\n end\n\n # Otherwise deploy the VM\n\n begin\n ec2_info = get_deployment_info(host, xml_text)\n rescue Exception => e\n raise e\n end\n\n load_default_template_values\n\n if !ec2_value(ec2_info, 'AMI')\n raise \"Cannot find AMI in deployment file\"\n end\n\n opts = generate_options(:run, ec2_info, {\n :min_count => 1,\n :max_count => 1})\n\n # The OpenNebula context will be only included if not USERDATA\n # is provided by the user\n if !ec2_value(ec2_info, 'USERDATA')\n xml = OpenNebula::XMLElement.new\n xml.initialize_xml(xml_text, @provision_type == :host ? 'HOST' : 'VM')\n\n if xml.has_elements?('TEMPLATE/CONTEXT')\n # if requested, we generated cloud-init compatible data\n if ec2_value(ec2_info, 'CLOUD_INIT') =~ /^(yes|true)$/i\n context_str = generate_cc(xml, 'TEMPLATE/CONTEXT')\n else\n # Since there is only 1 level ',' will not be added\n context_str = xml.template_like_str('TEMPLATE/CONTEXT')\n\n if xml['TEMPLATE/CONTEXT/TOKEN'] == 'YES'\n # TODO use OneGate library\n token_str = generate_onegate_token(xml)\n if token_str\n context_str << \"\\nONEGATE_TOKEN=\\\"#{token_str}\\\"\"\n end\n end\n end\n\n userdata_key = EC2[:run][:args][\"USERDATA\"][:opt]\n opts[userdata_key] = Base64.encode64(context_str)\n end\n end\n\n instances = @ec2.create_instances(opts)\n instance = instances.first\n\n start_time = Time.now\n\n while Time.now - start_time < @state_change_timeout\n begin\n break if instance.exists?\n rescue => e\n OpenNebula::log_error(\"RESCUE: #{e.inspect}\")\n end\n\n sleep 2\n end\n\n tags = generate_options(:tags, ec2_info)[:tags] || {}\n\n tag_array = []\n tags.each{ |key,value|\n tag_array << {\n :key => key,\n :value => value\n }\n }\n\n instance.create_tags(:tags => tag_array) if tag_array.length > 0\n\n elastic_ip = ec2_value(ec2_info, 'ELASTICIP')\n\n wait_state('running', instance.id)\n\n if elastic_ip\n\n if elastic_ip.match(Resolv::IPv4::Regex)\n address_key = :public_ip\n else\n address_key = :allocation_id\n end\n\n address = {\n :instance_id => instance.id,\n address_key => elastic_ip\n }\n\n @ec2.client.associate_address(address)\n end\n\n if @provision_type == :host\n instance.create_tags(tags: [{\n key: 'Name',\n value: host['//HOST/TEMPLATE/PROVISION/HOSTNAME']\n },{\n key: 'ONE_HOST_ID',\n value: 'TODO'\n }])\n else\n instance.create_tags(tags: [{\n key: 'ONE_ID',\n value: id\n }])\n end\n\n puts(instance.id)\n end" ]
[ "0.59663546", "0.59428483", "0.57729685", "0.5762015", "0.5721399", "0.5680516", "0.567849", "0.5611673", "0.559242", "0.5556285", "0.5544761", "0.5526245", "0.54776007", "0.54724807", "0.54699993", "0.5415827", "0.5376937", "0.536614", "0.5365983", "0.533006", "0.527945", "0.5213071", "0.5212012", "0.5209855", "0.52097416", "0.52086866", "0.51840955", "0.5179891", "0.51691335", "0.5168494", "0.5154645", "0.5148811", "0.5148105", "0.51447", "0.51363575", "0.51275057", "0.512176", "0.5117307", "0.51127094", "0.5110749", "0.5106284", "0.5104438", "0.5095593", "0.508305", "0.5079468", "0.5072056", "0.50711143", "0.50659907", "0.5058354", "0.5054225", "0.5053168", "0.50470024", "0.504664", "0.50441533", "0.50328153", "0.5028251", "0.5024569", "0.5024261", "0.5019758", "0.49985468", "0.49863407", "0.49853748", "0.4982532", "0.4980392", "0.49754727", "0.497443", "0.49655616", "0.49583137", "0.49580747", "0.49577063", "0.4953183", "0.49513397", "0.49492416", "0.49412137", "0.49321464", "0.4926378", "0.49248442", "0.4924108", "0.49234295", "0.49101847", "0.4904569", "0.48958513", "0.48936474", "0.48900145", "0.4884303", "0.48828605", "0.48822898", "0.4875999", "0.48729983", "0.4872976", "0.48714346", "0.48714164", "0.4864282", "0.4860705", "0.48562187", "0.4854917", "0.4845292", "0.48422942", "0.48361313", "0.48348883", "0.48268676" ]
0.0
-1
Create Tier1 service instance Create Tier1 Service Instance. Please note that, only display_name, description and deployment_spec_name are allowed to be modified in an exisiting entity. If the deployment spec name is changed, it will trigger the upgrade operation for the SVMs.
def patch_tier1_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, policy_service_instance, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_policy_service_instance ...' end # verify the required parameter 'tier_1_id' is set if @api_client.config.client_side_validation && tier_1_id.nil? fail ArgumentError, "Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_policy_service_instance" end # verify the required parameter 'locale_service_id' is set if @api_client.config.client_side_validation && locale_service_id.nil? fail ArgumentError, "Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_policy_service_instance" end # verify the required parameter 'service_instance_id' is set if @api_client.config.client_side_validation && service_instance_id.nil? fail ArgumentError, "Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_policy_service_instance" end # verify the required parameter 'policy_service_instance' is set if @api_client.config.client_side_validation && policy_service_instance.nil? fail ArgumentError, "Missing the required parameter 'policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_policy_service_instance" end # resource path local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(policy_service_instance) auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#patch_tier1_policy_service_instance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create(name, config)\n # @step: validate the user defined options\n validate(config)\n\n # @step: create the infrastructure deployment\n begin\n provision_aks(name, config)\n rescue StandardError => e\n raise InfrastructureError, \"failed to provision cluster, error: #{e}\"\n end\n\n # @step: bootstrap the cluster\n begin\n provision_cluster(name, config)\n rescue StandardError => e\n raise InfrastructureError, \"failed to bootstrap cluster, error: #{e}\"\n end\n end", "def create_or_replace_tier1(tier_1_id, tier1, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_with_http_info(tier_1_id, tier1, opts)\n data\n end", "def create_tier1_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance\"\n end\n # verify the required parameter 'policy_service_instance' is set\n if @api_client.config.client_side_validation && policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_tier1_0(tier_1_id, tier1, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_0_with_http_info(tier_1_id, tier1, opts)\n data\n end", "def create_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'policy_service_instance' is set\n if @api_client.config.client_side_validation && policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_tier1_service_instance_endpoint_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint' is set\n if @api_client.config.client_side_validation && service_instance_endpoint.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_instance_endpoint)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInstanceEndpoint')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_service_instance_endpoint_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_tier1_service_instance_endpoint_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_endpoint' is set\n if @api_client.config.client_side_validation && service_instance_endpoint.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_instance_endpoint)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInstanceEndpoint')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_service_instance_endpoint\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_kvm_instance(name, opts={})\n cmd = \"virt-install -n #{name} --ram #{opts[:memory]} --disk \" <<\n \"path=#{File.join(KVM_HOME, 'storage', \"#{name}.qcow2\")},device=disk,bus=virtio,format=qcow2 \" <<\n \"-v --import --noautoconsole --vcpus=#{opts[:vcpus]},maxvcpus=#{opts[:maxvcpus]}\" \n unless(system(cmd))\n raise \"Failed to create KVM instance!\"\n end \nend", "def create_service\n super.tap do |service_template|\n service_template.cookbook('poise-service')\n create_monit_config\n end\n end", "def add_tier\n begin\n with_transaction do\n Tier.create!(\n name: params[:name],\n stage: params[:stage],\n pipeline_id: @pipeline.id\n )\n\n render json: tiers_for_pipeline_view\n end\n rescue Exception => e\n error = \"#{ConfluxErrors::TierCreationFailed} - #{e}\"\n logger.error { error }\n render json: { message: error }, status: 500\n end\n end", "def create_kubernetes_virtual_machine_instance_type_with_http_info(kubernetes_virtual_machine_instance_type, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: KubernetesApi.create_kubernetes_virtual_machine_instance_type ...'\n end\n # verify the required parameter 'kubernetes_virtual_machine_instance_type' is set\n if @api_client.config.client_side_validation && kubernetes_virtual_machine_instance_type.nil?\n fail ArgumentError, \"Missing the required parameter 'kubernetes_virtual_machine_instance_type' when calling KubernetesApi.create_kubernetes_virtual_machine_instance_type\"\n end\n # resource path\n local_var_path = '/api/v1/kubernetes/VirtualMachineInstanceTypes'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(kubernetes_virtual_machine_instance_type)\n\n # return_type\n return_type = opts[:debug_return_type] || 'KubernetesVirtualMachineInstanceType'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"KubernetesApi.create_kubernetes_virtual_machine_instance_type\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: KubernetesApi#create_kubernetes_virtual_machine_instance_type\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def service_create(name, display_name, executable_on_host,startup=2)\n\t\tif session_has_services_depend?\n\t\t\tmeterpreter_service_create(name, display_name, executable_on_host,startup)\n\t\telse\n\t\t\tshell_service_create(name, display_name, executable_on_host,startup)\n\t\tend\n\tend", "def create_kvm(kvm_name, template, options)\n ensure_name_availability!(kvm_name)\n clone_kvm(kvm_name, template)\n device = mount_kvm_volume(kvm_name)\n address = update_kvm_ip(kvm_name)\n update_hostname(kvm_name)\n make_console_accessible(kvm_name)\n unmount_kvm_volume(kvm_name, device)\n create_kvm_instance(kvm_name, options)\n puts \"KVM Node #{kvm_name} available at: #{address}\"\nend", "def create_or_replace_tier1_with_http_info(tier_1_id, tier1, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1\"\n end\n # verify the required parameter 'tier1' is set\n if @api_client.config.client_side_validation && tier1.nil?\n fail ArgumentError, \"Missing the required parameter 'tier1' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(tier1)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#create_or_replace_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_instance(credentials, image_id, opts)\n new_vapp = nil\n vapp_opts = {} #assemble options to pass to Fog::Terremark::Real.instantiate_vapp_template\n terremark_hwp = hardware_profiles(credentials, {:name => 'default'}).first #sanity check values against default\n name = opts[:name]\n if not name\n name = \"inst#{Time.now.to_i}\"\n end\n if name.length > USER_NAME_MAX\n raise \"Parameter name must be #{USER_NAME_MAX} characters or less\"\n end\n unless ( (terremark_hwp.include?(:cpu, opts[:hwp_cpu].to_i)) &&\n (terremark_hwp.include?(:memory, opts[:hwp_memory].to_i)) ) then\n raise Deltacloud::Exceptions::ValidationFailure.new(\n StandardError.new(\"Error with cpu and/or memory values. you said cpu->#{opts[:hwp_cpu]} and mem->#{opts[:hwp_memory]}\")\n )\n end\n vapp_opts['cpus'] = opts[:hwp_cpu]\n vapp_opts['memory'] = opts[:hwp_memory]\n safely do\n terremark_client = new_client(credentials)\n#######\n#FIXME# what happens if there is an issue getting the new vapp id? (eg even though created succesfully)\n#######\n vapp_id = terremark_client.instantiate_vapp_template(name, image_id, vapp_opts).body['href'].split('/').last\n new_vapp = terremark_client.get_vapp(vapp_id)\n return convert_instance(new_vapp, terremark_client, credentials.user) #return an Instance object\n end\n end", "def create_or_replace_tier1_0_with_http_info(tier_1_id, tier1, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1_0\"\n end\n # verify the required parameter 'tier1' is set\n if @api_client.config.client_side_validation && tier1.nil?\n fail ArgumentError, \"Missing the required parameter 'tier1' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(tier1)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#create_or_replace_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_service_instance(name, space_guid, service_plan_id)\n service_plan_instance = CFoundry::V2::ServicePlan.new(service_plan_id, @client)\n service_instance = @client.managed_service_instance\n service_instance.name = name\n service_instance.service_plan = service_plan_instance\n service_instance.space = @client.space(space_guid)\n service_instance.create!\n service_instance\n end", "def create\n @t1 = T1.new(params[:t1])\n\n respond_to do |format|\n if @t1.save\n flash[:notice] = 'T1 was successfully created.'\n format.html { redirect_to(@t1) }\n format.xml { render :xml => @t1, :status => :created, :location => @t1 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @t1.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create_instance\n create_instances(1).first\n end", "def create_virtual_machine(params, options = {})\n image = get_image(params[:image])\n options[:os_type] = image.os_type\n validate_deployment_params(params, options)\n options[:deployment_name] ||= options[:cloud_service_name]\n Azure::Loggerx.info 'Creating deployment...'\n\n options[:cloud_service_name] ||= generate_cloud_service_name(params[:vm_name])\n options[:storage_account_name] ||= generate_storage_account_name(params[:vm_name])\n optionals = {}\n if options[:virtual_network_name]\n virtual_network_service = client.network_management\n virtual_networks = virtual_network_service.list_virtual_networks.select { |x| x.name == options[:virtual_network_name] }\n if virtual_networks.empty?\n Azure::Loggerx.error_with_exit \"Virtual network #{options[:virtual_network_name]} doesn't exists\"\n else\n vnet = virtual_networks.first\n if !vnet.affinity_group.empty?\n options[:affinity_group_name] = vnet.affinity_group\n else\n optionals[:location] = vnet.location\n end\n end\n elsif options[:affinity_group_name]\n optionals[:affinity_group_name] = options[:affinity_group_name]\n else\n optionals[:location] = params[:location]\n end\n cloud_service = client.cloud_service_management\n cloud_service.create_cloud_service(options[:cloud_service_name], optionals)\n cloud_service.upload_certificate(options[:cloud_service_name], params[:certificate]) unless params[:certificate].empty?\n unless image.category == 'User'\n options[:storage_account_name] ||= generate_storage_account_name(params[:vm_name])\n client.storage_management.create_storage_account(options[:storage_account_name], optionals)\n end\n body = Serialization.deployment_to_xml(params, image, options)\n path = \"/services/hostedservices/#{options[:cloud_service_name]}/deployments\"\n Azure::Loggerx.info 'Deployment in progress...'\n request = client.management_request(:post, path, body)\n request.call\n get_virtual_machine(params[:vm_name], options[:cloud_service_name])\n rescue Exception => e\n Azure::Loggerx.error_with_exit \"Failed to create virtual machine : \"+e.message\n end", "def create(id, name: nil, type: :PRODUCTION, labels: nil, clusters: nil)\n end", "def create\n @instance_name = InstanceName.new(params[:instance_name])\n\n respond_to do |format|\n if @instance_name.save\n flash[:notice] = 'InstanceName was successfully created.'\n format.html { redirect_to(@instance_name) }\n format.xml { render :xml => @instance_name, :status => :created, :location => @instance_name }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @instance_name.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'byod_policy_service_instance' is set\n if @api_client.config.client_side_validation && byod_policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'byod_policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(byod_policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_byod_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @servicetype = Servicetype.new(params[:servicetype])\n\n respond_to do |format|\n if @servicetype.save\n format.html { redirect_to @servicetype, notice: 'Servicetype was successfully created.' }\n format.json { render json: @servicetype, status: :created, location: @servicetype }\n else\n format.html { render action: \"new\" }\n format.json { render json: @servicetype.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'byod_policy_service_instance' is set\n if @api_client.config.client_side_validation && byod_policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'byod_policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(byod_policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_byod_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_deployment\n @api.account_id = @options[:src]\n inputs = format_inputs(@old_deployment.show.inputs)\n\n params = {\n :deployment => {\n :name => @old_deployment.name,\n :description => @old_deployment.description\n }\n }\n\n puts \"\\nCreating deployment: \\\"#{params[:deployment][:name]}\\\" in account: #{@options[:dst]} ...\\n\\n\"\n\n @api.account_id = @options[:dst]\n result = @api.deployments.create(params)\n @new_deployment = result.href\n\n # Set deployment level inputs. Cannot set them at create time, so do it now\n deployment = @api.resource(@new_deployment)\n deployment_inputs = {}\n deployment_inputs[:inputs] = inputs\n deployment.inputs.multi_update(deployment_inputs)\nend", "def create\n @instance_type = InstanceType.new(params[:instance_type])\n\n respond_to do |format|\n if @instance_type.save\n format.html { redirect_to @instance_type, notice: 'Instance type was successfully created.' }\n format.json { render json: @instance_type, status: :created, location: @instance_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @instance_type.errors, status: :unprocessable_entity }\n end\n end\n end", "def create(name, config)\n # @step: build the paramaters\n parameters = [\n { parameter_key: 'AvailabilityZones', parameter_value: config[:availability_zones] },\n { parameter_key: 'BucketName', parameter_value: @templates_bucket },\n { parameter_key: 'BucketVersion', parameter_value: @templates_version },\n { parameter_key: 'ClusterAutoScaler', parameter_value: 'Enabled' },\n { parameter_key: 'ClusterName', parameter_value: name },\n { parameter_key: 'KeyPairName', parameter_value: config[:ssh_keypair] },\n { parameter_key: 'KubernetesVersion', parameter_value: config[:version] },\n { parameter_key: 'NodeGroupName', parameter_value: 'compute' },\n { parameter_key: 'NodeInstanceType', parameter_value: config[:machine_type] },\n { parameter_key: 'NodeVolumeSize', parameter_value: config[:disk_size_gb].to_s },\n { parameter_key: 'NumberOfAZs', parameter_value: config[:availability_zones].split(',').size.to_s },\n { parameter_key: 'NumberOfNodes', parameter_value: config[:size].to_s },\n { parameter_key: 'PrivateSubnet1CIDR', parameter_value: config[:private_subnet1_cidr] },\n { parameter_key: 'PrivateSubnet2CIDR', parameter_value: config[:private_subnet2_cidr] },\n { parameter_key: 'PrivateSubnet3CIDR', parameter_value: config[:private_subnet3_cidr] },\n { parameter_key: 'PublicSubnet1CIDR', parameter_value: config[:public_subnet1_cidr] },\n { parameter_key: 'PublicSubnet2CIDR', parameter_value: config[:public_subnet2_cidr] },\n { parameter_key: 'PublicSubnet3CIDR', parameter_value: config[:public_subnet3_cidr] },\n { parameter_key: 'RemoteAccessCIDR', parameter_value: '0.0.0.0/0' },\n { parameter_key: 'VPCCIDR', parameter_value: config[:network] }\n ]\n\n # @step: provision the cloudformation stacks\n stack_name = 'aws-cluster'\n info \"provisioning the cloudFormation: #{stack_name}\"\n info \"using the template from: #{template_path(stack_name)}\"\n\n outputs = cloudformation(name, template_url: template_path(stack_name), parameters: parameters)\n\n info 'waiting for the kube apiserver to become available'\n client = HubClustersCreator::Kube.new(outputs['EKSEndpoint'], token: build_token(name))\n client.wait_for_kubeapi\n\n # @step: check if the awa-auth configmap exists already, we never overwrite\n unless client.exists?('aws-auth', 'kube-system', 'configmaps')\n info 'provition the aws-auth configureation configmap'\n client.kubectl(default_aws_auth(name))\n\n # @step: ensure we have some nodes\n info 'waiting for some nodes to become available'\n client.wait('aws-node', 'kube-system', 'daemonsets', version: 'extensions/v1beta1') do |x|\n x.status.numberReady.positive?\n end\n end\n\n # @step: provision the cluster\n info 'bootstraping the eks cluster'\n config[:credentials] = {\n access_id: @access_id,\n access_key: @access_key,\n account_id: @account_id,\n region: @region\n }\n\n result = HubClustersCreator::Providers::Bootstrap.new(name, 'eks', client, config).bootstrap\n {\n cluster: {\n ca: outputs['EKSCA'],\n endpoint: outputs['EKSEndpoint'],\n service_account_name: 'sysadmin',\n service_account_namespace: 'kube-system',\n service_account_token: Base64.decode64(client.account('sysadmin'))\n },\n config: config,\n services: result\n }\n end", "def create # rubocop:disable Metrics/AbcSize\n inst_details = AttrFinder.new(@instanceparameters)\n inst_details.options = @options\n inst_details.validate = @validate\n inst_details.function = 'server'\n BmcAuthenticate.new(@options)\n request = OracleBMC::Core::Models::LaunchInstanceDetails.new\n ssh_public_key = @instanceparameters['server']['ssh-key']\n request.availability_domain = inst_details.ad\n request.compartment_id = inst_details.compartment\n request.display_name = @instanceparameters['server']['display_name']\n request.image_id = inst_details.image\n request.shape = @instanceparameters['server']['shape']\n request.subnet_id = inst_details.subnet\n request.metadata = { 'ssh_authorized_keys' => ssh_public_key }\n api = OracleBMC::Core::ComputeClient.new\n response = api.launch_instance(request)\n @instance_id = response.data.id\n compartment(inst_details.compartment)\n running_instance = api.get_instance(@instance_id).wait_until(:lifecycle_state,\n OracleBMC::Core::Models::Instance::LIFECYCLE_STATE_RUNNING,\n max_interval_seconds: 5, max_wait_seconds: 300)\n if @instanceparameters['server']['attachments']\n @instanceparameters['server']['attachments'].each do |vol|\n attach(@instance_id, vol['volume'])\n end\n end\n running_instance\n end", "def create_tier1_policy_service_instance_0(tier_1_id, locale_service_id, service_instance_id, policy_service_instance, opts = {})\n data, _status_code, _headers = create_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, policy_service_instance, opts)\n data\n end", "def create_tier1_service_interface(tier_1_id, locale_service_id, interface_id, service_interface, opts = {})\n data, _status_code, _headers = create_tier1_service_interface_with_http_info(tier_1_id, locale_service_id, interface_id, service_interface, opts)\n data\n end", "def create_virtual_machine(params, options={})\n options[:os_type] = get_os_type(params[:image])\n options[:image_type] = get_image_type(params[:image])\n validate_deployment_params(params, options)\n options[:cloud_service_name] = generate_cloud_service_name(params[:vm_name]) unless options[:cloud_service_name]\n options[:storage_account_name] = generate_storage_account_name(params[:vm_name]) unless options[:storage_account_name] \n optionals = {}\n if options[:virtual_network_name]\n virtual_network_service = Azure::VirtualNetworkManagementService.new\n virtual_networks = virtual_network_service.list_virtual_networks.select{|x| x.name == options[:virtual_network_name]}\n if virtual_networks.empty?\n Loggerx.error_with_exit \"Virtual network #{options[:virtual_network_name]} doesn't exists\"\n else\n optionals[:affinity_group_name] = virtual_networks.first.affinity_group\n end\n elsif options[:affinity_group_name]\n optionals[:affinity_group_name] = options[:affinity_group_name]\n else\n optionals[:location] = params[:location]\n end \n cloud_service = Azure::CloudServiceManagementService.new\n cloud_service.create_cloud_service(options[:cloud_service_name], optionals)\n cloud_service.upload_certificate(options[:cloud_service_name],params[:certificate]) unless params[:certificate].empty?\n Azure::StorageManagementService.new.create_storage_account(options[:storage_account_name], optionals)\n\n body = Serialization.deployment_to_xml(params,options)\n path = \"/services/hostedservices/#{options[:cloud_service_name]}/deployments\"\n Loggerx.info \"Deployment in progress...\"\n request = ManagementHttpRequest.new(:post, path, body)\n request.call\n get_virtual_machine(params[:vm_name],options[:cloud_service_name])\n rescue Exception => e\n e.message\n end", "def create_pvm_instance(instance_hash)\n post(\"cloud-instances/#{guid}/pvm-instances\", instance_hash.to_json)\n end", "def create_tier1_service_instance_endpoint(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n data, _status_code, _headers = create_tier1_service_instance_endpoint_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts)\n data\n end", "def create\n @servicetype = Servicetype.new(params[:servicetype])\n\n respond_to do |format|\n if @servicetype.save\n format.html { redirect_to @servicetype, :notice => 'Servicetype was successfully created.' }\n format.json { render :json => @servicetype, :status => :created, :location => @servicetype }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @servicetype.errors, :status => :unprocessable_entity }\n end\n end\n end", "def patch_tier1_service_instance_endpoint_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_endpoint' is set\n if @api_client.config.client_side_validation && service_instance_endpoint.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_instance_endpoint)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#patch_tier1_service_instance_endpoint\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @instance_type = InstanceType.new(instance_type_params)\n\n respond_to do |format|\n if @instance_type.save\n format.html { redirect_to @instance_type, notice: 'Instance type was successfully created.' }\n format.json { render action: 'show', status: :created, location: @instance_type }\n else\n format.html { render action: 'new' }\n format.json { render json: @instance_type.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch_tier1_service_instance_endpoint_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint' is set\n if @api_client.config.client_side_validation && service_instance_endpoint.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_instance_endpoint)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#patch_tier1_service_instance_endpoint_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def post_compute(request)\n # --- Create the new Instance ---\n vm = VirtualMachineOCCI.new(\n VirtualMachine.build_xml,\n @client,\n request.body.read,\n @config[:instance_types],\n @config[:template_location])\n\n # --- Generate the template and Allocate the new Instance ---\n template = vm.to_one_template\n return template, 500 if OpenNebula.is_error?(template)\n\n rc = vm.allocate(template)\n if OpenNebula.is_error?(rc)\n return rc, CloudServer::HTTP_ERROR_CODE[rc.errno]\n end\n\n # --- Prepare XML Response ---\n vm.info\n return to_occi_xml(vm, :code=>201)\n end", "def create_service(resource, actions)\n service_name = get_service_name()\n\n case resource.service_type\n when \"upstart\"\n service service_name do\n provider Chef::Provider::Service::Upstart\n supports :status => true, :restart => true, :reload => true\n action actions\n end\n when \"init.d\"\n service service_name do\n supports :status => true, :restart => true, :reload => true\n action actions\n end\n else\n raise \"dashing: Unknown service_type '#{resource.service_type}'\"\n end\nend", "def start_pvm_instance(instance_id)\n post(\n \"cloud-instances/#{guid}/pvm-instances/#{instance_id}/action\",\n {\"action\" => \"start\"}.to_json\n )\n end", "def patch_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'policy_service_instance' is set\n if @api_client.config.client_side_validation && policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#patch_tier1_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_service(data=nil)\n if (!data.blank? && data.is_a?(Hash))\n @service = Service.create(data)\n else\n @service = Service.create(:name => \"Test Service #{rand(1..1000)}\", :description => \"Test service description.\", :active => true, :probe => \"dummy\", :probe_config => {:value => 1}, :interval => 60, :clean_interval => 86400, :priority => Service::PRIORITY_NORMAL, :resume => :mean_value)\n end\n end", "def create\n @instance = Instance.new(params[:instance])\n\n respond_to do |format|\n if @instance.save\n\n system(\"ssh root@#{CloudGui::Application.config.hypervisor_ip} \\\"exec /data/cloud/scripts/provision.sh #{params[:instance][:cpus]} #{params[:instance][:memory]} #{params[:instance][:baseimage]} 2>&1 | tee /data/cloud/logs/cloud_gui.log\\\"\")\n\n format.html { redirect_to @instance, notice: 'Instance was successfully created.' }\n format.json { render json: @instance, status: :created, location: @instance }\n else\n format.html { render action: \"new\" }\n format.json { render json: @instance.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n submenu_item 'services-new'\n @service = Service.new(params[:service])\n @service_type = @service.type\n service_param\n\n @service.tenant_id = current_user.tenant_id\n\n # service_params = Service.extract_params(params[:service])\n # service_params = Service.extract_thresholds(service_params)\n # @service = Service.new(service_params)\n\n respond_to do |format|\n if @service.save\n flash[:notice] = \"#{@service.name}创建成功\"\n format.html { redirect_to(@service) }\n else\n dictionary\n format.html { render :action => \"new\" }\n end\n end\n end", "def create_tier1_service_instance_endpoint_0(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n data, _status_code, _headers = create_tier1_service_instance_endpoint_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts)\n data\n end", "def create_or_patch_tier1_l2_vpn_service_0_with_http_info(tier_1_id, locale_service_id, service_id, l2_vpn_service, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'service_id' is set\n if @api_client.config.client_side_validation && service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'l2_vpn_service' is set\n if @api_client.config.client_side_validation && l2_vpn_service.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_vpn_service' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/l2vpn-services/{service-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-id' + '}', service_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_vpn_service)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi#create_or_patch_tier1_l2_vpn_service_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_service\n # Check signals here to be nice and abort early if possible.\n check_signals!\n # Enable automatically creates the service with Runit.\n directory \"/var/log/#{new_resource.service_name}\" do\n owner 'root'\n group 'root'\n mode '700'\n end\n end", "def create\n @recreation_service_typology = RecreationServiceTypology.new(recreation_service_typology_params)\n\n respond_to do |format|\n if @recreation_service_typology.save\n format.html { redirect_to @recreation_service_typology, notice: 'Recreation service typology was successfully created.' }\n format.json { render action: 'show', status: :created, location: @recreation_service_typology }\n else\n format.html { render action: 'new' }\n format.json { render json: @recreation_service_typology.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_tier1_service_interface_with_http_info(tier_1_id, locale_service_id, interface_id, service_interface, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface\"\n end\n # verify the required parameter 'service_interface' is set\n if @api_client.config.client_side_validation && service_interface.nil?\n fail ArgumentError, \"Missing the required parameter 'service_interface' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_interface)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#create_tier1_service_interface\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_virtual_machine(vm)\n kubevirt_client.create_virtual_machine(vm)\n end", "def create_vm(opts = {})\n opts = opts.with_indifferent_access.reverse_merge(\n VSphereConfig.create_vm_defaults.symbolize_keys || {}\n )\n\n opts[:template_path] = compute.image if compute.image\n\n VSphere.with_connection do |vs|\n dest_folder = opts[:dest_folder]\n vm_name = opts[:name] || \"#{compute.image}-\"\\\n \"#{SecureRandom.hex(4)}-#{Time.new.strftime(\"%Y%m%d\")}\"\n exception_cb = lambda do |_p1|\n LabManager.logger.warn(\n \"Failed attempt to create virtual machine: template_name: #{opts[:template_path]}\"\\\n \", vm_name: #{vm_name}\"\n )\n end\n\n Retryable.retryable(\n tries: VSphereConfig.create_vm_defaults[:vm_clone_retry_count],\n on: [RbVmomi::Fault, CreateVMError, Fog::Compute::Vsphere::NotFound],\n exception_cb: exception_cb,\n sleep: ->(n) { Random.rand(n*3..n*3+10.0) }\n ) do\n LabManager.logger.info \"creating machine with name: #{vm_name} options: #{opts.inspect}\"\n machine = vs.vm_clone(\n 'datacenter' => opts[:datacenter],\n 'datastore' => opts[:datastore],\n 'template_path' => opts[:template_path],\n 'name' => vm_name,\n 'cluster' => opts[:cluster],\n 'linked_clone' => opts[:linked_clone],\n 'dest_folder' => dest_folder,\n 'power_on' => opts[:power_on],\n 'wait' => true\n )\n\n setup_network_interfaces({\n uuid: machine['new_vm']['uuid'],\n connection: vs,\n network_name: VSphereConfig.create_vm_defaults[:network_interface_name]\n })\n\n fail CreateVMError, \"Creation of (#{vm_name}) machine failed, retrying\" unless machine || machine['vm_ref']\n set_provider_data(machine['new_vm'], vs: vs)\n end\n\n add_machine_to_drs_rule(\n vs,\n group: opts[:add_to_drs_group],\n machine: \"#{dest_folder}/#{vm_name}\",\n datacenter: opts[:datacenter]\n ) if opts[:add_to_drs_group]\n end\n poweron_vm unless compute.provider_data['power_state'] == 'poweredOn'\n rescue\n # Try to free unsuccessfully started/configured/... VM\n begin\n terminate_vm\n rescue\n nil\n end if instance_uuid\n raise\n end", "def create_tier1_policy_service_instance(tier_1_id, locale_service_id, service_instance_id, policy_service_instance, opts = {})\n data, _status_code, _headers = create_tier1_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, policy_service_instance, opts)\n data\n end", "def create_tier1_byod_policy_service_instance_0(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts = {})\n data, _status_code, _headers = create_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts)\n data\n end", "def new\n @service = Service.new\n\n # If a valid type is received, apply to the host to create.\n check_priority_param\n @service.priority = @priority if([email protected]?)\n\n # Add custom views paths\n prepend_view_path \"app/views/services\"\n prepend_view_path \"lib/probes/#{@service.probe}/views\"\n\n respond_to do |format|\n format.html\n end\n end", "def create\n req = VCAP::Services::Api::ServiceOfferingRequest.decode(request_body)\n logger.debug(\"Create service request: #{req.extract.inspect}\")\n\n # Should we worry about a race here?\n\n success = nil\n svc = Service.find_by_label(req.label)\n if svc\n raise CloudError.new(CloudError::FORBIDDEN) unless svc.verify_auth_token(@service_auth_token)\n attrs = req.extract.dup\n attrs.delete(:label)\n # Keep DB in sync with configs if the token changes in the config\n attrs[:token] = @service_auth_token if svc.is_builtin?\n svc.update_attributes!(attrs)\n else\n # Service doesn't exist yet. This can only happen for builtin services since service providers must\n # register with us to get a token.\n svc = Service.new(req.extract)\n raise CloudError.new(CloudError::FORBIDDEN) unless svc.is_builtin? && svc.verify_auth_token(@service_auth_token)\n svc.token = @service_auth_token\n svc.save!\n end\n\n render :json => {}\n end", "def createEc2Instance\n\n instance_descriptor = {\n :image_id => @config[\"image_id\"],\n :key_name => @deploy.ssh_key_name,\n :instance_type => @config[\"size\"],\n :disable_api_termination => true,\n :min_count => 1,\n :max_count => 1\n }\n\n instance_descriptor[:iam_instance_profile] = getIAMProfile\n\n security_groups = myFirewallRules.map { |fw| fw.cloud_id }\n if security_groups.size > 0\n instance_descriptor[:security_group_ids] = security_groups\n else\n raise MuError, \"Didn't get any security groups assigned to be in #{@mu_name}, that shouldn't happen\"\n end\n\n if @config['private_ip']\n instance_descriptor[:private_ip_address] = @config['private_ip']\n end\n\n if [email protected]? and @config.has_key?(\"vpc\")\n subnet = mySubnets.sample\n if subnet.nil?\n raise MuError, \"Got null subnet id out of #{@config['vpc']}\"\n end\n MU.log \"Deploying #{@mu_name} into VPC #{@vpc.cloud_id} Subnet #{subnet.cloud_id}\"\n allowBastionAccess\n instance_descriptor[:subnet_id] = subnet.cloud_id\n end\n\n if [email protected]? and [email protected]?\n instance_descriptor[:user_data] = Base64.encode64(@userdata)\n end\n\n MU::Cloud::AWS::Server.waitForAMI(@config[\"image_id\"], region: @region, credentials: @credentials)\n\n instance_descriptor[:block_device_mappings] = MU::Cloud::AWS::Server.configureBlockDevices(image_id: @config[\"image_id\"], storage: @config['storage'], region: @region, credentials: @credentials)\n\n instance_descriptor[:monitoring] = {enabled: @config['monitoring']}\n\n if @tags and @tags.size > 0\n instance_descriptor[:tag_specifications] = [{\n :resource_type => \"instance\",\n :tags => @tags.keys.map { |k|\n { :key => k, :value => @tags[k] }\n }\n }]\n end\n\n MU.log \"Creating EC2 instance #{@mu_name}\", details: instance_descriptor\n\n instance = resp = nil\n loop_if = Proc.new {\n instance = resp.instances.first if resp and resp.instances\n resp.nil? or resp.instances.nil? or instance.nil?\n }\n\n bad_subnets = []\n mysubnet_ids = if mySubnets\n mySubnets.map { |s| s.cloud_id }\n end\n begin\n MU.retrier([Aws::EC2::Errors::InvalidGroupNotFound, Aws::EC2::Errors::InvalidSubnetIDNotFound, Aws::EC2::Errors::InvalidParameterValue], loop_if: loop_if, loop_msg: \"Waiting for run_instances to return #{@mu_name}\") {\n resp = MU::Cloud::AWS.ec2(region: @region, credentials: @credentials).run_instances(instance_descriptor)\n }\n rescue Aws::EC2::Errors::Unsupported => e\n bad_subnets << instance_descriptor[:subnet_id]\n better_subnet = (mysubnet_ids - bad_subnets).sample\n if e.message !~ /is not supported in your requested Availability Zone/ and\n (mysubnet_ids.nil? or mysubnet_ids.empty? or\n mysubnet_ids.size == bad_subnets.size or\n better_subnet.nil? or better_subnet == \"\")\n raise MuError.new e.message, details: mysubnet_ids\n end\n instance_descriptor[:subnet_id] = (mysubnet_ids - bad_subnets).sample\n if instance_descriptor[:subnet_id].nil?\n raise MuError.new \"Specified subnet#{bad_subnets.size > 1 ? \"s do\" : \" does\"} not support instance type #{instance_descriptor[:instance_type]}\", details: bad_subnets\n end\n MU.log \"One or more subnets does not support instance type #{instance_descriptor[:instance_type]}, attempting with #{instance_descriptor[:subnet_id]} instead\", MU::WARN, details: bad_subnets\n retry\n rescue Aws::EC2::Errors::InvalidRequest => e\n MU.log e.message, MU::ERR, details: instance_descriptor\n raise e\n end\n\n MU.log \"#{@mu_name} (#{instance.instance_id}) coming online\"\n\n instance\n end", "def create\n @idti_service = IdtiService.new(idti_service_params)\n\n respond_to do |format|\n if @idti_service.save\n format.html { redirect_to @idti_service, notice: 'Idti service was successfully created.' }\n format.json { render :show, status: :created, location: @idti_service }\n else\n format.html { render :new }\n format.json { render json: @idti_service.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_tier1_service_interface_0_with_http_info(tier_1_id, locale_service_id, interface_id, service_interface, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface_0\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface_0\"\n end\n # verify the required parameter 'service_interface' is set\n if @api_client.config.client_side_validation && service_interface.nil?\n fail ArgumentError, \"Missing the required parameter 'service_interface' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_interface)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#create_tier1_service_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def createEc2Instance\n\t\t name = @server[\"name\"]\n\t\t node = @server['mu_name']\n\t\t\tbegin\n\t\t\t\t@server['iam_role'] = MU::Server.createIAMProfile(\"Server-\"+name, base_profile: @server['iam_role'], extra_policies: @server['iam_policies'])\n\t\t\trescue Aws::EC2::Errors::RequestLimitExceeded => e\n\t\t\t\tsleep 10\n\t\t\t\tretry\n\t\t\tend\n\t\t\t@server['iam_role'] = @server['iam_role']\n\n\t\t\tbegin\n\t\t\t\[email protected]\n\t\t\trescue Aws::EC2::Errors::RequestLimitExceeded => e\n\t\t\t\tsleep 10\n\t\t\t\tretry\n\t\t\tend\n\n\t\t instance_descriptor = {\n\t\t :image_id => @server[\"ami_id\"],\n\t\t :key_name => @deploy.keypairname,\n\t\t :instance_type => @server[\"size\"],\n\t\t :disable_api_termination => true,\n\t\t :min_count => 1,\n\t\t :max_count => 1,\n\t\t\t\t:network_interfaces => [\n\t\t\t\t\t{\n\t\t\t\t\t\t:associate_public_ip_address => name[\"associate_public_ip\"]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t }\n\t\t\t\n\t\t\tif !@server['private_ip'].nil?\n\t\t\t\tinstance_descriptor[:private_ip_address] = @server['private_ip']\n\t\t\tend\n\n\t\t\tvpc_id=subnet_id=nat_host_name=nat_ssh_user = nil\n\t\t\tsubnet_retries = 0\n\t\t\tif !@server[\"vpc\"].nil?\n\t\t\t\tbegin\n\t\t\t\t\tvpc_id, subnet_ids, nat_host_name, nat_ssh_user = MU::VPC.parseVPC(@server['vpc'])\n\t\t\t\trescue Aws::EC2::Errors::ServiceError => e\n\t\t\t\t\tMU.log e.message, MU::ERR, details: @server\n\t\t\t\t\tif subnet_retries < 5\n\t\t\t\t\t subnet_retries = subnet_retries + 1\n\t\t\t\t\t sleep 15\n\t\t\t\t\t retry\n\t\t\t\t\tend\n\t\t\t\t\traise e\n\t\t\t\tend\n\t\t\t\tsubnet_id = subnet_ids.first\n\t\t\t\tif subnet_id.nil? or subnet_id.empty?\n\t\t\t\t\tMU.log \"Got null Subnet id out of #{@server['vpc']}\", MU::ERR\n\t\t\t\t\traise \"deploy failure\"\n\t\t\t\tend\n\n\t\t\t\tMU.log \"Deploying #{node} into VPC #{vpc_id} Subnet #{subnet_id}\"\n\n\t\t\t\tif !@server[\"vpc\"][\"nat_host_name\"].nil? or !@server[\"vpc\"][\"nat_host_id\"].nil?\n\t\t\t\t\tadmin_sg = MU::Server.punchAdminNAT(@server, node)\n\t\t\t\telse\n\t\t\t\t\tadmin_sg = MU::FirewallRule.setAdminSG(vpc_id: vpc_id, region: @server['region'])\n\t\t\t\tend\n\n\t\t\t\tinstance_descriptor[:subnet_id] = subnet_id\n\t\t\t\tnode_sg = MU::FirewallRule.createEc2SG(\n\t\t\t\t\t\t@server[\"name\"].upcase,\n\t\t\t\t\t\t@server[\"ingress_rules\"],\n\t\t\t\t\t\tdescription: \"SG holes for #{node}\",\n\t\t\t\t\t\tvpc_id: vpc_id,\n\t\t\t\t\t\tregion: @server['region']\n\t\t\t\t)\n\t\t\telse\n\t\t\t\tadmin_sg = MU::FirewallRule.setAdminSG(region: @server['region'])\n\t\t\t\tnode_sg = MU::FirewallRule.createEc2SG(\n\t\t\t\t\t\t@server[\"name\"].upcase,\n\t\t\t\t\t\t@server[\"ingress_rules\"],\n\t\t\t\t\t\tdescription: \"SG holes for #{node}\",\n\t\t\t\t\t\tregion: @server['region']\n\t\t\t\t)\n\t\t\tend\n\t\t\tsecurity_groups = Array.new\n\t\t\tsecurity_groups << admin_sg\n\t\t\tsecurity_groups << node_sg\n\t\t\tif !@server[\"add_firewall_rules\"].nil?\n\t\t\t\t@server[\"add_firewall_rules\"].each { |acl|\n\t\t\t\t\tsg = MU::FirewallRule.find(sg_id: acl[\"rule_id\"], name: acl[\"rule_name\"], region: @server['region'])\n\t\t\t\t\tif sg.nil?\n\t\t\t\t\t\tMU.log \"Couldn't find dependent security group #{acl} for server #{node}\", MU::ERR\n\t\t\t\t\t\traise \"deploy failure\"\n\t\t\t\t\tend\n\t\t\t\t\tsecurity_groups << sg.group_id\n\t\t\t\t}\n\t\t\tend\n\n\t\t\tinstance_descriptor[:security_group_ids] = security_groups\n\n\t\t if [email protected]? and [email protected]?\n\t\t instance_descriptor[:user_data] = Base64.encode64(@userdata)\n\t\t end\n\n\t\t if !@server[\"iam_role\"].nil?\n\t\t instance_descriptor[:iam_instance_profile] = { name: @server[\"iam_role\"]}\n\t\t end\n\n\t\t\tconfigured_storage = Array.new\n\t\t\tif @server[\"storage\"]\n\t\t\t\t@server[\"storage\"].each { |vol|\n\t\t\t\t\tconfigured_storage << MU::Server.convertBlockDeviceMapping(vol)\n\t\t\t\t}\n\t\t\tend\n\t\t\n\t\t\tMU::Server.waitForAMI(@server[\"ami_id\"], region: @server['region'])\n\n\t\t\tinstance_descriptor[:block_device_mappings] = configured_storage\n\t\t\tinstance_descriptor[:block_device_mappings].concat(@ephemeral_mappings)\n\n\t\t\tinstance_descriptor[:monitoring] = { enabled: @server['monitoring'] }\n\n\t\t\tMU.log \"Creating EC2 instance #{node}\"\n\t\t\tMU.log \"Instance details for #{node}: #{instance_descriptor}\", MU::DEBUG\n#\t\t\t\tif instance_descriptor[:block_device_mappings].empty?\n#\t\t\t\t\tinstance_descriptor.delete(:block_device_mappings)\n#\t\t\t\tend\n#pp instance_descriptor[:block_device_mappings]\n\t\t\tretries = 0\n\t\t\tbegin\n\t\t\t\tresponse = MU.ec2(@server['region']).run_instances(instance_descriptor)\n\t\t\trescue Aws::EC2::Errors::InvalidGroupNotFound, Aws::EC2::Errors::InvalidSubnetIDNotFound, Aws::EC2::Errors::InvalidParameterValue, Aws::EC2::Errors::RequestLimitExceeded => e\n\t\t\t\tif retries < 10\n\t\t\t\t\tif retries > 7\n\t\t\t\t\t\tMU.log \"Seeing #{e.inspect} while trying to launch #{node}, retrying a few more times...\", MU::WARN, details: instance_descriptor\n\t\t\t\t\tend\n\t\t\t\t\tsleep 10\n\t\t\t\t\tretries = retries + 1\n\t\t\t\t\tretry\n\t\t\t\telse\n\t\t\t\t\traise e\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tinstance = response.instances.first\n\t\t\tMU.log \"#{node} (#{instance.instance_id}) coming online\"\n\n\n\t\t\treturn instance\n\n\t\tend", "def execute\n log.info 'Creating the Basic VM'\n placement_spec = VMPlacementHelper.get_placementspec_vm(service_manager.vapi_config, datacenter_name, folder_name, datastore_name)\n standard_network = NetworkHelper.get_standard_network_mapping(service_manager.vapi_config, @datacenter_name, standard_portgroup_name)\n boot_disk = VCENTER_HARDWARE_DISK_CLASS::CreateSpec.new('type' => VCENTER_HARDWARE_DISK_CLASS::HostBusAdapterType::SCSI,\n 'scsi' => VCENTER_HARDWARE_MODULE::ScsiAddressSpec.new('bus'=>0,'unit'=>0),\n 'new_vmdk' => VCENTER_HARDWARE_DISK_CLASS::VmdkCreateSpec.new() )\n data_disk = VCENTER_HARDWARE_DISK_CLASS::CreateSpec.new('new_vmdk' => VCENTER_HARDWARE_DISK_CLASS::VmdkCreateSpec.new())\n ethernet_nic_0 = VCENTER_HARDWARE_ETHERNET_CLASS::CreateSpec.new('start_connected' => true,\n 'backing' => VCENTER_HARDWARE_ETHERNET_CLASS::BackingSpec.new(\n 'type' => VCENTER_HARDWARE_ETHERNET_CLASS::BackingType::STANDARD_PORTGROUP,\n 'network' => standard_network))\n boot_device_order = [VCENTER_HARDWARE_BOOT_DEVICE_CLASS::EntryCreateSpec.new('type' => VCENTER_HARDWARE_BOOT_DEVICE_CLASS::Type::ETHERNET),\n VCENTER_HARDWARE_BOOT_DEVICE_CLASS::EntryCreateSpec.new('type' => VCENTER_HARDWARE_BOOT_DEVICE_CLASS::Type::DISK)]\n vm_create_spec = VCENTER_VM_CLASS::CreateSpec.new('name' => vm_name,\n 'guest_OS' => VCENTER_VM_GUESTOS_CLASS::WINDOWS_8_64,\n 'placement' => placement_spec,\n 'disks' => [boot_disk, data_disk],\n 'nics' => [ethernet_nic_0],\n 'boot_devices' => boot_device_order)\n log.info 'The CreateVM Spec is '\n #Pretty print the create spec of the VM.\n pp vm_create_spec\n vm_id = vm_svc.create(vm_create_spec)\n log.info \"Created vm #{vm_name} with the VM Identifier #{vm_id}\"\n end", "def create\n @deployment = Deployment.new(deployment_params)\n\n respond_to do |format|\n if @deployment.save\n format.html { redirect_to @deployment, notice: 'Deployment was successfully created.' }\n format.json { render :show, status: :created, location: @deployment }\n else\n format.html { render :new }\n format.json { render json: @deployment.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_instance_template request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n uri, body, query_string_params = transcode_set_instance_template_request request_pb\n response = @client_stub.make_post_request(\n uri: uri,\n body: body,\n params: query_string_params,\n options: options\n )\n result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true\n\n yield result, response if block_given?\n result\n end", "def create\n params[:deployment_id] = Deployment.find_key(params[:deployment]).id if params.has_key? :deployment\n params[:deployment_id] ||= Deployment.system\n params.require(:name)\n params.require(:deployment_id)\n default_net = nil\n Node.transaction do\n @node = Node.create!(params.permit(:name,\n :description,\n :admin,\n :deployment_id,\n :allocated,\n :alive,\n :system,\n :available,\n :bootenv))\n # Keep suport for mac and ip hints in short form around for legacy Sledgehammer purposes\n if params[:ip]\n default_net = Network.lookup_network(params[:ip]) ||\n Network.find_by_name(\"unmanaged\")\n Attrib.set(\"hint-#{default_net.name}-v4addr\",@node,params[:ip]) if default_net\n Attrib.set(\"hint-admin-macs\", @node, [params[:mac]]) if params[:mac]\n end\n end\n default_net.make_node_role(@node) if default_net\n render api_show @node\n end", "def create\n super(@@service)\n end", "def delete_tier1_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#delete_tier1_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_patch_tier1_l2_vpn_service_with_http_info(tier_1_id, locale_service_id, service_id, l2_vpn_service, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service\"\n end\n # verify the required parameter 'service_id' is set\n if @api_client.config.client_side_validation && service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service\"\n end\n # verify the required parameter 'l2_vpn_service' is set\n if @api_client.config.client_side_validation && l2_vpn_service.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_vpn_service' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/l2vpn-services/{service-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-id' + '}', service_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_vpn_service)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi#create_or_patch_tier1_l2_vpn_service\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @deployment = current_user.deployments.new(params[:deployment])\n\n respond_to do |format|\n if @deployment.save\n unless @deployment.environment.running?\n @deployment.environment.start!\n end\n format.html { redirect_to(@deployment.app, :notice => 'Application was successfully deployed.') }\n format.xml { render :xml => @deployment, :status => :created, :location => @deployment }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @deployment.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @deployment = Deployment.new(params[:deployment])\n\n respond_to do |format|\n if @deployment.save\n format.html { redirect_to @deployment, notice: 'Deployment was successfully created.' }\n format.json { render json: @deployment, status: :created, location: @deployment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @deployment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_tier1_byod_policy_service_instance(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts = {})\n data, _status_code, _headers = create_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts)\n data\n end", "def create\n @instance = @provider.instances.new(params[:instance])\n @instance.state = \"Building\"\n respond_to do |format|\n if @instance.save\n @instance.create_instance(@provider.connect!)\n format.html { redirect_to cloud_provider_instance_path(@provider,@instance), notice: 'Instance was successfully created.' }\n format.json { render json: @instance, status: :created, location: @instance }\n else\n format.html { render action: \"new\" }\n format.json { render json: @instance.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_resource(env)\n env[:ui].info(\"Creating machine\")\n\n config = env[:machine].provider_config\n vra = env[:vra]\n\n EntitledItemsCollection.fetch(env[:vra])\n .find_by_id(config.catalog_item_id)\n .request(cpus: config.cpus,\n memory: config.memory,\n requested_for: config.requested_for,\n subtenant_id: config.subtenant_id,\n lease_days: config.lease_days) { |req|\n config.extra_entries.types.each do |type|\n config.extra_entries.of_type(type).each do |k,v|\n req.set_parameter(k, type, v)\n end\n end\n }\n .join\n .machine\n end", "def create\n @instance_fault = InstanceFault.new(params[:instance_fault])\n\n respond_to do |format|\n if @instance_fault.save\n format.html { redirect_to @instance_fault, notice: 'Instance fault was successfully created.' }\n format.json { render json: @instance_fault, status: :created, location: @instance_fault }\n else\n format.html { render action: \"new\" }\n format.json { render json: @instance_fault.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tb_servicio = TbServicio.new(tb_servicio_params)\n\n respond_to do |format|\n if @tb_servicio.save\n format.html { redirect_to @tb_servicio, notice: 'Tb servicio was successfully created.' }\n format.json { render :show, status: :created, location: @tb_servicio }\n else\n format.html { render :new }\n format.json { render json: @tb_servicio.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @taxi_sevice = TaxiSevice.new(taxi_sevice_params)\n\n respond_to do |format|\n if @taxi_sevice.save\n format.html { redirect_to action: \"index\" }\n else\n format.html { render :new }\n format.json { render json: @taxi_sevice.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @item_tier = ItemTier.new(item_tier_params)\n\n respond_to do |format|\n if @item_tier.save\n format.html { redirect_to @item_tier, notice: 'Item tier was successfully created.' }\n format.json { render :show, status: :created, location: @item_tier }\n else\n format.html { render :new }\n format.json { render json: @item_tier.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_update_tier1_l2_vpn_service_0_with_http_info(tier_1_id, locale_service_id, service_id, l2_vpn_service, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'service_id' is set\n if @api_client.config.client_side_validation && service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'l2_vpn_service' is set\n if @api_client.config.client_side_validation && l2_vpn_service.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_vpn_service' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/l2vpn-services/{service-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-id' + '}', service_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_vpn_service)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2VPNService')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi#create_or_update_tier1_l2_vpn_service_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_on_backend\n lab = Lab.find(self.lab_id)\n Rails.logger.info \"Creating tenant #{self.name} on openstack backend #{lab.name}.\"\n\n # First, run through some checks to ensure we can create the whole tenant properly\n # Check if an external network exists\n admin_network_c = lab.get_neutron(lab.auth_tenant) \n ext_network = admin_network_c.list_networks.select {|n| n.external == true}\n if ext_network.empty?\n Rails.logger.error \"There are no external networks on the OpenStack host\"\n return false\n end\n\n # Check if there are enough available floating ips\n # There does not appear to be an api endpoint to check ips available for an instance to check out\n # TODO - Take another look at this.\n\n # Create the tenant\n identity_c = get_connection(\"identity\")\n identity_c.create_tenant({:name => self.name, :description => \"Created by OpenShift Labs app\", :enabled => true})\n tenant = identity_c.tenants.select {|t| t.name == self.name}.first\n if tenant.nil?\n Rails.logger.error \"Attempted to create tenant with name #{self.name}, but tenant does not exist after creation.\"\n return false\n else\n Rails.logger.info \"Created tenant #{self.name} with tenant id #{tenant.id}.\"\n self.uuid = tenant.id\n end\n\n # If any of the following fails, we need to be sure we delete the OpenStack backend tenant\n begin\n\n # Add the lab's user to the tenant\n # TODO the below assumes an admin role exists. Need to verify that this is always the case.\n role = identity_c.list_roles.select {|r| r[:name] == \"admin\"}.first\n admin_user = identity_c.list_users.select {|u| u.name == lab.username }.first\n Rails.logger.info \"Adding user #{admin_user.name} to the #{self.name} tenant.\"\n identity_c.add_user_to_tenant({:tenant_id => tenant.id, :role_id => role[:id], :user_id => admin_user.id})\n\n # Get the compute and neutron connections\n compute_c = get_connection(\"compute\")\n network_c = get_connection(\"network\")\n\n # Set the quotas appropriately\n # Works needs to be done in the ruby-openstack gem to support this.\n Rails.logger.info \"Setting #{self.name} tenant quotas.\"\n compute_c.set_limits(tenant.id, {:cores => lab.default_quota_cores,\n :floating_ips => lab.default_quota_instances,\n :instances => lab.default_quota_instances,\n :ram => lab.default_quota_ram\n })\n\n # Create a network\n network_name = self.name + \"-network\"\n Rails.logger.info \"Creating network with name #{network_name} for tenant #{self.name}.\"\n network = network_c.create_network(network_name, {:admin_state_up => true})\n self.network = network_name\n\n # Create a subnet\n subnet_name = self.name + \"-subnet\"\n # TODO nameservers are hard-coded, but could change. Need to have them entered somewhere.\n Rails.logger.info \"Creating subnet with name #{subnet_name} for tenant #{self.name}.\"\n subnet = network_c.create_subnet(network.id, \"192.168.1.0/24\", \"4\", {:name => subnet_name, :gateway_ip => \"192.168.1.1\", :enable_dhcp => true, :dns_nameservers => ['10.11.5.3', '10.11.5.4']})\n\n # Create a router and add interface to subnet\n router_name = self.name + \"-router\"\n # TODO we grab the first external network, we should have a user specify which one to use somewhere, in case there are multiple\n external_network = network_c.list_networks.select {|n| n.external == true }.first\n Rails.logger.info \"Creating router with name #{router_name} for tenant #{self.name}.\"\n router = network_c.create_router(router_name, true, {:external_gateway_info => {:network_id => external_network.id}})\n Rails.logger.info \"Adding router interface for subnet #{subnet_name} on router #{router_name}.\"\n network_c.add_router_interface(router.id, subnet.id)\n\n # Get the default security group\n # TODO we assume there is a default security group, probably not the best way to go about this.\n security_group = compute_c.security_groups.select {|k,v| v[:name] == \"default\"}\n self.security_group = \"default\"\n security_group_id = security_group.keys.first\n\n # Delete default security group rules\n Rails.logger.info \"Removing default Ingress security group rules for tenant #{self.name}.\"\n security_group[security_group_id][:rules].each do |rule|\n compute_c.delete_security_group_rule(rule[:id])\n end\n\n # Create necessary security group rules\n Rails.logger.info \"Creating all-open security groups rules for tcp, udp, and icmp on tenant #{self.name}\"\n compute_c.create_security_group_rule(security_group_id, \n {:ip_protocol => \"tcp\", :from_port => 1, :to_port => 65535, :cidr => \"0.0.0.0/0\"})\n compute_c.create_security_group_rule(security_group_id, \n {:ip_protocol => \"udp\", :from_port => 1, :to_port => 65535, :cidr => \"0.0.0.0/0\"})\n compute_c.create_security_group_rule(security_group_id, \n {:ip_protocol => \"icmp\", :from_port => -1, :to_port => -1, :cidr => \"0.0.0.0/0\"})\n\n # Allocate all necessary floating ips\n # TODO shouldn't just get the first pool, should have a dropdown and database entry in project\n Rails.logger.info \"Allocating #{lab.default_quota_instances} floating ips to tenant #{self.name}\"\n floating_ip_pool = compute_c.get_floating_ip_pools.first[\"name\"]\n lab.default_quota_instances.times do\n compute_c.create_floating_ip(:pool => floating_ip_pool)\n end\n \n Rails.logger.info \"Tenant #{self.name} creation completed.\"\n rescue => e\n Rails.logger.error \"Could not create OpenStack backend tenant due to:\"\n Rails.logger.error e.message\n Rails.logger.error e.backtrace\n destroy_backend\n end\n\n end", "def create(cluster_id)\n # create ONE object\n new_object\n\n rc = @one.allocate(format_template(@p_template), cluster_id)\n Utils.exception(rc)\n rc = @one.info\n Utils.exception(rc)\n\n OneProvisionLogger.debug(\n \"#{@type} created with ID: #{@one.id}\"\n )\n\n Integer(@one.id)\n end", "def create_tier1_service_interface_0(tier_1_id, locale_service_id, interface_id, service_interface, opts = {})\n data, _status_code, _headers = create_tier1_service_interface_0_with_http_info(tier_1_id, locale_service_id, interface_id, service_interface, opts)\n data\n end", "def new\n @tier_setting = TierSetting.new(tier: @week.next_missing_tier)\n end", "def create\n @tc_detail_step = TcDetailStep.new(params[:tc_detail_step])\n\n respond_to do |format|\n if @tc_detail_step.save\n format.html { redirect_to @tc_detail_step, notice: 'Tc detail step was successfully created.' }\n format.json { render json: @tc_detail_step, status: :created, location: @tc_detail_step }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tc_detail_step.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n deploy\n end", "def start\n service.pool_action uuid, :create\n end", "def delete_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#delete_tier1_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_tier1_locale_services_0_with_http_info(tier_1_id, locale_services_id, locale_services, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services_0\"\n end\n # verify the required parameter 'locale_services' is set\n if @api_client.config.client_side_validation && locale_services.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(locale_services)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#create_or_replace_tier1_locale_services_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_sap_pvm_instance(instance_hash)\n post(\"cloud-instances/#{guid}/sap\", instance_hash.to_json)\n end", "def create\n @tm_dev1 = TmDev1.new(params[:tm_dev1])\n\n respond_to do |format|\n if @tm_dev1.save\n flash[:notice] = 'TmDev1 was successfully created.'\n format.html { redirect_to(@tm_dev1) }\n format.xml { render :xml => @tm_dev1, :status => :created, :location => @tm_dev1 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @tm_dev1.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create_or_replace_tier1_locale_services_with_http_info(tier_1_id, locale_services_id, locale_services, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services\"\n end\n # verify the required parameter 'locale_services' is set\n if @api_client.config.client_side_validation && locale_services.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(locale_services)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#create_or_replace_tier1_locale_services\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n response.add(exec: \"kubectl create ns #{namespace}\", env: kube_env)\n response.add(exec: \"kubectl label namespace #{namespace} istio-injection=enabled --overwrite\", env: kube_env)\n # errors.add(:kubectl_label_namespace, stderr) if exit_code.positive? and stderr.index('AlreadyExists').nil?\n\n # deploy helm into namespace\n # TODO: Need to generate tiller-rbac\n response.add(exec: kubectl(\"apply -f #{target.write_path}/tiller-k8s-ns.yml\"), env: kube_env)\n response.add(exec: 'helm init --upgrade --wait --service-account tiller', env: kube_env)\n end", "def read_tier1_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def add_instance(opts)\n unless %w[app util].include?(opts[:role].to_s)\n # Fail immediately because we don't have valid arguments.\n raise InvalidInstanceRole, \"Instance role must be one of: app, util\"\n end\n\n # Sanitize the name to remove whitespace if there is any\n if opts[:name]\n name = opts[:name].gsub(/\\s+/, '')\n end\n\n if opts[:role] == 'util'\n unless name && name.length > 0\n raise InvalidInstanceName, \"When specifying a util instance you must also specify a name.\"\n end\n end\n \n request = { \"role\" => opts[:role], \"name\" => opts[:name] }\n request['snapshot_id'] = opts[:snapshot_id] if opts.key?(:snapshot_id)\n request['instance_size'] = opts[:instance_size] if opts.key?(:instance_size)\n\n # We know opts[:role] is right, name can be passed straight to the API.\n # Return the response body for error output, logging, etc.\n return api.post(\"/environments/#{id}/add_instances\", :request => request)\n end", "def create_vm\n if new_resource.clone\n clone_vm\n else\n data = {\n vmid: vmid,\n bootdisk: 'virtio0',\n cores: INSTANCE_SIZE[new_resource.size]['cpu'],\n memory: INSTANCE_SIZE[new_resource.size]['memory'],\n ide2: \"#{new_resource.cdrom},media=cdrom\",\n numa: (new_resource.numa ? 1 : 0),\n ostype: get_type(new_resource.ostype),\n sockets: 1,\n virtio0: \"#{new_resource.storage}:/vm-#{vmid}-disk-1.qcow2,size=#{new_resource.disk}\"\n }.merge(new_resource.net)\n data.merge(hugepages: new_resource.hugepages) if new_resource.hugepages\n api.post(\"/nodes/#{new_resource.host}/qemu\", data)\n end\nend", "def server_create(server_name, template)\n # calculate instance id\n Puppet.debug \"template keys => \" + JSON.pretty_generate(template)\n\n server_id, server_host = ::Pinas::Common.extract_instance_id_from(server_name)\n\n # 1. setup the default options\n options = {\n :name => server_name,\n :flavor_ref => get_flavor(template[:flavor_name]), # For Openstack provider\n :image_ref => get_image(template[:image_name]), # For Openstack provider\n :flavor_id => get_flavor(template[:flavor_name]), # For HPCloud provider\n :image_id => get_image(template[:image_name]), # For HPCloud provider\n :key_name => template[:key_name],\n :security_groups => template[:security_groups],\n }\n Puppet.debug \"setup default options = >\" + JSON.pretty_generate(options)\n # 2. setup the meta data/user data for the server, for boot hooks\n begin\n options[:metadata] = meta_to_hash(ERB.new(template[:meta_data]).result(binding)) if template.has_key?(:meta_data)\n rescue Exception => e\n Puppet.crit \"servers.create in running erb for :metadata, Error: #{e}\"\n raise Puppet::Error, \"Error : #{e}\"\n end\n begin\n options[:user_data] = ERB.new(File.read(template[:user_data])).result(binding) if template.has_key?(:user_data)\n rescue Exception => e\n Puppet.crit \"servers.create in running erb for :user_data, Error: #{e}\"\n raise Puppet::Error, \"Error : #{e}\"\n end\n Puppet.debug \"added metadata and user_data\"\n Puppet.debug \"has network_name key ? #{template.has_key?(:network_name)}\"\n Puppet.debug \"network class => #{network.class}\"\n Puppet.debug \"template[:network_name] => #{template[:network_name]}\"\n Puppet.debug \"template[:network_name] => #{template['network_name']}\"\n # 3. get the network uuid and name\n if @network != nil and template.has_key?(:network_name) and template[:network_name] != ''\n Puppet.debug \"adding network #{template[:network_name]}\"\n networks = Array.new\n nics = Array.new\n nics << get_networkid(template[:network_name])\n # nics << template[:network_name]\n Puppet.debug \"working on nics => #{nics}.\"\n begin\n nics.each do |net|\n Puppet.debug \"working on net => #{net}\"\n network = find_match(@network.networks, net)\n networks.push('net_id' => network.id) if network\n end\n options[:nics] = networks\n rescue Exception => e\n raise Puppet::Error, \"Problem assigning nics, #{e}\"\n end\n Puppet.debug \"after options, got = >\" + JSON.pretty_generate(options)\n end\n # 4. create new server and wait for it to be ready.\n # TODO: implement retryable and wait for code. need to confirm we have a timeout in fog.\n # server = @compute.servers.create(options)\n # retryable(on: Timeout::Error, tries: 200) do\n # begin\n # server.wait_for(30) { ready? }\n # rescue RuntimeError, Fog::Errors::TimeoutError => e\n # end\n # end\n Puppet.debug \"attempting to create server #{server_name}\"\n new_server = nil\n begin\n new_server = @compute.servers.create(options)\n new_server.wait_for { ready?}\n new_server.wait_for { !addresses.nil? }\n rescue Exception => e\n Puppet.crit \"servers.create Error: #{e}\"\n raise Puppet::Error, \"Error : #{e}\"\n end\n\n Puppet.notice \"server created #{server_name} on net #{template[:network_name]} \"\n begin\n newserver_ip_assign(new_server)\n rescue Exception => e\n Puppet.crit \"server_ip_assign Error: #{e}\"\n raise Puppet::Error, \"Error : #{e}\"\n end\n\n end", "def create\n @tech_serv = TechServ.new(tech_serv_params)\n\n respond_to do |format|\n if @tech_serv.save\n format.html { redirect_to [:admin, @tech_serv], notice: '技术服务创建成功.' }\n format.json { render action: 'show', status: :created, location: @tech_serv }\n else\n format.html { render action: 'new' }\n format.json { render json: @tech_serv.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @service = Service.create(service_params)\n end", "def create_instance project_id:, instance_id:\n # [START spanner_create_instance]\n # project_id = \"Your Google Cloud project ID\"\n # instance_id = \"Your Spanner instance ID\"\n\n require \"google/cloud/spanner\"\n require \"google/cloud/spanner/admin/instance\"\n\n instance_admin_client = Google::Cloud::Spanner::Admin::Instance.instance_admin\n\n project_path = instance_admin_client.project_path project: project_id\n instance_path = instance_admin_client.instance_path project: project_id, instance: instance_id\n instance_config_path = instance_admin_client.instance_config_path project: project_id, instance_config: \"regional-us-central1\"\n\n job = instance_admin_client.create_instance parent: project_path,\n instance_id: instance_id,\n instance: { name: instance_path,\n config: instance_config_path,\n display_name: instance_id,\n node_count: 2,\n labels: { cloud_spanner_samples: \"true\" } }\n\n puts \"Waiting for create instance operation to complete\"\n\n job.wait_until_done!\n\n if job.error?\n puts job.error\n else\n puts \"Created instance #{instance_id}\"\n end\n # [END spanner_create_instance]\nend", "def call\n # Update service and update context\n self.service = Entities::Service.find_by_system_name(remote: threescale_client,\n system_name: service_system_name)\n if service.nil?\n # Create service and update context\n self.service = Entities::Service.create(remote: threescale_client,\n service_params: service_settings)\n logger.info \"Created service id: #{service.id}, name: #{service_name}\"\n else\n service.update(service_settings)\n logger.info \"Updated service id: #{service.id}, name: #{service_name}\"\n end\n\n report['id'] = service.id\n report['system_name'] = service.system_name\n report['name'] = service.name\n report['backend_version'] = api_spec.service_backend_version\n end", "def start\n debug \"Call 'start' for Pacemaker service '#{name}' on node '#{hostname}'\"\n disable_basic_service_on_action :start\n\n enable unless primitive_is_managed? name\n\n if pacemaker_options[:cleanup_on_start]\n if not pacemaker_options[:cleanup_only_if_failures] or primitive_has_failures? name, hostname\n cleanup\n end\n end\n\n if pacemaker_options[:add_location_constraint]\n service_location_add full_name, hostname unless service_location_exists? full_name, hostname\n end\n\n if primitive_is_multistate? name\n service_start_mode pacemaker_options[:start_mode_multistate]\n elsif primitive_is_clone? name\n service_start_mode pacemaker_options[:start_mode_clone]\n else\n service_start_mode pacemaker_options[:start_mode_simple]\n end\n\n debug cluster_debug_report \"#{@resource} start\"\n end", "def deploy(id, host, xml_text, lcm_state, deploy_id)\n # Restore if we need to\n if lcm_state != \"BOOT\" && lcm_state != \"BOOT_FAILURE\"\n restore(deploy_id)\n return deploy_id\n end\n\n # Otherwise deploy the VM\n\n begin\n ec2_info = get_deployment_info(host, xml_text)\n rescue Exception => e\n raise e\n end\n\n load_default_template_values\n\n if !ec2_value(ec2_info, 'AMI')\n raise \"Cannot find AMI in deployment file\"\n end\n\n opts = generate_options(:run, ec2_info, {\n :min_count => 1,\n :max_count => 1})\n\n # The OpenNebula context will be only included if not USERDATA\n # is provided by the user\n if !ec2_value(ec2_info, 'USERDATA')\n xml = OpenNebula::XMLElement.new\n xml.initialize_xml(xml_text, @provision_type == :host ? 'HOST' : 'VM')\n\n if xml.has_elements?('TEMPLATE/CONTEXT')\n # if requested, we generated cloud-init compatible data\n if ec2_value(ec2_info, 'CLOUD_INIT') =~ /^(yes|true)$/i\n context_str = generate_cc(xml, 'TEMPLATE/CONTEXT')\n else\n # Since there is only 1 level ',' will not be added\n context_str = xml.template_like_str('TEMPLATE/CONTEXT')\n\n if xml['TEMPLATE/CONTEXT/TOKEN'] == 'YES'\n # TODO use OneGate library\n token_str = generate_onegate_token(xml)\n if token_str\n context_str << \"\\nONEGATE_TOKEN=\\\"#{token_str}\\\"\"\n end\n end\n end\n\n userdata_key = EC2[:run][:args][\"USERDATA\"][:opt]\n opts[userdata_key] = Base64.encode64(context_str)\n end\n end\n\n instances = @ec2.create_instances(opts)\n instance = instances.first\n\n start_time = Time.now\n\n while Time.now - start_time < @state_change_timeout\n begin\n break if instance.exists?\n rescue => e\n OpenNebula::log_error(\"RESCUE: #{e.inspect}\")\n end\n\n sleep 2\n end\n\n tags = generate_options(:tags, ec2_info)[:tags] || {}\n\n tag_array = []\n tags.each{ |key,value|\n tag_array << {\n :key => key,\n :value => value\n }\n }\n\n instance.create_tags(:tags => tag_array) if tag_array.length > 0\n\n elastic_ip = ec2_value(ec2_info, 'ELASTICIP')\n\n wait_state('running', instance.id)\n\n if elastic_ip\n\n if elastic_ip.match(Resolv::IPv4::Regex)\n address_key = :public_ip\n else\n address_key = :allocation_id\n end\n\n address = {\n :instance_id => instance.id,\n address_key => elastic_ip\n }\n\n @ec2.client.associate_address(address)\n end\n\n if @provision_type == :host\n instance.create_tags(tags: [{\n key: 'Name',\n value: host['//HOST/TEMPLATE/PROVISION/HOSTNAME']\n },{\n key: 'ONE_HOST_ID',\n value: 'TODO'\n }])\n else\n instance.create_tags(tags: [{\n key: 'ONE_ID',\n value: id\n }])\n end\n\n puts(instance.id)\n end" ]
[ "0.5966553", "0.5942494", "0.57729596", "0.5761643", "0.5721342", "0.5680341", "0.56783146", "0.56118655", "0.5593257", "0.55579007", "0.5545643", "0.55279666", "0.5478629", "0.5472563", "0.54699564", "0.54158574", "0.5377489", "0.53661704", "0.53661686", "0.5329897", "0.5280286", "0.52138424", "0.5212444", "0.52105916", "0.52103215", "0.52084994", "0.5181625", "0.5169088", "0.51690173", "0.5154247", "0.51482904", "0.51479036", "0.51453704", "0.51353955", "0.51294035", "0.5121166", "0.5119049", "0.5112069", "0.51112425", "0.5106834", "0.51051754", "0.50950944", "0.50832313", "0.5080229", "0.5072793", "0.5070163", "0.50662863", "0.50595504", "0.5054057", "0.50538033", "0.50468284", "0.5046613", "0.5043956", "0.50323886", "0.502921", "0.5024885", "0.50246114", "0.5020746", "0.49981153", "0.49863493", "0.4985661", "0.49819663", "0.4980664", "0.497556", "0.49745807", "0.49647474", "0.49586403", "0.4957697", "0.49571827", "0.49528298", "0.4952771", "0.49498767", "0.49425343", "0.49331647", "0.4927473", "0.492518", "0.49247772", "0.49247375", "0.491136", "0.4903899", "0.48967096", "0.4895929", "0.48901668", "0.48839352", "0.48834613", "0.48820424", "0.4876308", "0.48731476", "0.4872724", "0.48717836", "0.48703867", "0.48631346", "0.48608553", "0.48572293", "0.48558587", "0.48453552", "0.48434427", "0.48360234", "0.48356128", "0.48260596" ]
0.5183686
26
Create Tier1 service instance Create Tier1 Service Instance. Please note that, only display_name, description and deployment_spec_name are allowed to be modified in an exisiting entity. If the deployment spec name is changed, it will trigger the upgrade operation for the SVMs.
def patch_tier1_policy_service_instance_0(tier_1_id, locale_service_id, service_instance_id, policy_service_instance, opts = {}) patch_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, policy_service_instance, opts) nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create(name, config)\n # @step: validate the user defined options\n validate(config)\n\n # @step: create the infrastructure deployment\n begin\n provision_aks(name, config)\n rescue StandardError => e\n raise InfrastructureError, \"failed to provision cluster, error: #{e}\"\n end\n\n # @step: bootstrap the cluster\n begin\n provision_cluster(name, config)\n rescue StandardError => e\n raise InfrastructureError, \"failed to bootstrap cluster, error: #{e}\"\n end\n end", "def create_or_replace_tier1(tier_1_id, tier1, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_with_http_info(tier_1_id, tier1, opts)\n data\n end", "def create_tier1_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance\"\n end\n # verify the required parameter 'policy_service_instance' is set\n if @api_client.config.client_side_validation && policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_tier1_0(tier_1_id, tier1, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_0_with_http_info(tier_1_id, tier1, opts)\n data\n end", "def create_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'policy_service_instance' is set\n if @api_client.config.client_side_validation && policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_tier1_service_instance_endpoint_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint' is set\n if @api_client.config.client_side_validation && service_instance_endpoint.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_instance_endpoint)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInstanceEndpoint')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_service_instance_endpoint_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_tier1_service_instance_endpoint_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_endpoint' is set\n if @api_client.config.client_side_validation && service_instance_endpoint.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_instance_endpoint)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInstanceEndpoint')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_service_instance_endpoint\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_kvm_instance(name, opts={})\n cmd = \"virt-install -n #{name} --ram #{opts[:memory]} --disk \" <<\n \"path=#{File.join(KVM_HOME, 'storage', \"#{name}.qcow2\")},device=disk,bus=virtio,format=qcow2 \" <<\n \"-v --import --noautoconsole --vcpus=#{opts[:vcpus]},maxvcpus=#{opts[:maxvcpus]}\" \n unless(system(cmd))\n raise \"Failed to create KVM instance!\"\n end \nend", "def create_service\n super.tap do |service_template|\n service_template.cookbook('poise-service')\n create_monit_config\n end\n end", "def add_tier\n begin\n with_transaction do\n Tier.create!(\n name: params[:name],\n stage: params[:stage],\n pipeline_id: @pipeline.id\n )\n\n render json: tiers_for_pipeline_view\n end\n rescue Exception => e\n error = \"#{ConfluxErrors::TierCreationFailed} - #{e}\"\n logger.error { error }\n render json: { message: error }, status: 500\n end\n end", "def create_kubernetes_virtual_machine_instance_type_with_http_info(kubernetes_virtual_machine_instance_type, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: KubernetesApi.create_kubernetes_virtual_machine_instance_type ...'\n end\n # verify the required parameter 'kubernetes_virtual_machine_instance_type' is set\n if @api_client.config.client_side_validation && kubernetes_virtual_machine_instance_type.nil?\n fail ArgumentError, \"Missing the required parameter 'kubernetes_virtual_machine_instance_type' when calling KubernetesApi.create_kubernetes_virtual_machine_instance_type\"\n end\n # resource path\n local_var_path = '/api/v1/kubernetes/VirtualMachineInstanceTypes'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(kubernetes_virtual_machine_instance_type)\n\n # return_type\n return_type = opts[:debug_return_type] || 'KubernetesVirtualMachineInstanceType'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"KubernetesApi.create_kubernetes_virtual_machine_instance_type\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: KubernetesApi#create_kubernetes_virtual_machine_instance_type\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def service_create(name, display_name, executable_on_host,startup=2)\n\t\tif session_has_services_depend?\n\t\t\tmeterpreter_service_create(name, display_name, executable_on_host,startup)\n\t\telse\n\t\t\tshell_service_create(name, display_name, executable_on_host,startup)\n\t\tend\n\tend", "def create_kvm(kvm_name, template, options)\n ensure_name_availability!(kvm_name)\n clone_kvm(kvm_name, template)\n device = mount_kvm_volume(kvm_name)\n address = update_kvm_ip(kvm_name)\n update_hostname(kvm_name)\n make_console_accessible(kvm_name)\n unmount_kvm_volume(kvm_name, device)\n create_kvm_instance(kvm_name, options)\n puts \"KVM Node #{kvm_name} available at: #{address}\"\nend", "def create_or_replace_tier1_with_http_info(tier_1_id, tier1, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1\"\n end\n # verify the required parameter 'tier1' is set\n if @api_client.config.client_side_validation && tier1.nil?\n fail ArgumentError, \"Missing the required parameter 'tier1' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(tier1)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#create_or_replace_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_instance(credentials, image_id, opts)\n new_vapp = nil\n vapp_opts = {} #assemble options to pass to Fog::Terremark::Real.instantiate_vapp_template\n terremark_hwp = hardware_profiles(credentials, {:name => 'default'}).first #sanity check values against default\n name = opts[:name]\n if not name\n name = \"inst#{Time.now.to_i}\"\n end\n if name.length > USER_NAME_MAX\n raise \"Parameter name must be #{USER_NAME_MAX} characters or less\"\n end\n unless ( (terremark_hwp.include?(:cpu, opts[:hwp_cpu].to_i)) &&\n (terremark_hwp.include?(:memory, opts[:hwp_memory].to_i)) ) then\n raise Deltacloud::Exceptions::ValidationFailure.new(\n StandardError.new(\"Error with cpu and/or memory values. you said cpu->#{opts[:hwp_cpu]} and mem->#{opts[:hwp_memory]}\")\n )\n end\n vapp_opts['cpus'] = opts[:hwp_cpu]\n vapp_opts['memory'] = opts[:hwp_memory]\n safely do\n terremark_client = new_client(credentials)\n#######\n#FIXME# what happens if there is an issue getting the new vapp id? (eg even though created succesfully)\n#######\n vapp_id = terremark_client.instantiate_vapp_template(name, image_id, vapp_opts).body['href'].split('/').last\n new_vapp = terremark_client.get_vapp(vapp_id)\n return convert_instance(new_vapp, terremark_client, credentials.user) #return an Instance object\n end\n end", "def create_or_replace_tier1_0_with_http_info(tier_1_id, tier1, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1_0\"\n end\n # verify the required parameter 'tier1' is set\n if @api_client.config.client_side_validation && tier1.nil?\n fail ArgumentError, \"Missing the required parameter 'tier1' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(tier1)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#create_or_replace_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_service_instance(name, space_guid, service_plan_id)\n service_plan_instance = CFoundry::V2::ServicePlan.new(service_plan_id, @client)\n service_instance = @client.managed_service_instance\n service_instance.name = name\n service_instance.service_plan = service_plan_instance\n service_instance.space = @client.space(space_guid)\n service_instance.create!\n service_instance\n end", "def create_instance\n create_instances(1).first\n end", "def create\n @t1 = T1.new(params[:t1])\n\n respond_to do |format|\n if @t1.save\n flash[:notice] = 'T1 was successfully created.'\n format.html { redirect_to(@t1) }\n format.xml { render :xml => @t1, :status => :created, :location => @t1 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @t1.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create_virtual_machine(params, options = {})\n image = get_image(params[:image])\n options[:os_type] = image.os_type\n validate_deployment_params(params, options)\n options[:deployment_name] ||= options[:cloud_service_name]\n Azure::Loggerx.info 'Creating deployment...'\n\n options[:cloud_service_name] ||= generate_cloud_service_name(params[:vm_name])\n options[:storage_account_name] ||= generate_storage_account_name(params[:vm_name])\n optionals = {}\n if options[:virtual_network_name]\n virtual_network_service = client.network_management\n virtual_networks = virtual_network_service.list_virtual_networks.select { |x| x.name == options[:virtual_network_name] }\n if virtual_networks.empty?\n Azure::Loggerx.error_with_exit \"Virtual network #{options[:virtual_network_name]} doesn't exists\"\n else\n vnet = virtual_networks.first\n if !vnet.affinity_group.empty?\n options[:affinity_group_name] = vnet.affinity_group\n else\n optionals[:location] = vnet.location\n end\n end\n elsif options[:affinity_group_name]\n optionals[:affinity_group_name] = options[:affinity_group_name]\n else\n optionals[:location] = params[:location]\n end\n cloud_service = client.cloud_service_management\n cloud_service.create_cloud_service(options[:cloud_service_name], optionals)\n cloud_service.upload_certificate(options[:cloud_service_name], params[:certificate]) unless params[:certificate].empty?\n unless image.category == 'User'\n options[:storage_account_name] ||= generate_storage_account_name(params[:vm_name])\n client.storage_management.create_storage_account(options[:storage_account_name], optionals)\n end\n body = Serialization.deployment_to_xml(params, image, options)\n path = \"/services/hostedservices/#{options[:cloud_service_name]}/deployments\"\n Azure::Loggerx.info 'Deployment in progress...'\n request = client.management_request(:post, path, body)\n request.call\n get_virtual_machine(params[:vm_name], options[:cloud_service_name])\n rescue Exception => e\n Azure::Loggerx.error_with_exit \"Failed to create virtual machine : \"+e.message\n end", "def create(id, name: nil, type: :PRODUCTION, labels: nil, clusters: nil)\n end", "def create\n @instance_name = InstanceName.new(params[:instance_name])\n\n respond_to do |format|\n if @instance_name.save\n flash[:notice] = 'InstanceName was successfully created.'\n format.html { redirect_to(@instance_name) }\n format.xml { render :xml => @instance_name, :status => :created, :location => @instance_name }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @instance_name.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'byod_policy_service_instance' is set\n if @api_client.config.client_side_validation && byod_policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'byod_policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(byod_policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_byod_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @servicetype = Servicetype.new(params[:servicetype])\n\n respond_to do |format|\n if @servicetype.save\n format.html { redirect_to @servicetype, notice: 'Servicetype was successfully created.' }\n format.json { render json: @servicetype, status: :created, location: @servicetype }\n else\n format.html { render action: \"new\" }\n format.json { render json: @servicetype.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'byod_policy_service_instance' is set\n if @api_client.config.client_side_validation && byod_policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'byod_policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(byod_policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_byod_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_deployment\n @api.account_id = @options[:src]\n inputs = format_inputs(@old_deployment.show.inputs)\n\n params = {\n :deployment => {\n :name => @old_deployment.name,\n :description => @old_deployment.description\n }\n }\n\n puts \"\\nCreating deployment: \\\"#{params[:deployment][:name]}\\\" in account: #{@options[:dst]} ...\\n\\n\"\n\n @api.account_id = @options[:dst]\n result = @api.deployments.create(params)\n @new_deployment = result.href\n\n # Set deployment level inputs. Cannot set them at create time, so do it now\n deployment = @api.resource(@new_deployment)\n deployment_inputs = {}\n deployment_inputs[:inputs] = inputs\n deployment.inputs.multi_update(deployment_inputs)\nend", "def patch_tier1_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_policy_service_instance\"\n end\n # verify the required parameter 'policy_service_instance' is set\n if @api_client.config.client_side_validation && policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#patch_tier1_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @instance_type = InstanceType.new(params[:instance_type])\n\n respond_to do |format|\n if @instance_type.save\n format.html { redirect_to @instance_type, notice: 'Instance type was successfully created.' }\n format.json { render json: @instance_type, status: :created, location: @instance_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @instance_type.errors, status: :unprocessable_entity }\n end\n end\n end", "def create # rubocop:disable Metrics/AbcSize\n inst_details = AttrFinder.new(@instanceparameters)\n inst_details.options = @options\n inst_details.validate = @validate\n inst_details.function = 'server'\n BmcAuthenticate.new(@options)\n request = OracleBMC::Core::Models::LaunchInstanceDetails.new\n ssh_public_key = @instanceparameters['server']['ssh-key']\n request.availability_domain = inst_details.ad\n request.compartment_id = inst_details.compartment\n request.display_name = @instanceparameters['server']['display_name']\n request.image_id = inst_details.image\n request.shape = @instanceparameters['server']['shape']\n request.subnet_id = inst_details.subnet\n request.metadata = { 'ssh_authorized_keys' => ssh_public_key }\n api = OracleBMC::Core::ComputeClient.new\n response = api.launch_instance(request)\n @instance_id = response.data.id\n compartment(inst_details.compartment)\n running_instance = api.get_instance(@instance_id).wait_until(:lifecycle_state,\n OracleBMC::Core::Models::Instance::LIFECYCLE_STATE_RUNNING,\n max_interval_seconds: 5, max_wait_seconds: 300)\n if @instanceparameters['server']['attachments']\n @instanceparameters['server']['attachments'].each do |vol|\n attach(@instance_id, vol['volume'])\n end\n end\n running_instance\n end", "def create(name, config)\n # @step: build the paramaters\n parameters = [\n { parameter_key: 'AvailabilityZones', parameter_value: config[:availability_zones] },\n { parameter_key: 'BucketName', parameter_value: @templates_bucket },\n { parameter_key: 'BucketVersion', parameter_value: @templates_version },\n { parameter_key: 'ClusterAutoScaler', parameter_value: 'Enabled' },\n { parameter_key: 'ClusterName', parameter_value: name },\n { parameter_key: 'KeyPairName', parameter_value: config[:ssh_keypair] },\n { parameter_key: 'KubernetesVersion', parameter_value: config[:version] },\n { parameter_key: 'NodeGroupName', parameter_value: 'compute' },\n { parameter_key: 'NodeInstanceType', parameter_value: config[:machine_type] },\n { parameter_key: 'NodeVolumeSize', parameter_value: config[:disk_size_gb].to_s },\n { parameter_key: 'NumberOfAZs', parameter_value: config[:availability_zones].split(',').size.to_s },\n { parameter_key: 'NumberOfNodes', parameter_value: config[:size].to_s },\n { parameter_key: 'PrivateSubnet1CIDR', parameter_value: config[:private_subnet1_cidr] },\n { parameter_key: 'PrivateSubnet2CIDR', parameter_value: config[:private_subnet2_cidr] },\n { parameter_key: 'PrivateSubnet3CIDR', parameter_value: config[:private_subnet3_cidr] },\n { parameter_key: 'PublicSubnet1CIDR', parameter_value: config[:public_subnet1_cidr] },\n { parameter_key: 'PublicSubnet2CIDR', parameter_value: config[:public_subnet2_cidr] },\n { parameter_key: 'PublicSubnet3CIDR', parameter_value: config[:public_subnet3_cidr] },\n { parameter_key: 'RemoteAccessCIDR', parameter_value: '0.0.0.0/0' },\n { parameter_key: 'VPCCIDR', parameter_value: config[:network] }\n ]\n\n # @step: provision the cloudformation stacks\n stack_name = 'aws-cluster'\n info \"provisioning the cloudFormation: #{stack_name}\"\n info \"using the template from: #{template_path(stack_name)}\"\n\n outputs = cloudformation(name, template_url: template_path(stack_name), parameters: parameters)\n\n info 'waiting for the kube apiserver to become available'\n client = HubClustersCreator::Kube.new(outputs['EKSEndpoint'], token: build_token(name))\n client.wait_for_kubeapi\n\n # @step: check if the awa-auth configmap exists already, we never overwrite\n unless client.exists?('aws-auth', 'kube-system', 'configmaps')\n info 'provition the aws-auth configureation configmap'\n client.kubectl(default_aws_auth(name))\n\n # @step: ensure we have some nodes\n info 'waiting for some nodes to become available'\n client.wait('aws-node', 'kube-system', 'daemonsets', version: 'extensions/v1beta1') do |x|\n x.status.numberReady.positive?\n end\n end\n\n # @step: provision the cluster\n info 'bootstraping the eks cluster'\n config[:credentials] = {\n access_id: @access_id,\n access_key: @access_key,\n account_id: @account_id,\n region: @region\n }\n\n result = HubClustersCreator::Providers::Bootstrap.new(name, 'eks', client, config).bootstrap\n {\n cluster: {\n ca: outputs['EKSCA'],\n endpoint: outputs['EKSEndpoint'],\n service_account_name: 'sysadmin',\n service_account_namespace: 'kube-system',\n service_account_token: Base64.decode64(client.account('sysadmin'))\n },\n config: config,\n services: result\n }\n end", "def create_tier1_policy_service_instance_0(tier_1_id, locale_service_id, service_instance_id, policy_service_instance, opts = {})\n data, _status_code, _headers = create_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, policy_service_instance, opts)\n data\n end", "def create_virtual_machine(params, options={})\n options[:os_type] = get_os_type(params[:image])\n options[:image_type] = get_image_type(params[:image])\n validate_deployment_params(params, options)\n options[:cloud_service_name] = generate_cloud_service_name(params[:vm_name]) unless options[:cloud_service_name]\n options[:storage_account_name] = generate_storage_account_name(params[:vm_name]) unless options[:storage_account_name] \n optionals = {}\n if options[:virtual_network_name]\n virtual_network_service = Azure::VirtualNetworkManagementService.new\n virtual_networks = virtual_network_service.list_virtual_networks.select{|x| x.name == options[:virtual_network_name]}\n if virtual_networks.empty?\n Loggerx.error_with_exit \"Virtual network #{options[:virtual_network_name]} doesn't exists\"\n else\n optionals[:affinity_group_name] = virtual_networks.first.affinity_group\n end\n elsif options[:affinity_group_name]\n optionals[:affinity_group_name] = options[:affinity_group_name]\n else\n optionals[:location] = params[:location]\n end \n cloud_service = Azure::CloudServiceManagementService.new\n cloud_service.create_cloud_service(options[:cloud_service_name], optionals)\n cloud_service.upload_certificate(options[:cloud_service_name],params[:certificate]) unless params[:certificate].empty?\n Azure::StorageManagementService.new.create_storage_account(options[:storage_account_name], optionals)\n\n body = Serialization.deployment_to_xml(params,options)\n path = \"/services/hostedservices/#{options[:cloud_service_name]}/deployments\"\n Loggerx.info \"Deployment in progress...\"\n request = ManagementHttpRequest.new(:post, path, body)\n request.call\n get_virtual_machine(params[:vm_name],options[:cloud_service_name])\n rescue Exception => e\n e.message\n end", "def create_tier1_service_interface(tier_1_id, locale_service_id, interface_id, service_interface, opts = {})\n data, _status_code, _headers = create_tier1_service_interface_with_http_info(tier_1_id, locale_service_id, interface_id, service_interface, opts)\n data\n end", "def create_pvm_instance(instance_hash)\n post(\"cloud-instances/#{guid}/pvm-instances\", instance_hash.to_json)\n end", "def create_tier1_service_instance_endpoint(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n data, _status_code, _headers = create_tier1_service_instance_endpoint_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts)\n data\n end", "def create\n @servicetype = Servicetype.new(params[:servicetype])\n\n respond_to do |format|\n if @servicetype.save\n format.html { redirect_to @servicetype, :notice => 'Servicetype was successfully created.' }\n format.json { render :json => @servicetype, :status => :created, :location => @servicetype }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @servicetype.errors, :status => :unprocessable_entity }\n end\n end\n end", "def patch_tier1_service_instance_endpoint_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_endpoint' is set\n if @api_client.config.client_side_validation && service_instance_endpoint.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_instance_endpoint)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#patch_tier1_service_instance_endpoint\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @instance_type = InstanceType.new(instance_type_params)\n\n respond_to do |format|\n if @instance_type.save\n format.html { redirect_to @instance_type, notice: 'Instance type was successfully created.' }\n format.json { render action: 'show', status: :created, location: @instance_type }\n else\n format.html { render action: 'new' }\n format.json { render json: @instance_type.errors, status: :unprocessable_entity }\n end\n end\n end", "def post_compute(request)\n # --- Create the new Instance ---\n vm = VirtualMachineOCCI.new(\n VirtualMachine.build_xml,\n @client,\n request.body.read,\n @config[:instance_types],\n @config[:template_location])\n\n # --- Generate the template and Allocate the new Instance ---\n template = vm.to_one_template\n return template, 500 if OpenNebula.is_error?(template)\n\n rc = vm.allocate(template)\n if OpenNebula.is_error?(rc)\n return rc, CloudServer::HTTP_ERROR_CODE[rc.errno]\n end\n\n # --- Prepare XML Response ---\n vm.info\n return to_occi_xml(vm, :code=>201)\n end", "def patch_tier1_service_instance_endpoint_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint' is set\n if @api_client.config.client_side_validation && service_instance_endpoint.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_instance_endpoint)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#patch_tier1_service_instance_endpoint_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_service(resource, actions)\n service_name = get_service_name()\n\n case resource.service_type\n when \"upstart\"\n service service_name do\n provider Chef::Provider::Service::Upstart\n supports :status => true, :restart => true, :reload => true\n action actions\n end\n when \"init.d\"\n service service_name do\n supports :status => true, :restart => true, :reload => true\n action actions\n end\n else\n raise \"dashing: Unknown service_type '#{resource.service_type}'\"\n end\nend", "def start_pvm_instance(instance_id)\n post(\n \"cloud-instances/#{guid}/pvm-instances/#{instance_id}/action\",\n {\"action\" => \"start\"}.to_json\n )\n end", "def patch_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'policy_service_instance' is set\n if @api_client.config.client_side_validation && policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#patch_tier1_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_service(data=nil)\n if (!data.blank? && data.is_a?(Hash))\n @service = Service.create(data)\n else\n @service = Service.create(:name => \"Test Service #{rand(1..1000)}\", :description => \"Test service description.\", :active => true, :probe => \"dummy\", :probe_config => {:value => 1}, :interval => 60, :clean_interval => 86400, :priority => Service::PRIORITY_NORMAL, :resume => :mean_value)\n end\n end", "def create\n @instance = Instance.new(params[:instance])\n\n respond_to do |format|\n if @instance.save\n\n system(\"ssh root@#{CloudGui::Application.config.hypervisor_ip} \\\"exec /data/cloud/scripts/provision.sh #{params[:instance][:cpus]} #{params[:instance][:memory]} #{params[:instance][:baseimage]} 2>&1 | tee /data/cloud/logs/cloud_gui.log\\\"\")\n\n format.html { redirect_to @instance, notice: 'Instance was successfully created.' }\n format.json { render json: @instance, status: :created, location: @instance }\n else\n format.html { render action: \"new\" }\n format.json { render json: @instance.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n submenu_item 'services-new'\n @service = Service.new(params[:service])\n @service_type = @service.type\n service_param\n\n @service.tenant_id = current_user.tenant_id\n\n # service_params = Service.extract_params(params[:service])\n # service_params = Service.extract_thresholds(service_params)\n # @service = Service.new(service_params)\n\n respond_to do |format|\n if @service.save\n flash[:notice] = \"#{@service.name}创建成功\"\n format.html { redirect_to(@service) }\n else\n dictionary\n format.html { render :action => \"new\" }\n end\n end\n end", "def create_tier1_service_instance_endpoint_0(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n data, _status_code, _headers = create_tier1_service_instance_endpoint_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts)\n data\n end", "def create_or_patch_tier1_l2_vpn_service_0_with_http_info(tier_1_id, locale_service_id, service_id, l2_vpn_service, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'service_id' is set\n if @api_client.config.client_side_validation && service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'l2_vpn_service' is set\n if @api_client.config.client_side_validation && l2_vpn_service.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_vpn_service' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/l2vpn-services/{service-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-id' + '}', service_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_vpn_service)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi#create_or_patch_tier1_l2_vpn_service_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_service\n # Check signals here to be nice and abort early if possible.\n check_signals!\n # Enable automatically creates the service with Runit.\n directory \"/var/log/#{new_resource.service_name}\" do\n owner 'root'\n group 'root'\n mode '700'\n end\n end", "def create\n @recreation_service_typology = RecreationServiceTypology.new(recreation_service_typology_params)\n\n respond_to do |format|\n if @recreation_service_typology.save\n format.html { redirect_to @recreation_service_typology, notice: 'Recreation service typology was successfully created.' }\n format.json { render action: 'show', status: :created, location: @recreation_service_typology }\n else\n format.html { render action: 'new' }\n format.json { render json: @recreation_service_typology.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_tier1_service_interface_with_http_info(tier_1_id, locale_service_id, interface_id, service_interface, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface\"\n end\n # verify the required parameter 'service_interface' is set\n if @api_client.config.client_side_validation && service_interface.nil?\n fail ArgumentError, \"Missing the required parameter 'service_interface' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_interface)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#create_tier1_service_interface\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_vm(opts = {})\n opts = opts.with_indifferent_access.reverse_merge(\n VSphereConfig.create_vm_defaults.symbolize_keys || {}\n )\n\n opts[:template_path] = compute.image if compute.image\n\n VSphere.with_connection do |vs|\n dest_folder = opts[:dest_folder]\n vm_name = opts[:name] || \"#{compute.image}-\"\\\n \"#{SecureRandom.hex(4)}-#{Time.new.strftime(\"%Y%m%d\")}\"\n exception_cb = lambda do |_p1|\n LabManager.logger.warn(\n \"Failed attempt to create virtual machine: template_name: #{opts[:template_path]}\"\\\n \", vm_name: #{vm_name}\"\n )\n end\n\n Retryable.retryable(\n tries: VSphereConfig.create_vm_defaults[:vm_clone_retry_count],\n on: [RbVmomi::Fault, CreateVMError, Fog::Compute::Vsphere::NotFound],\n exception_cb: exception_cb,\n sleep: ->(n) { Random.rand(n*3..n*3+10.0) }\n ) do\n LabManager.logger.info \"creating machine with name: #{vm_name} options: #{opts.inspect}\"\n machine = vs.vm_clone(\n 'datacenter' => opts[:datacenter],\n 'datastore' => opts[:datastore],\n 'template_path' => opts[:template_path],\n 'name' => vm_name,\n 'cluster' => opts[:cluster],\n 'linked_clone' => opts[:linked_clone],\n 'dest_folder' => dest_folder,\n 'power_on' => opts[:power_on],\n 'wait' => true\n )\n\n setup_network_interfaces({\n uuid: machine['new_vm']['uuid'],\n connection: vs,\n network_name: VSphereConfig.create_vm_defaults[:network_interface_name]\n })\n\n fail CreateVMError, \"Creation of (#{vm_name}) machine failed, retrying\" unless machine || machine['vm_ref']\n set_provider_data(machine['new_vm'], vs: vs)\n end\n\n add_machine_to_drs_rule(\n vs,\n group: opts[:add_to_drs_group],\n machine: \"#{dest_folder}/#{vm_name}\",\n datacenter: opts[:datacenter]\n ) if opts[:add_to_drs_group]\n end\n poweron_vm unless compute.provider_data['power_state'] == 'poweredOn'\n rescue\n # Try to free unsuccessfully started/configured/... VM\n begin\n terminate_vm\n rescue\n nil\n end if instance_uuid\n raise\n end", "def create_virtual_machine(vm)\n kubevirt_client.create_virtual_machine(vm)\n end", "def create_tier1_policy_service_instance(tier_1_id, locale_service_id, service_instance_id, policy_service_instance, opts = {})\n data, _status_code, _headers = create_tier1_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, policy_service_instance, opts)\n data\n end", "def create_tier1_byod_policy_service_instance_0(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts = {})\n data, _status_code, _headers = create_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts)\n data\n end", "def new\n @service = Service.new\n\n # If a valid type is received, apply to the host to create.\n check_priority_param\n @service.priority = @priority if([email protected]?)\n\n # Add custom views paths\n prepend_view_path \"app/views/services\"\n prepend_view_path \"lib/probes/#{@service.probe}/views\"\n\n respond_to do |format|\n format.html\n end\n end", "def createEc2Instance\n\n instance_descriptor = {\n :image_id => @config[\"image_id\"],\n :key_name => @deploy.ssh_key_name,\n :instance_type => @config[\"size\"],\n :disable_api_termination => true,\n :min_count => 1,\n :max_count => 1\n }\n\n instance_descriptor[:iam_instance_profile] = getIAMProfile\n\n security_groups = myFirewallRules.map { |fw| fw.cloud_id }\n if security_groups.size > 0\n instance_descriptor[:security_group_ids] = security_groups\n else\n raise MuError, \"Didn't get any security groups assigned to be in #{@mu_name}, that shouldn't happen\"\n end\n\n if @config['private_ip']\n instance_descriptor[:private_ip_address] = @config['private_ip']\n end\n\n if [email protected]? and @config.has_key?(\"vpc\")\n subnet = mySubnets.sample\n if subnet.nil?\n raise MuError, \"Got null subnet id out of #{@config['vpc']}\"\n end\n MU.log \"Deploying #{@mu_name} into VPC #{@vpc.cloud_id} Subnet #{subnet.cloud_id}\"\n allowBastionAccess\n instance_descriptor[:subnet_id] = subnet.cloud_id\n end\n\n if [email protected]? and [email protected]?\n instance_descriptor[:user_data] = Base64.encode64(@userdata)\n end\n\n MU::Cloud::AWS::Server.waitForAMI(@config[\"image_id\"], region: @region, credentials: @credentials)\n\n instance_descriptor[:block_device_mappings] = MU::Cloud::AWS::Server.configureBlockDevices(image_id: @config[\"image_id\"], storage: @config['storage'], region: @region, credentials: @credentials)\n\n instance_descriptor[:monitoring] = {enabled: @config['monitoring']}\n\n if @tags and @tags.size > 0\n instance_descriptor[:tag_specifications] = [{\n :resource_type => \"instance\",\n :tags => @tags.keys.map { |k|\n { :key => k, :value => @tags[k] }\n }\n }]\n end\n\n MU.log \"Creating EC2 instance #{@mu_name}\", details: instance_descriptor\n\n instance = resp = nil\n loop_if = Proc.new {\n instance = resp.instances.first if resp and resp.instances\n resp.nil? or resp.instances.nil? or instance.nil?\n }\n\n bad_subnets = []\n mysubnet_ids = if mySubnets\n mySubnets.map { |s| s.cloud_id }\n end\n begin\n MU.retrier([Aws::EC2::Errors::InvalidGroupNotFound, Aws::EC2::Errors::InvalidSubnetIDNotFound, Aws::EC2::Errors::InvalidParameterValue], loop_if: loop_if, loop_msg: \"Waiting for run_instances to return #{@mu_name}\") {\n resp = MU::Cloud::AWS.ec2(region: @region, credentials: @credentials).run_instances(instance_descriptor)\n }\n rescue Aws::EC2::Errors::Unsupported => e\n bad_subnets << instance_descriptor[:subnet_id]\n better_subnet = (mysubnet_ids - bad_subnets).sample\n if e.message !~ /is not supported in your requested Availability Zone/ and\n (mysubnet_ids.nil? or mysubnet_ids.empty? or\n mysubnet_ids.size == bad_subnets.size or\n better_subnet.nil? or better_subnet == \"\")\n raise MuError.new e.message, details: mysubnet_ids\n end\n instance_descriptor[:subnet_id] = (mysubnet_ids - bad_subnets).sample\n if instance_descriptor[:subnet_id].nil?\n raise MuError.new \"Specified subnet#{bad_subnets.size > 1 ? \"s do\" : \" does\"} not support instance type #{instance_descriptor[:instance_type]}\", details: bad_subnets\n end\n MU.log \"One or more subnets does not support instance type #{instance_descriptor[:instance_type]}, attempting with #{instance_descriptor[:subnet_id]} instead\", MU::WARN, details: bad_subnets\n retry\n rescue Aws::EC2::Errors::InvalidRequest => e\n MU.log e.message, MU::ERR, details: instance_descriptor\n raise e\n end\n\n MU.log \"#{@mu_name} (#{instance.instance_id}) coming online\"\n\n instance\n end", "def create\n req = VCAP::Services::Api::ServiceOfferingRequest.decode(request_body)\n logger.debug(\"Create service request: #{req.extract.inspect}\")\n\n # Should we worry about a race here?\n\n success = nil\n svc = Service.find_by_label(req.label)\n if svc\n raise CloudError.new(CloudError::FORBIDDEN) unless svc.verify_auth_token(@service_auth_token)\n attrs = req.extract.dup\n attrs.delete(:label)\n # Keep DB in sync with configs if the token changes in the config\n attrs[:token] = @service_auth_token if svc.is_builtin?\n svc.update_attributes!(attrs)\n else\n # Service doesn't exist yet. This can only happen for builtin services since service providers must\n # register with us to get a token.\n svc = Service.new(req.extract)\n raise CloudError.new(CloudError::FORBIDDEN) unless svc.is_builtin? && svc.verify_auth_token(@service_auth_token)\n svc.token = @service_auth_token\n svc.save!\n end\n\n render :json => {}\n end", "def create\n @idti_service = IdtiService.new(idti_service_params)\n\n respond_to do |format|\n if @idti_service.save\n format.html { redirect_to @idti_service, notice: 'Idti service was successfully created.' }\n format.json { render :show, status: :created, location: @idti_service }\n else\n format.html { render :new }\n format.json { render json: @idti_service.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_tier1_service_interface_0_with_http_info(tier_1_id, locale_service_id, interface_id, service_interface, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface_0\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface_0\"\n end\n # verify the required parameter 'service_interface' is set\n if @api_client.config.client_side_validation && service_interface.nil?\n fail ArgumentError, \"Missing the required parameter 'service_interface' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_interface)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#create_tier1_service_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def execute\n log.info 'Creating the Basic VM'\n placement_spec = VMPlacementHelper.get_placementspec_vm(service_manager.vapi_config, datacenter_name, folder_name, datastore_name)\n standard_network = NetworkHelper.get_standard_network_mapping(service_manager.vapi_config, @datacenter_name, standard_portgroup_name)\n boot_disk = VCENTER_HARDWARE_DISK_CLASS::CreateSpec.new('type' => VCENTER_HARDWARE_DISK_CLASS::HostBusAdapterType::SCSI,\n 'scsi' => VCENTER_HARDWARE_MODULE::ScsiAddressSpec.new('bus'=>0,'unit'=>0),\n 'new_vmdk' => VCENTER_HARDWARE_DISK_CLASS::VmdkCreateSpec.new() )\n data_disk = VCENTER_HARDWARE_DISK_CLASS::CreateSpec.new('new_vmdk' => VCENTER_HARDWARE_DISK_CLASS::VmdkCreateSpec.new())\n ethernet_nic_0 = VCENTER_HARDWARE_ETHERNET_CLASS::CreateSpec.new('start_connected' => true,\n 'backing' => VCENTER_HARDWARE_ETHERNET_CLASS::BackingSpec.new(\n 'type' => VCENTER_HARDWARE_ETHERNET_CLASS::BackingType::STANDARD_PORTGROUP,\n 'network' => standard_network))\n boot_device_order = [VCENTER_HARDWARE_BOOT_DEVICE_CLASS::EntryCreateSpec.new('type' => VCENTER_HARDWARE_BOOT_DEVICE_CLASS::Type::ETHERNET),\n VCENTER_HARDWARE_BOOT_DEVICE_CLASS::EntryCreateSpec.new('type' => VCENTER_HARDWARE_BOOT_DEVICE_CLASS::Type::DISK)]\n vm_create_spec = VCENTER_VM_CLASS::CreateSpec.new('name' => vm_name,\n 'guest_OS' => VCENTER_VM_GUESTOS_CLASS::WINDOWS_8_64,\n 'placement' => placement_spec,\n 'disks' => [boot_disk, data_disk],\n 'nics' => [ethernet_nic_0],\n 'boot_devices' => boot_device_order)\n log.info 'The CreateVM Spec is '\n #Pretty print the create spec of the VM.\n pp vm_create_spec\n vm_id = vm_svc.create(vm_create_spec)\n log.info \"Created vm #{vm_name} with the VM Identifier #{vm_id}\"\n end", "def createEc2Instance\n\t\t name = @server[\"name\"]\n\t\t node = @server['mu_name']\n\t\t\tbegin\n\t\t\t\t@server['iam_role'] = MU::Server.createIAMProfile(\"Server-\"+name, base_profile: @server['iam_role'], extra_policies: @server['iam_policies'])\n\t\t\trescue Aws::EC2::Errors::RequestLimitExceeded => e\n\t\t\t\tsleep 10\n\t\t\t\tretry\n\t\t\tend\n\t\t\t@server['iam_role'] = @server['iam_role']\n\n\t\t\tbegin\n\t\t\t\[email protected]\n\t\t\trescue Aws::EC2::Errors::RequestLimitExceeded => e\n\t\t\t\tsleep 10\n\t\t\t\tretry\n\t\t\tend\n\n\t\t instance_descriptor = {\n\t\t :image_id => @server[\"ami_id\"],\n\t\t :key_name => @deploy.keypairname,\n\t\t :instance_type => @server[\"size\"],\n\t\t :disable_api_termination => true,\n\t\t :min_count => 1,\n\t\t :max_count => 1,\n\t\t\t\t:network_interfaces => [\n\t\t\t\t\t{\n\t\t\t\t\t\t:associate_public_ip_address => name[\"associate_public_ip\"]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t }\n\t\t\t\n\t\t\tif !@server['private_ip'].nil?\n\t\t\t\tinstance_descriptor[:private_ip_address] = @server['private_ip']\n\t\t\tend\n\n\t\t\tvpc_id=subnet_id=nat_host_name=nat_ssh_user = nil\n\t\t\tsubnet_retries = 0\n\t\t\tif !@server[\"vpc\"].nil?\n\t\t\t\tbegin\n\t\t\t\t\tvpc_id, subnet_ids, nat_host_name, nat_ssh_user = MU::VPC.parseVPC(@server['vpc'])\n\t\t\t\trescue Aws::EC2::Errors::ServiceError => e\n\t\t\t\t\tMU.log e.message, MU::ERR, details: @server\n\t\t\t\t\tif subnet_retries < 5\n\t\t\t\t\t subnet_retries = subnet_retries + 1\n\t\t\t\t\t sleep 15\n\t\t\t\t\t retry\n\t\t\t\t\tend\n\t\t\t\t\traise e\n\t\t\t\tend\n\t\t\t\tsubnet_id = subnet_ids.first\n\t\t\t\tif subnet_id.nil? or subnet_id.empty?\n\t\t\t\t\tMU.log \"Got null Subnet id out of #{@server['vpc']}\", MU::ERR\n\t\t\t\t\traise \"deploy failure\"\n\t\t\t\tend\n\n\t\t\t\tMU.log \"Deploying #{node} into VPC #{vpc_id} Subnet #{subnet_id}\"\n\n\t\t\t\tif !@server[\"vpc\"][\"nat_host_name\"].nil? or !@server[\"vpc\"][\"nat_host_id\"].nil?\n\t\t\t\t\tadmin_sg = MU::Server.punchAdminNAT(@server, node)\n\t\t\t\telse\n\t\t\t\t\tadmin_sg = MU::FirewallRule.setAdminSG(vpc_id: vpc_id, region: @server['region'])\n\t\t\t\tend\n\n\t\t\t\tinstance_descriptor[:subnet_id] = subnet_id\n\t\t\t\tnode_sg = MU::FirewallRule.createEc2SG(\n\t\t\t\t\t\t@server[\"name\"].upcase,\n\t\t\t\t\t\t@server[\"ingress_rules\"],\n\t\t\t\t\t\tdescription: \"SG holes for #{node}\",\n\t\t\t\t\t\tvpc_id: vpc_id,\n\t\t\t\t\t\tregion: @server['region']\n\t\t\t\t)\n\t\t\telse\n\t\t\t\tadmin_sg = MU::FirewallRule.setAdminSG(region: @server['region'])\n\t\t\t\tnode_sg = MU::FirewallRule.createEc2SG(\n\t\t\t\t\t\t@server[\"name\"].upcase,\n\t\t\t\t\t\t@server[\"ingress_rules\"],\n\t\t\t\t\t\tdescription: \"SG holes for #{node}\",\n\t\t\t\t\t\tregion: @server['region']\n\t\t\t\t)\n\t\t\tend\n\t\t\tsecurity_groups = Array.new\n\t\t\tsecurity_groups << admin_sg\n\t\t\tsecurity_groups << node_sg\n\t\t\tif !@server[\"add_firewall_rules\"].nil?\n\t\t\t\t@server[\"add_firewall_rules\"].each { |acl|\n\t\t\t\t\tsg = MU::FirewallRule.find(sg_id: acl[\"rule_id\"], name: acl[\"rule_name\"], region: @server['region'])\n\t\t\t\t\tif sg.nil?\n\t\t\t\t\t\tMU.log \"Couldn't find dependent security group #{acl} for server #{node}\", MU::ERR\n\t\t\t\t\t\traise \"deploy failure\"\n\t\t\t\t\tend\n\t\t\t\t\tsecurity_groups << sg.group_id\n\t\t\t\t}\n\t\t\tend\n\n\t\t\tinstance_descriptor[:security_group_ids] = security_groups\n\n\t\t if [email protected]? and [email protected]?\n\t\t instance_descriptor[:user_data] = Base64.encode64(@userdata)\n\t\t end\n\n\t\t if !@server[\"iam_role\"].nil?\n\t\t instance_descriptor[:iam_instance_profile] = { name: @server[\"iam_role\"]}\n\t\t end\n\n\t\t\tconfigured_storage = Array.new\n\t\t\tif @server[\"storage\"]\n\t\t\t\t@server[\"storage\"].each { |vol|\n\t\t\t\t\tconfigured_storage << MU::Server.convertBlockDeviceMapping(vol)\n\t\t\t\t}\n\t\t\tend\n\t\t\n\t\t\tMU::Server.waitForAMI(@server[\"ami_id\"], region: @server['region'])\n\n\t\t\tinstance_descriptor[:block_device_mappings] = configured_storage\n\t\t\tinstance_descriptor[:block_device_mappings].concat(@ephemeral_mappings)\n\n\t\t\tinstance_descriptor[:monitoring] = { enabled: @server['monitoring'] }\n\n\t\t\tMU.log \"Creating EC2 instance #{node}\"\n\t\t\tMU.log \"Instance details for #{node}: #{instance_descriptor}\", MU::DEBUG\n#\t\t\t\tif instance_descriptor[:block_device_mappings].empty?\n#\t\t\t\t\tinstance_descriptor.delete(:block_device_mappings)\n#\t\t\t\tend\n#pp instance_descriptor[:block_device_mappings]\n\t\t\tretries = 0\n\t\t\tbegin\n\t\t\t\tresponse = MU.ec2(@server['region']).run_instances(instance_descriptor)\n\t\t\trescue Aws::EC2::Errors::InvalidGroupNotFound, Aws::EC2::Errors::InvalidSubnetIDNotFound, Aws::EC2::Errors::InvalidParameterValue, Aws::EC2::Errors::RequestLimitExceeded => e\n\t\t\t\tif retries < 10\n\t\t\t\t\tif retries > 7\n\t\t\t\t\t\tMU.log \"Seeing #{e.inspect} while trying to launch #{node}, retrying a few more times...\", MU::WARN, details: instance_descriptor\n\t\t\t\t\tend\n\t\t\t\t\tsleep 10\n\t\t\t\t\tretries = retries + 1\n\t\t\t\t\tretry\n\t\t\t\telse\n\t\t\t\t\traise e\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tinstance = response.instances.first\n\t\t\tMU.log \"#{node} (#{instance.instance_id}) coming online\"\n\n\n\t\t\treturn instance\n\n\t\tend", "def set_instance_template request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n uri, body, query_string_params = transcode_set_instance_template_request request_pb\n response = @client_stub.make_post_request(\n uri: uri,\n body: body,\n params: query_string_params,\n options: options\n )\n result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true\n\n yield result, response if block_given?\n result\n end", "def create\n @deployment = Deployment.new(deployment_params)\n\n respond_to do |format|\n if @deployment.save\n format.html { redirect_to @deployment, notice: 'Deployment was successfully created.' }\n format.json { render :show, status: :created, location: @deployment }\n else\n format.html { render :new }\n format.json { render json: @deployment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n params[:deployment_id] = Deployment.find_key(params[:deployment]).id if params.has_key? :deployment\n params[:deployment_id] ||= Deployment.system\n params.require(:name)\n params.require(:deployment_id)\n default_net = nil\n Node.transaction do\n @node = Node.create!(params.permit(:name,\n :description,\n :admin,\n :deployment_id,\n :allocated,\n :alive,\n :system,\n :available,\n :bootenv))\n # Keep suport for mac and ip hints in short form around for legacy Sledgehammer purposes\n if params[:ip]\n default_net = Network.lookup_network(params[:ip]) ||\n Network.find_by_name(\"unmanaged\")\n Attrib.set(\"hint-#{default_net.name}-v4addr\",@node,params[:ip]) if default_net\n Attrib.set(\"hint-admin-macs\", @node, [params[:mac]]) if params[:mac]\n end\n end\n default_net.make_node_role(@node) if default_net\n render api_show @node\n end", "def create\n super(@@service)\n end", "def delete_tier1_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#delete_tier1_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_patch_tier1_l2_vpn_service_with_http_info(tier_1_id, locale_service_id, service_id, l2_vpn_service, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service\"\n end\n # verify the required parameter 'service_id' is set\n if @api_client.config.client_side_validation && service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service\"\n end\n # verify the required parameter 'l2_vpn_service' is set\n if @api_client.config.client_side_validation && l2_vpn_service.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_vpn_service' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/l2vpn-services/{service-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-id' + '}', service_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_vpn_service)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi#create_or_patch_tier1_l2_vpn_service\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @deployment = current_user.deployments.new(params[:deployment])\n\n respond_to do |format|\n if @deployment.save\n unless @deployment.environment.running?\n @deployment.environment.start!\n end\n format.html { redirect_to(@deployment.app, :notice => 'Application was successfully deployed.') }\n format.xml { render :xml => @deployment, :status => :created, :location => @deployment }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @deployment.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @deployment = Deployment.new(params[:deployment])\n\n respond_to do |format|\n if @deployment.save\n format.html { redirect_to @deployment, notice: 'Deployment was successfully created.' }\n format.json { render json: @deployment, status: :created, location: @deployment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @deployment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @instance = @provider.instances.new(params[:instance])\n @instance.state = \"Building\"\n respond_to do |format|\n if @instance.save\n @instance.create_instance(@provider.connect!)\n format.html { redirect_to cloud_provider_instance_path(@provider,@instance), notice: 'Instance was successfully created.' }\n format.json { render json: @instance, status: :created, location: @instance }\n else\n format.html { render action: \"new\" }\n format.json { render json: @instance.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_tier1_byod_policy_service_instance(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts = {})\n data, _status_code, _headers = create_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts)\n data\n end", "def create_resource(env)\n env[:ui].info(\"Creating machine\")\n\n config = env[:machine].provider_config\n vra = env[:vra]\n\n EntitledItemsCollection.fetch(env[:vra])\n .find_by_id(config.catalog_item_id)\n .request(cpus: config.cpus,\n memory: config.memory,\n requested_for: config.requested_for,\n subtenant_id: config.subtenant_id,\n lease_days: config.lease_days) { |req|\n config.extra_entries.types.each do |type|\n config.extra_entries.of_type(type).each do |k,v|\n req.set_parameter(k, type, v)\n end\n end\n }\n .join\n .machine\n end", "def create\n @instance_fault = InstanceFault.new(params[:instance_fault])\n\n respond_to do |format|\n if @instance_fault.save\n format.html { redirect_to @instance_fault, notice: 'Instance fault was successfully created.' }\n format.json { render json: @instance_fault, status: :created, location: @instance_fault }\n else\n format.html { render action: \"new\" }\n format.json { render json: @instance_fault.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tb_servicio = TbServicio.new(tb_servicio_params)\n\n respond_to do |format|\n if @tb_servicio.save\n format.html { redirect_to @tb_servicio, notice: 'Tb servicio was successfully created.' }\n format.json { render :show, status: :created, location: @tb_servicio }\n else\n format.html { render :new }\n format.json { render json: @tb_servicio.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @taxi_sevice = TaxiSevice.new(taxi_sevice_params)\n\n respond_to do |format|\n if @taxi_sevice.save\n format.html { redirect_to action: \"index\" }\n else\n format.html { render :new }\n format.json { render json: @taxi_sevice.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @item_tier = ItemTier.new(item_tier_params)\n\n respond_to do |format|\n if @item_tier.save\n format.html { redirect_to @item_tier, notice: 'Item tier was successfully created.' }\n format.json { render :show, status: :created, location: @item_tier }\n else\n format.html { render :new }\n format.json { render json: @item_tier.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_on_backend\n lab = Lab.find(self.lab_id)\n Rails.logger.info \"Creating tenant #{self.name} on openstack backend #{lab.name}.\"\n\n # First, run through some checks to ensure we can create the whole tenant properly\n # Check if an external network exists\n admin_network_c = lab.get_neutron(lab.auth_tenant) \n ext_network = admin_network_c.list_networks.select {|n| n.external == true}\n if ext_network.empty?\n Rails.logger.error \"There are no external networks on the OpenStack host\"\n return false\n end\n\n # Check if there are enough available floating ips\n # There does not appear to be an api endpoint to check ips available for an instance to check out\n # TODO - Take another look at this.\n\n # Create the tenant\n identity_c = get_connection(\"identity\")\n identity_c.create_tenant({:name => self.name, :description => \"Created by OpenShift Labs app\", :enabled => true})\n tenant = identity_c.tenants.select {|t| t.name == self.name}.first\n if tenant.nil?\n Rails.logger.error \"Attempted to create tenant with name #{self.name}, but tenant does not exist after creation.\"\n return false\n else\n Rails.logger.info \"Created tenant #{self.name} with tenant id #{tenant.id}.\"\n self.uuid = tenant.id\n end\n\n # If any of the following fails, we need to be sure we delete the OpenStack backend tenant\n begin\n\n # Add the lab's user to the tenant\n # TODO the below assumes an admin role exists. Need to verify that this is always the case.\n role = identity_c.list_roles.select {|r| r[:name] == \"admin\"}.first\n admin_user = identity_c.list_users.select {|u| u.name == lab.username }.first\n Rails.logger.info \"Adding user #{admin_user.name} to the #{self.name} tenant.\"\n identity_c.add_user_to_tenant({:tenant_id => tenant.id, :role_id => role[:id], :user_id => admin_user.id})\n\n # Get the compute and neutron connections\n compute_c = get_connection(\"compute\")\n network_c = get_connection(\"network\")\n\n # Set the quotas appropriately\n # Works needs to be done in the ruby-openstack gem to support this.\n Rails.logger.info \"Setting #{self.name} tenant quotas.\"\n compute_c.set_limits(tenant.id, {:cores => lab.default_quota_cores,\n :floating_ips => lab.default_quota_instances,\n :instances => lab.default_quota_instances,\n :ram => lab.default_quota_ram\n })\n\n # Create a network\n network_name = self.name + \"-network\"\n Rails.logger.info \"Creating network with name #{network_name} for tenant #{self.name}.\"\n network = network_c.create_network(network_name, {:admin_state_up => true})\n self.network = network_name\n\n # Create a subnet\n subnet_name = self.name + \"-subnet\"\n # TODO nameservers are hard-coded, but could change. Need to have them entered somewhere.\n Rails.logger.info \"Creating subnet with name #{subnet_name} for tenant #{self.name}.\"\n subnet = network_c.create_subnet(network.id, \"192.168.1.0/24\", \"4\", {:name => subnet_name, :gateway_ip => \"192.168.1.1\", :enable_dhcp => true, :dns_nameservers => ['10.11.5.3', '10.11.5.4']})\n\n # Create a router and add interface to subnet\n router_name = self.name + \"-router\"\n # TODO we grab the first external network, we should have a user specify which one to use somewhere, in case there are multiple\n external_network = network_c.list_networks.select {|n| n.external == true }.first\n Rails.logger.info \"Creating router with name #{router_name} for tenant #{self.name}.\"\n router = network_c.create_router(router_name, true, {:external_gateway_info => {:network_id => external_network.id}})\n Rails.logger.info \"Adding router interface for subnet #{subnet_name} on router #{router_name}.\"\n network_c.add_router_interface(router.id, subnet.id)\n\n # Get the default security group\n # TODO we assume there is a default security group, probably not the best way to go about this.\n security_group = compute_c.security_groups.select {|k,v| v[:name] == \"default\"}\n self.security_group = \"default\"\n security_group_id = security_group.keys.first\n\n # Delete default security group rules\n Rails.logger.info \"Removing default Ingress security group rules for tenant #{self.name}.\"\n security_group[security_group_id][:rules].each do |rule|\n compute_c.delete_security_group_rule(rule[:id])\n end\n\n # Create necessary security group rules\n Rails.logger.info \"Creating all-open security groups rules for tcp, udp, and icmp on tenant #{self.name}\"\n compute_c.create_security_group_rule(security_group_id, \n {:ip_protocol => \"tcp\", :from_port => 1, :to_port => 65535, :cidr => \"0.0.0.0/0\"})\n compute_c.create_security_group_rule(security_group_id, \n {:ip_protocol => \"udp\", :from_port => 1, :to_port => 65535, :cidr => \"0.0.0.0/0\"})\n compute_c.create_security_group_rule(security_group_id, \n {:ip_protocol => \"icmp\", :from_port => -1, :to_port => -1, :cidr => \"0.0.0.0/0\"})\n\n # Allocate all necessary floating ips\n # TODO shouldn't just get the first pool, should have a dropdown and database entry in project\n Rails.logger.info \"Allocating #{lab.default_quota_instances} floating ips to tenant #{self.name}\"\n floating_ip_pool = compute_c.get_floating_ip_pools.first[\"name\"]\n lab.default_quota_instances.times do\n compute_c.create_floating_ip(:pool => floating_ip_pool)\n end\n \n Rails.logger.info \"Tenant #{self.name} creation completed.\"\n rescue => e\n Rails.logger.error \"Could not create OpenStack backend tenant due to:\"\n Rails.logger.error e.message\n Rails.logger.error e.backtrace\n destroy_backend\n end\n\n end", "def create_or_update_tier1_l2_vpn_service_0_with_http_info(tier_1_id, locale_service_id, service_id, l2_vpn_service, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'service_id' is set\n if @api_client.config.client_side_validation && service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'l2_vpn_service' is set\n if @api_client.config.client_side_validation && l2_vpn_service.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_vpn_service' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/l2vpn-services/{service-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-id' + '}', service_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_vpn_service)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2VPNService')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi#create_or_update_tier1_l2_vpn_service_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create(cluster_id)\n # create ONE object\n new_object\n\n rc = @one.allocate(format_template(@p_template), cluster_id)\n Utils.exception(rc)\n rc = @one.info\n Utils.exception(rc)\n\n OneProvisionLogger.debug(\n \"#{@type} created with ID: #{@one.id}\"\n )\n\n Integer(@one.id)\n end", "def create_tier1_service_interface_0(tier_1_id, locale_service_id, interface_id, service_interface, opts = {})\n data, _status_code, _headers = create_tier1_service_interface_0_with_http_info(tier_1_id, locale_service_id, interface_id, service_interface, opts)\n data\n end", "def new\n @tier_setting = TierSetting.new(tier: @week.next_missing_tier)\n end", "def create\n @tc_detail_step = TcDetailStep.new(params[:tc_detail_step])\n\n respond_to do |format|\n if @tc_detail_step.save\n format.html { redirect_to @tc_detail_step, notice: 'Tc detail step was successfully created.' }\n format.json { render json: @tc_detail_step, status: :created, location: @tc_detail_step }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tc_detail_step.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n deploy\n end", "def start\n service.pool_action uuid, :create\n end", "def delete_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#delete_tier1_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_tier1_locale_services_0_with_http_info(tier_1_id, locale_services_id, locale_services, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services_0\"\n end\n # verify the required parameter 'locale_services' is set\n if @api_client.config.client_side_validation && locale_services.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(locale_services)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#create_or_replace_tier1_locale_services_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_sap_pvm_instance(instance_hash)\n post(\"cloud-instances/#{guid}/sap\", instance_hash.to_json)\n end", "def create\n @tm_dev1 = TmDev1.new(params[:tm_dev1])\n\n respond_to do |format|\n if @tm_dev1.save\n flash[:notice] = 'TmDev1 was successfully created.'\n format.html { redirect_to(@tm_dev1) }\n format.xml { render :xml => @tm_dev1, :status => :created, :location => @tm_dev1 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @tm_dev1.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create_or_replace_tier1_locale_services_with_http_info(tier_1_id, locale_services_id, locale_services, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services\"\n end\n # verify the required parameter 'locale_services' is set\n if @api_client.config.client_side_validation && locale_services.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(locale_services)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#create_or_replace_tier1_locale_services\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n response.add(exec: \"kubectl create ns #{namespace}\", env: kube_env)\n response.add(exec: \"kubectl label namespace #{namespace} istio-injection=enabled --overwrite\", env: kube_env)\n # errors.add(:kubectl_label_namespace, stderr) if exit_code.positive? and stderr.index('AlreadyExists').nil?\n\n # deploy helm into namespace\n # TODO: Need to generate tiller-rbac\n response.add(exec: kubectl(\"apply -f #{target.write_path}/tiller-k8s-ns.yml\"), env: kube_env)\n response.add(exec: 'helm init --upgrade --wait --service-account tiller', env: kube_env)\n end", "def read_tier1_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def add_instance(opts)\n unless %w[app util].include?(opts[:role].to_s)\n # Fail immediately because we don't have valid arguments.\n raise InvalidInstanceRole, \"Instance role must be one of: app, util\"\n end\n\n # Sanitize the name to remove whitespace if there is any\n if opts[:name]\n name = opts[:name].gsub(/\\s+/, '')\n end\n\n if opts[:role] == 'util'\n unless name && name.length > 0\n raise InvalidInstanceName, \"When specifying a util instance you must also specify a name.\"\n end\n end\n \n request = { \"role\" => opts[:role], \"name\" => opts[:name] }\n request['snapshot_id'] = opts[:snapshot_id] if opts.key?(:snapshot_id)\n request['instance_size'] = opts[:instance_size] if opts.key?(:instance_size)\n\n # We know opts[:role] is right, name can be passed straight to the API.\n # Return the response body for error output, logging, etc.\n return api.post(\"/environments/#{id}/add_instances\", :request => request)\n end", "def create_vm\n if new_resource.clone\n clone_vm\n else\n data = {\n vmid: vmid,\n bootdisk: 'virtio0',\n cores: INSTANCE_SIZE[new_resource.size]['cpu'],\n memory: INSTANCE_SIZE[new_resource.size]['memory'],\n ide2: \"#{new_resource.cdrom},media=cdrom\",\n numa: (new_resource.numa ? 1 : 0),\n ostype: get_type(new_resource.ostype),\n sockets: 1,\n virtio0: \"#{new_resource.storage}:/vm-#{vmid}-disk-1.qcow2,size=#{new_resource.disk}\"\n }.merge(new_resource.net)\n data.merge(hugepages: new_resource.hugepages) if new_resource.hugepages\n api.post(\"/nodes/#{new_resource.host}/qemu\", data)\n end\nend", "def server_create(server_name, template)\n # calculate instance id\n Puppet.debug \"template keys => \" + JSON.pretty_generate(template)\n\n server_id, server_host = ::Pinas::Common.extract_instance_id_from(server_name)\n\n # 1. setup the default options\n options = {\n :name => server_name,\n :flavor_ref => get_flavor(template[:flavor_name]), # For Openstack provider\n :image_ref => get_image(template[:image_name]), # For Openstack provider\n :flavor_id => get_flavor(template[:flavor_name]), # For HPCloud provider\n :image_id => get_image(template[:image_name]), # For HPCloud provider\n :key_name => template[:key_name],\n :security_groups => template[:security_groups],\n }\n Puppet.debug \"setup default options = >\" + JSON.pretty_generate(options)\n # 2. setup the meta data/user data for the server, for boot hooks\n begin\n options[:metadata] = meta_to_hash(ERB.new(template[:meta_data]).result(binding)) if template.has_key?(:meta_data)\n rescue Exception => e\n Puppet.crit \"servers.create in running erb for :metadata, Error: #{e}\"\n raise Puppet::Error, \"Error : #{e}\"\n end\n begin\n options[:user_data] = ERB.new(File.read(template[:user_data])).result(binding) if template.has_key?(:user_data)\n rescue Exception => e\n Puppet.crit \"servers.create in running erb for :user_data, Error: #{e}\"\n raise Puppet::Error, \"Error : #{e}\"\n end\n Puppet.debug \"added metadata and user_data\"\n Puppet.debug \"has network_name key ? #{template.has_key?(:network_name)}\"\n Puppet.debug \"network class => #{network.class}\"\n Puppet.debug \"template[:network_name] => #{template[:network_name]}\"\n Puppet.debug \"template[:network_name] => #{template['network_name']}\"\n # 3. get the network uuid and name\n if @network != nil and template.has_key?(:network_name) and template[:network_name] != ''\n Puppet.debug \"adding network #{template[:network_name]}\"\n networks = Array.new\n nics = Array.new\n nics << get_networkid(template[:network_name])\n # nics << template[:network_name]\n Puppet.debug \"working on nics => #{nics}.\"\n begin\n nics.each do |net|\n Puppet.debug \"working on net => #{net}\"\n network = find_match(@network.networks, net)\n networks.push('net_id' => network.id) if network\n end\n options[:nics] = networks\n rescue Exception => e\n raise Puppet::Error, \"Problem assigning nics, #{e}\"\n end\n Puppet.debug \"after options, got = >\" + JSON.pretty_generate(options)\n end\n # 4. create new server and wait for it to be ready.\n # TODO: implement retryable and wait for code. need to confirm we have a timeout in fog.\n # server = @compute.servers.create(options)\n # retryable(on: Timeout::Error, tries: 200) do\n # begin\n # server.wait_for(30) { ready? }\n # rescue RuntimeError, Fog::Errors::TimeoutError => e\n # end\n # end\n Puppet.debug \"attempting to create server #{server_name}\"\n new_server = nil\n begin\n new_server = @compute.servers.create(options)\n new_server.wait_for { ready?}\n new_server.wait_for { !addresses.nil? }\n rescue Exception => e\n Puppet.crit \"servers.create Error: #{e}\"\n raise Puppet::Error, \"Error : #{e}\"\n end\n\n Puppet.notice \"server created #{server_name} on net #{template[:network_name]} \"\n begin\n newserver_ip_assign(new_server)\n rescue Exception => e\n Puppet.crit \"server_ip_assign Error: #{e}\"\n raise Puppet::Error, \"Error : #{e}\"\n end\n\n end", "def create\n @tech_serv = TechServ.new(tech_serv_params)\n\n respond_to do |format|\n if @tech_serv.save\n format.html { redirect_to [:admin, @tech_serv], notice: '技术服务创建成功.' }\n format.json { render action: 'show', status: :created, location: @tech_serv }\n else\n format.html { render action: 'new' }\n format.json { render json: @tech_serv.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @service = Service.create(service_params)\n end", "def create_instance project_id:, instance_id:\n # [START spanner_create_instance]\n # project_id = \"Your Google Cloud project ID\"\n # instance_id = \"Your Spanner instance ID\"\n\n require \"google/cloud/spanner\"\n require \"google/cloud/spanner/admin/instance\"\n\n instance_admin_client = Google::Cloud::Spanner::Admin::Instance.instance_admin\n\n project_path = instance_admin_client.project_path project: project_id\n instance_path = instance_admin_client.instance_path project: project_id, instance: instance_id\n instance_config_path = instance_admin_client.instance_config_path project: project_id, instance_config: \"regional-us-central1\"\n\n job = instance_admin_client.create_instance parent: project_path,\n instance_id: instance_id,\n instance: { name: instance_path,\n config: instance_config_path,\n display_name: instance_id,\n node_count: 2,\n labels: { cloud_spanner_samples: \"true\" } }\n\n puts \"Waiting for create instance operation to complete\"\n\n job.wait_until_done!\n\n if job.error?\n puts job.error\n else\n puts \"Created instance #{instance_id}\"\n end\n # [END spanner_create_instance]\nend", "def call\n # Update service and update context\n self.service = Entities::Service.find_by_system_name(remote: threescale_client,\n system_name: service_system_name)\n if service.nil?\n # Create service and update context\n self.service = Entities::Service.create(remote: threescale_client,\n service_params: service_settings)\n logger.info \"Created service id: #{service.id}, name: #{service_name}\"\n else\n service.update(service_settings)\n logger.info \"Updated service id: #{service.id}, name: #{service_name}\"\n end\n\n report['id'] = service.id\n report['system_name'] = service.system_name\n report['name'] = service.name\n report['backend_version'] = api_spec.service_backend_version\n end", "def start\n debug \"Call 'start' for Pacemaker service '#{name}' on node '#{hostname}'\"\n disable_basic_service_on_action :start\n\n enable unless primitive_is_managed? name\n\n if pacemaker_options[:cleanup_on_start]\n if not pacemaker_options[:cleanup_only_if_failures] or primitive_has_failures? name, hostname\n cleanup\n end\n end\n\n if pacemaker_options[:add_location_constraint]\n service_location_add full_name, hostname unless service_location_exists? full_name, hostname\n end\n\n if primitive_is_multistate? name\n service_start_mode pacemaker_options[:start_mode_multistate]\n elsif primitive_is_clone? name\n service_start_mode pacemaker_options[:start_mode_clone]\n else\n service_start_mode pacemaker_options[:start_mode_simple]\n end\n\n debug cluster_debug_report \"#{@resource} start\"\n end", "def deploy(id, host, xml_text, lcm_state, deploy_id)\n # Restore if we need to\n if lcm_state != \"BOOT\" && lcm_state != \"BOOT_FAILURE\"\n restore(deploy_id)\n return deploy_id\n end\n\n # Otherwise deploy the VM\n\n begin\n ec2_info = get_deployment_info(host, xml_text)\n rescue Exception => e\n raise e\n end\n\n load_default_template_values\n\n if !ec2_value(ec2_info, 'AMI')\n raise \"Cannot find AMI in deployment file\"\n end\n\n opts = generate_options(:run, ec2_info, {\n :min_count => 1,\n :max_count => 1})\n\n # The OpenNebula context will be only included if not USERDATA\n # is provided by the user\n if !ec2_value(ec2_info, 'USERDATA')\n xml = OpenNebula::XMLElement.new\n xml.initialize_xml(xml_text, @provision_type == :host ? 'HOST' : 'VM')\n\n if xml.has_elements?('TEMPLATE/CONTEXT')\n # if requested, we generated cloud-init compatible data\n if ec2_value(ec2_info, 'CLOUD_INIT') =~ /^(yes|true)$/i\n context_str = generate_cc(xml, 'TEMPLATE/CONTEXT')\n else\n # Since there is only 1 level ',' will not be added\n context_str = xml.template_like_str('TEMPLATE/CONTEXT')\n\n if xml['TEMPLATE/CONTEXT/TOKEN'] == 'YES'\n # TODO use OneGate library\n token_str = generate_onegate_token(xml)\n if token_str\n context_str << \"\\nONEGATE_TOKEN=\\\"#{token_str}\\\"\"\n end\n end\n end\n\n userdata_key = EC2[:run][:args][\"USERDATA\"][:opt]\n opts[userdata_key] = Base64.encode64(context_str)\n end\n end\n\n instances = @ec2.create_instances(opts)\n instance = instances.first\n\n start_time = Time.now\n\n while Time.now - start_time < @state_change_timeout\n begin\n break if instance.exists?\n rescue => e\n OpenNebula::log_error(\"RESCUE: #{e.inspect}\")\n end\n\n sleep 2\n end\n\n tags = generate_options(:tags, ec2_info)[:tags] || {}\n\n tag_array = []\n tags.each{ |key,value|\n tag_array << {\n :key => key,\n :value => value\n }\n }\n\n instance.create_tags(:tags => tag_array) if tag_array.length > 0\n\n elastic_ip = ec2_value(ec2_info, 'ELASTICIP')\n\n wait_state('running', instance.id)\n\n if elastic_ip\n\n if elastic_ip.match(Resolv::IPv4::Regex)\n address_key = :public_ip\n else\n address_key = :allocation_id\n end\n\n address = {\n :instance_id => instance.id,\n address_key => elastic_ip\n }\n\n @ec2.client.associate_address(address)\n end\n\n if @provision_type == :host\n instance.create_tags(tags: [{\n key: 'Name',\n value: host['//HOST/TEMPLATE/PROVISION/HOSTNAME']\n },{\n key: 'ONE_HOST_ID',\n value: 'TODO'\n }])\n else\n instance.create_tags(tags: [{\n key: 'ONE_ID',\n value: id\n }])\n end\n\n puts(instance.id)\n end" ]
[ "0.596693", "0.59403276", "0.57717735", "0.57595915", "0.57200825", "0.5679176", "0.56772083", "0.5611516", "0.5593353", "0.55568975", "0.55453396", "0.5526963", "0.5478489", "0.54708993", "0.54702497", "0.5414199", "0.53775334", "0.53662765", "0.53654397", "0.53299165", "0.5279461", "0.52138346", "0.52111477", "0.52099884", "0.52090985", "0.5207429", "0.51830536", "0.5181183", "0.51701814", "0.5169669", "0.51531076", "0.51479995", "0.5147102", "0.5145006", "0.5134633", "0.51287454", "0.5120584", "0.5118794", "0.51124287", "0.51114416", "0.5106021", "0.51051724", "0.5094416", "0.5083172", "0.5080704", "0.50723326", "0.50693077", "0.5065285", "0.5059107", "0.50531316", "0.50529206", "0.5047575", "0.5047108", "0.50427485", "0.50314385", "0.5029053", "0.5025247", "0.5024938", "0.5020576", "0.49971902", "0.49865353", "0.49864927", "0.4982363", "0.498102", "0.49752992", "0.49752197", "0.4963398", "0.49576613", "0.49572587", "0.49561608", "0.49527153", "0.4951882", "0.49499574", "0.4942385", "0.4933245", "0.492718", "0.49248412", "0.49246067", "0.49239644", "0.49110338", "0.49028635", "0.48963666", "0.48951295", "0.4889268", "0.48836964", "0.48820153", "0.48809636", "0.48764357", "0.48726833", "0.4871639", "0.4870158", "0.48696643", "0.4863616", "0.48611265", "0.48567018", "0.48550558", "0.48456275", "0.48435414", "0.4837466", "0.48362842", "0.4827197" ]
0.0
-1
Create Tier1 service instance Create Tier1 Service Instance. Please note that, only display_name, description and deployment_spec_name are allowed to be modified in an exisiting entity. If the deployment spec name is changed, it will trigger the upgrade operation for the SVMs.
def patch_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, policy_service_instance, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_policy_service_instance_0 ...' end # verify the required parameter 'tier_1_id' is set if @api_client.config.client_side_validation && tier_1_id.nil? fail ArgumentError, "Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_policy_service_instance_0" end # verify the required parameter 'locale_service_id' is set if @api_client.config.client_side_validation && locale_service_id.nil? fail ArgumentError, "Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_policy_service_instance_0" end # verify the required parameter 'service_instance_id' is set if @api_client.config.client_side_validation && service_instance_id.nil? fail ArgumentError, "Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_policy_service_instance_0" end # verify the required parameter 'policy_service_instance' is set if @api_client.config.client_side_validation && policy_service_instance.nil? fail ArgumentError, "Missing the required parameter 'policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_policy_service_instance_0" end # resource path local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(policy_service_instance) auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#patch_tier1_policy_service_instance_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create(name, config)\n # @step: validate the user defined options\n validate(config)\n\n # @step: create the infrastructure deployment\n begin\n provision_aks(name, config)\n rescue StandardError => e\n raise InfrastructureError, \"failed to provision cluster, error: #{e}\"\n end\n\n # @step: bootstrap the cluster\n begin\n provision_cluster(name, config)\n rescue StandardError => e\n raise InfrastructureError, \"failed to bootstrap cluster, error: #{e}\"\n end\n end", "def create_or_replace_tier1(tier_1_id, tier1, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_with_http_info(tier_1_id, tier1, opts)\n data\n end", "def create_tier1_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance\"\n end\n # verify the required parameter 'policy_service_instance' is set\n if @api_client.config.client_side_validation && policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_tier1_0(tier_1_id, tier1, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_0_with_http_info(tier_1_id, tier1, opts)\n data\n end", "def create_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'policy_service_instance' is set\n if @api_client.config.client_side_validation && policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_tier1_service_instance_endpoint_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint' is set\n if @api_client.config.client_side_validation && service_instance_endpoint.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_instance_endpoint)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInstanceEndpoint')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_service_instance_endpoint_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_tier1_service_instance_endpoint_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_endpoint' is set\n if @api_client.config.client_side_validation && service_instance_endpoint.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_instance_endpoint)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInstanceEndpoint')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_service_instance_endpoint\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_kvm_instance(name, opts={})\n cmd = \"virt-install -n #{name} --ram #{opts[:memory]} --disk \" <<\n \"path=#{File.join(KVM_HOME, 'storage', \"#{name}.qcow2\")},device=disk,bus=virtio,format=qcow2 \" <<\n \"-v --import --noautoconsole --vcpus=#{opts[:vcpus]},maxvcpus=#{opts[:maxvcpus]}\" \n unless(system(cmd))\n raise \"Failed to create KVM instance!\"\n end \nend", "def create_service\n super.tap do |service_template|\n service_template.cookbook('poise-service')\n create_monit_config\n end\n end", "def add_tier\n begin\n with_transaction do\n Tier.create!(\n name: params[:name],\n stage: params[:stage],\n pipeline_id: @pipeline.id\n )\n\n render json: tiers_for_pipeline_view\n end\n rescue Exception => e\n error = \"#{ConfluxErrors::TierCreationFailed} - #{e}\"\n logger.error { error }\n render json: { message: error }, status: 500\n end\n end", "def create_kubernetes_virtual_machine_instance_type_with_http_info(kubernetes_virtual_machine_instance_type, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: KubernetesApi.create_kubernetes_virtual_machine_instance_type ...'\n end\n # verify the required parameter 'kubernetes_virtual_machine_instance_type' is set\n if @api_client.config.client_side_validation && kubernetes_virtual_machine_instance_type.nil?\n fail ArgumentError, \"Missing the required parameter 'kubernetes_virtual_machine_instance_type' when calling KubernetesApi.create_kubernetes_virtual_machine_instance_type\"\n end\n # resource path\n local_var_path = '/api/v1/kubernetes/VirtualMachineInstanceTypes'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(kubernetes_virtual_machine_instance_type)\n\n # return_type\n return_type = opts[:debug_return_type] || 'KubernetesVirtualMachineInstanceType'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"KubernetesApi.create_kubernetes_virtual_machine_instance_type\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: KubernetesApi#create_kubernetes_virtual_machine_instance_type\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def service_create(name, display_name, executable_on_host,startup=2)\n\t\tif session_has_services_depend?\n\t\t\tmeterpreter_service_create(name, display_name, executable_on_host,startup)\n\t\telse\n\t\t\tshell_service_create(name, display_name, executable_on_host,startup)\n\t\tend\n\tend", "def create_kvm(kvm_name, template, options)\n ensure_name_availability!(kvm_name)\n clone_kvm(kvm_name, template)\n device = mount_kvm_volume(kvm_name)\n address = update_kvm_ip(kvm_name)\n update_hostname(kvm_name)\n make_console_accessible(kvm_name)\n unmount_kvm_volume(kvm_name, device)\n create_kvm_instance(kvm_name, options)\n puts \"KVM Node #{kvm_name} available at: #{address}\"\nend", "def create_or_replace_tier1_with_http_info(tier_1_id, tier1, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1\"\n end\n # verify the required parameter 'tier1' is set\n if @api_client.config.client_side_validation && tier1.nil?\n fail ArgumentError, \"Missing the required parameter 'tier1' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(tier1)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#create_or_replace_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_instance(credentials, image_id, opts)\n new_vapp = nil\n vapp_opts = {} #assemble options to pass to Fog::Terremark::Real.instantiate_vapp_template\n terremark_hwp = hardware_profiles(credentials, {:name => 'default'}).first #sanity check values against default\n name = opts[:name]\n if not name\n name = \"inst#{Time.now.to_i}\"\n end\n if name.length > USER_NAME_MAX\n raise \"Parameter name must be #{USER_NAME_MAX} characters or less\"\n end\n unless ( (terremark_hwp.include?(:cpu, opts[:hwp_cpu].to_i)) &&\n (terremark_hwp.include?(:memory, opts[:hwp_memory].to_i)) ) then\n raise Deltacloud::Exceptions::ValidationFailure.new(\n StandardError.new(\"Error with cpu and/or memory values. you said cpu->#{opts[:hwp_cpu]} and mem->#{opts[:hwp_memory]}\")\n )\n end\n vapp_opts['cpus'] = opts[:hwp_cpu]\n vapp_opts['memory'] = opts[:hwp_memory]\n safely do\n terremark_client = new_client(credentials)\n#######\n#FIXME# what happens if there is an issue getting the new vapp id? (eg even though created succesfully)\n#######\n vapp_id = terremark_client.instantiate_vapp_template(name, image_id, vapp_opts).body['href'].split('/').last\n new_vapp = terremark_client.get_vapp(vapp_id)\n return convert_instance(new_vapp, terremark_client, credentials.user) #return an Instance object\n end\n end", "def create_or_replace_tier1_0_with_http_info(tier_1_id, tier1, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1_0\"\n end\n # verify the required parameter 'tier1' is set\n if @api_client.config.client_side_validation && tier1.nil?\n fail ArgumentError, \"Missing the required parameter 'tier1' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(tier1)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#create_or_replace_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_service_instance(name, space_guid, service_plan_id)\n service_plan_instance = CFoundry::V2::ServicePlan.new(service_plan_id, @client)\n service_instance = @client.managed_service_instance\n service_instance.name = name\n service_instance.service_plan = service_plan_instance\n service_instance.space = @client.space(space_guid)\n service_instance.create!\n service_instance\n end", "def create\n @t1 = T1.new(params[:t1])\n\n respond_to do |format|\n if @t1.save\n flash[:notice] = 'T1 was successfully created.'\n format.html { redirect_to(@t1) }\n format.xml { render :xml => @t1, :status => :created, :location => @t1 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @t1.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create_instance\n create_instances(1).first\n end", "def create_virtual_machine(params, options = {})\n image = get_image(params[:image])\n options[:os_type] = image.os_type\n validate_deployment_params(params, options)\n options[:deployment_name] ||= options[:cloud_service_name]\n Azure::Loggerx.info 'Creating deployment...'\n\n options[:cloud_service_name] ||= generate_cloud_service_name(params[:vm_name])\n options[:storage_account_name] ||= generate_storage_account_name(params[:vm_name])\n optionals = {}\n if options[:virtual_network_name]\n virtual_network_service = client.network_management\n virtual_networks = virtual_network_service.list_virtual_networks.select { |x| x.name == options[:virtual_network_name] }\n if virtual_networks.empty?\n Azure::Loggerx.error_with_exit \"Virtual network #{options[:virtual_network_name]} doesn't exists\"\n else\n vnet = virtual_networks.first\n if !vnet.affinity_group.empty?\n options[:affinity_group_name] = vnet.affinity_group\n else\n optionals[:location] = vnet.location\n end\n end\n elsif options[:affinity_group_name]\n optionals[:affinity_group_name] = options[:affinity_group_name]\n else\n optionals[:location] = params[:location]\n end\n cloud_service = client.cloud_service_management\n cloud_service.create_cloud_service(options[:cloud_service_name], optionals)\n cloud_service.upload_certificate(options[:cloud_service_name], params[:certificate]) unless params[:certificate].empty?\n unless image.category == 'User'\n options[:storage_account_name] ||= generate_storage_account_name(params[:vm_name])\n client.storage_management.create_storage_account(options[:storage_account_name], optionals)\n end\n body = Serialization.deployment_to_xml(params, image, options)\n path = \"/services/hostedservices/#{options[:cloud_service_name]}/deployments\"\n Azure::Loggerx.info 'Deployment in progress...'\n request = client.management_request(:post, path, body)\n request.call\n get_virtual_machine(params[:vm_name], options[:cloud_service_name])\n rescue Exception => e\n Azure::Loggerx.error_with_exit \"Failed to create virtual machine : \"+e.message\n end", "def create(id, name: nil, type: :PRODUCTION, labels: nil, clusters: nil)\n end", "def create\n @instance_name = InstanceName.new(params[:instance_name])\n\n respond_to do |format|\n if @instance_name.save\n flash[:notice] = 'InstanceName was successfully created.'\n format.html { redirect_to(@instance_name) }\n format.xml { render :xml => @instance_name, :status => :created, :location => @instance_name }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @instance_name.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'byod_policy_service_instance' is set\n if @api_client.config.client_side_validation && byod_policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'byod_policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(byod_policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_byod_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'byod_policy_service_instance' is set\n if @api_client.config.client_side_validation && byod_policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'byod_policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(byod_policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_byod_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @servicetype = Servicetype.new(params[:servicetype])\n\n respond_to do |format|\n if @servicetype.save\n format.html { redirect_to @servicetype, notice: 'Servicetype was successfully created.' }\n format.json { render json: @servicetype, status: :created, location: @servicetype }\n else\n format.html { render action: \"new\" }\n format.json { render json: @servicetype.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_deployment\n @api.account_id = @options[:src]\n inputs = format_inputs(@old_deployment.show.inputs)\n\n params = {\n :deployment => {\n :name => @old_deployment.name,\n :description => @old_deployment.description\n }\n }\n\n puts \"\\nCreating deployment: \\\"#{params[:deployment][:name]}\\\" in account: #{@options[:dst]} ...\\n\\n\"\n\n @api.account_id = @options[:dst]\n result = @api.deployments.create(params)\n @new_deployment = result.href\n\n # Set deployment level inputs. Cannot set them at create time, so do it now\n deployment = @api.resource(@new_deployment)\n deployment_inputs = {}\n deployment_inputs[:inputs] = inputs\n deployment.inputs.multi_update(deployment_inputs)\nend", "def patch_tier1_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_policy_service_instance\"\n end\n # verify the required parameter 'policy_service_instance' is set\n if @api_client.config.client_side_validation && policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#patch_tier1_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @instance_type = InstanceType.new(params[:instance_type])\n\n respond_to do |format|\n if @instance_type.save\n format.html { redirect_to @instance_type, notice: 'Instance type was successfully created.' }\n format.json { render json: @instance_type, status: :created, location: @instance_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @instance_type.errors, status: :unprocessable_entity }\n end\n end\n end", "def create(name, config)\n # @step: build the paramaters\n parameters = [\n { parameter_key: 'AvailabilityZones', parameter_value: config[:availability_zones] },\n { parameter_key: 'BucketName', parameter_value: @templates_bucket },\n { parameter_key: 'BucketVersion', parameter_value: @templates_version },\n { parameter_key: 'ClusterAutoScaler', parameter_value: 'Enabled' },\n { parameter_key: 'ClusterName', parameter_value: name },\n { parameter_key: 'KeyPairName', parameter_value: config[:ssh_keypair] },\n { parameter_key: 'KubernetesVersion', parameter_value: config[:version] },\n { parameter_key: 'NodeGroupName', parameter_value: 'compute' },\n { parameter_key: 'NodeInstanceType', parameter_value: config[:machine_type] },\n { parameter_key: 'NodeVolumeSize', parameter_value: config[:disk_size_gb].to_s },\n { parameter_key: 'NumberOfAZs', parameter_value: config[:availability_zones].split(',').size.to_s },\n { parameter_key: 'NumberOfNodes', parameter_value: config[:size].to_s },\n { parameter_key: 'PrivateSubnet1CIDR', parameter_value: config[:private_subnet1_cidr] },\n { parameter_key: 'PrivateSubnet2CIDR', parameter_value: config[:private_subnet2_cidr] },\n { parameter_key: 'PrivateSubnet3CIDR', parameter_value: config[:private_subnet3_cidr] },\n { parameter_key: 'PublicSubnet1CIDR', parameter_value: config[:public_subnet1_cidr] },\n { parameter_key: 'PublicSubnet2CIDR', parameter_value: config[:public_subnet2_cidr] },\n { parameter_key: 'PublicSubnet3CIDR', parameter_value: config[:public_subnet3_cidr] },\n { parameter_key: 'RemoteAccessCIDR', parameter_value: '0.0.0.0/0' },\n { parameter_key: 'VPCCIDR', parameter_value: config[:network] }\n ]\n\n # @step: provision the cloudformation stacks\n stack_name = 'aws-cluster'\n info \"provisioning the cloudFormation: #{stack_name}\"\n info \"using the template from: #{template_path(stack_name)}\"\n\n outputs = cloudformation(name, template_url: template_path(stack_name), parameters: parameters)\n\n info 'waiting for the kube apiserver to become available'\n client = HubClustersCreator::Kube.new(outputs['EKSEndpoint'], token: build_token(name))\n client.wait_for_kubeapi\n\n # @step: check if the awa-auth configmap exists already, we never overwrite\n unless client.exists?('aws-auth', 'kube-system', 'configmaps')\n info 'provition the aws-auth configureation configmap'\n client.kubectl(default_aws_auth(name))\n\n # @step: ensure we have some nodes\n info 'waiting for some nodes to become available'\n client.wait('aws-node', 'kube-system', 'daemonsets', version: 'extensions/v1beta1') do |x|\n x.status.numberReady.positive?\n end\n end\n\n # @step: provision the cluster\n info 'bootstraping the eks cluster'\n config[:credentials] = {\n access_id: @access_id,\n access_key: @access_key,\n account_id: @account_id,\n region: @region\n }\n\n result = HubClustersCreator::Providers::Bootstrap.new(name, 'eks', client, config).bootstrap\n {\n cluster: {\n ca: outputs['EKSCA'],\n endpoint: outputs['EKSEndpoint'],\n service_account_name: 'sysadmin',\n service_account_namespace: 'kube-system',\n service_account_token: Base64.decode64(client.account('sysadmin'))\n },\n config: config,\n services: result\n }\n end", "def create # rubocop:disable Metrics/AbcSize\n inst_details = AttrFinder.new(@instanceparameters)\n inst_details.options = @options\n inst_details.validate = @validate\n inst_details.function = 'server'\n BmcAuthenticate.new(@options)\n request = OracleBMC::Core::Models::LaunchInstanceDetails.new\n ssh_public_key = @instanceparameters['server']['ssh-key']\n request.availability_domain = inst_details.ad\n request.compartment_id = inst_details.compartment\n request.display_name = @instanceparameters['server']['display_name']\n request.image_id = inst_details.image\n request.shape = @instanceparameters['server']['shape']\n request.subnet_id = inst_details.subnet\n request.metadata = { 'ssh_authorized_keys' => ssh_public_key }\n api = OracleBMC::Core::ComputeClient.new\n response = api.launch_instance(request)\n @instance_id = response.data.id\n compartment(inst_details.compartment)\n running_instance = api.get_instance(@instance_id).wait_until(:lifecycle_state,\n OracleBMC::Core::Models::Instance::LIFECYCLE_STATE_RUNNING,\n max_interval_seconds: 5, max_wait_seconds: 300)\n if @instanceparameters['server']['attachments']\n @instanceparameters['server']['attachments'].each do |vol|\n attach(@instance_id, vol['volume'])\n end\n end\n running_instance\n end", "def create_tier1_policy_service_instance_0(tier_1_id, locale_service_id, service_instance_id, policy_service_instance, opts = {})\n data, _status_code, _headers = create_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, policy_service_instance, opts)\n data\n end", "def create_tier1_service_interface(tier_1_id, locale_service_id, interface_id, service_interface, opts = {})\n data, _status_code, _headers = create_tier1_service_interface_with_http_info(tier_1_id, locale_service_id, interface_id, service_interface, opts)\n data\n end", "def create_virtual_machine(params, options={})\n options[:os_type] = get_os_type(params[:image])\n options[:image_type] = get_image_type(params[:image])\n validate_deployment_params(params, options)\n options[:cloud_service_name] = generate_cloud_service_name(params[:vm_name]) unless options[:cloud_service_name]\n options[:storage_account_name] = generate_storage_account_name(params[:vm_name]) unless options[:storage_account_name] \n optionals = {}\n if options[:virtual_network_name]\n virtual_network_service = Azure::VirtualNetworkManagementService.new\n virtual_networks = virtual_network_service.list_virtual_networks.select{|x| x.name == options[:virtual_network_name]}\n if virtual_networks.empty?\n Loggerx.error_with_exit \"Virtual network #{options[:virtual_network_name]} doesn't exists\"\n else\n optionals[:affinity_group_name] = virtual_networks.first.affinity_group\n end\n elsif options[:affinity_group_name]\n optionals[:affinity_group_name] = options[:affinity_group_name]\n else\n optionals[:location] = params[:location]\n end \n cloud_service = Azure::CloudServiceManagementService.new\n cloud_service.create_cloud_service(options[:cloud_service_name], optionals)\n cloud_service.upload_certificate(options[:cloud_service_name],params[:certificate]) unless params[:certificate].empty?\n Azure::StorageManagementService.new.create_storage_account(options[:storage_account_name], optionals)\n\n body = Serialization.deployment_to_xml(params,options)\n path = \"/services/hostedservices/#{options[:cloud_service_name]}/deployments\"\n Loggerx.info \"Deployment in progress...\"\n request = ManagementHttpRequest.new(:post, path, body)\n request.call\n get_virtual_machine(params[:vm_name],options[:cloud_service_name])\n rescue Exception => e\n e.message\n end", "def create_pvm_instance(instance_hash)\n post(\"cloud-instances/#{guid}/pvm-instances\", instance_hash.to_json)\n end", "def create_tier1_service_instance_endpoint(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n data, _status_code, _headers = create_tier1_service_instance_endpoint_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts)\n data\n end", "def create\n @servicetype = Servicetype.new(params[:servicetype])\n\n respond_to do |format|\n if @servicetype.save\n format.html { redirect_to @servicetype, :notice => 'Servicetype was successfully created.' }\n format.json { render :json => @servicetype, :status => :created, :location => @servicetype }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @servicetype.errors, :status => :unprocessable_entity }\n end\n end\n end", "def patch_tier1_service_instance_endpoint_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_endpoint' is set\n if @api_client.config.client_side_validation && service_instance_endpoint.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_instance_endpoint)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#patch_tier1_service_instance_endpoint\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @instance_type = InstanceType.new(instance_type_params)\n\n respond_to do |format|\n if @instance_type.save\n format.html { redirect_to @instance_type, notice: 'Instance type was successfully created.' }\n format.json { render action: 'show', status: :created, location: @instance_type }\n else\n format.html { render action: 'new' }\n format.json { render json: @instance_type.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch_tier1_service_instance_endpoint_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint' is set\n if @api_client.config.client_side_validation && service_instance_endpoint.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_instance_endpoint)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#patch_tier1_service_instance_endpoint_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def post_compute(request)\n # --- Create the new Instance ---\n vm = VirtualMachineOCCI.new(\n VirtualMachine.build_xml,\n @client,\n request.body.read,\n @config[:instance_types],\n @config[:template_location])\n\n # --- Generate the template and Allocate the new Instance ---\n template = vm.to_one_template\n return template, 500 if OpenNebula.is_error?(template)\n\n rc = vm.allocate(template)\n if OpenNebula.is_error?(rc)\n return rc, CloudServer::HTTP_ERROR_CODE[rc.errno]\n end\n\n # --- Prepare XML Response ---\n vm.info\n return to_occi_xml(vm, :code=>201)\n end", "def create_service(resource, actions)\n service_name = get_service_name()\n\n case resource.service_type\n when \"upstart\"\n service service_name do\n provider Chef::Provider::Service::Upstart\n supports :status => true, :restart => true, :reload => true\n action actions\n end\n when \"init.d\"\n service service_name do\n supports :status => true, :restart => true, :reload => true\n action actions\n end\n else\n raise \"dashing: Unknown service_type '#{resource.service_type}'\"\n end\nend", "def start_pvm_instance(instance_id)\n post(\n \"cloud-instances/#{guid}/pvm-instances/#{instance_id}/action\",\n {\"action\" => \"start\"}.to_json\n )\n end", "def create_service(data=nil)\n if (!data.blank? && data.is_a?(Hash))\n @service = Service.create(data)\n else\n @service = Service.create(:name => \"Test Service #{rand(1..1000)}\", :description => \"Test service description.\", :active => true, :probe => \"dummy\", :probe_config => {:value => 1}, :interval => 60, :clean_interval => 86400, :priority => Service::PRIORITY_NORMAL, :resume => :mean_value)\n end\n end", "def create\n @instance = Instance.new(params[:instance])\n\n respond_to do |format|\n if @instance.save\n\n system(\"ssh root@#{CloudGui::Application.config.hypervisor_ip} \\\"exec /data/cloud/scripts/provision.sh #{params[:instance][:cpus]} #{params[:instance][:memory]} #{params[:instance][:baseimage]} 2>&1 | tee /data/cloud/logs/cloud_gui.log\\\"\")\n\n format.html { redirect_to @instance, notice: 'Instance was successfully created.' }\n format.json { render json: @instance, status: :created, location: @instance }\n else\n format.html { render action: \"new\" }\n format.json { render json: @instance.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n submenu_item 'services-new'\n @service = Service.new(params[:service])\n @service_type = @service.type\n service_param\n\n @service.tenant_id = current_user.tenant_id\n\n # service_params = Service.extract_params(params[:service])\n # service_params = Service.extract_thresholds(service_params)\n # @service = Service.new(service_params)\n\n respond_to do |format|\n if @service.save\n flash[:notice] = \"#{@service.name}创建成功\"\n format.html { redirect_to(@service) }\n else\n dictionary\n format.html { render :action => \"new\" }\n end\n end\n end", "def create_tier1_service_instance_endpoint_0(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n data, _status_code, _headers = create_tier1_service_instance_endpoint_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts)\n data\n end", "def create_or_patch_tier1_l2_vpn_service_0_with_http_info(tier_1_id, locale_service_id, service_id, l2_vpn_service, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'service_id' is set\n if @api_client.config.client_side_validation && service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'l2_vpn_service' is set\n if @api_client.config.client_side_validation && l2_vpn_service.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_vpn_service' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/l2vpn-services/{service-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-id' + '}', service_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_vpn_service)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi#create_or_patch_tier1_l2_vpn_service_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_service\n # Check signals here to be nice and abort early if possible.\n check_signals!\n # Enable automatically creates the service with Runit.\n directory \"/var/log/#{new_resource.service_name}\" do\n owner 'root'\n group 'root'\n mode '700'\n end\n end", "def create\n @recreation_service_typology = RecreationServiceTypology.new(recreation_service_typology_params)\n\n respond_to do |format|\n if @recreation_service_typology.save\n format.html { redirect_to @recreation_service_typology, notice: 'Recreation service typology was successfully created.' }\n format.json { render action: 'show', status: :created, location: @recreation_service_typology }\n else\n format.html { render action: 'new' }\n format.json { render json: @recreation_service_typology.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_tier1_service_interface_with_http_info(tier_1_id, locale_service_id, interface_id, service_interface, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface\"\n end\n # verify the required parameter 'service_interface' is set\n if @api_client.config.client_side_validation && service_interface.nil?\n fail ArgumentError, \"Missing the required parameter 'service_interface' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_interface)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#create_tier1_service_interface\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_vm(opts = {})\n opts = opts.with_indifferent_access.reverse_merge(\n VSphereConfig.create_vm_defaults.symbolize_keys || {}\n )\n\n opts[:template_path] = compute.image if compute.image\n\n VSphere.with_connection do |vs|\n dest_folder = opts[:dest_folder]\n vm_name = opts[:name] || \"#{compute.image}-\"\\\n \"#{SecureRandom.hex(4)}-#{Time.new.strftime(\"%Y%m%d\")}\"\n exception_cb = lambda do |_p1|\n LabManager.logger.warn(\n \"Failed attempt to create virtual machine: template_name: #{opts[:template_path]}\"\\\n \", vm_name: #{vm_name}\"\n )\n end\n\n Retryable.retryable(\n tries: VSphereConfig.create_vm_defaults[:vm_clone_retry_count],\n on: [RbVmomi::Fault, CreateVMError, Fog::Compute::Vsphere::NotFound],\n exception_cb: exception_cb,\n sleep: ->(n) { Random.rand(n*3..n*3+10.0) }\n ) do\n LabManager.logger.info \"creating machine with name: #{vm_name} options: #{opts.inspect}\"\n machine = vs.vm_clone(\n 'datacenter' => opts[:datacenter],\n 'datastore' => opts[:datastore],\n 'template_path' => opts[:template_path],\n 'name' => vm_name,\n 'cluster' => opts[:cluster],\n 'linked_clone' => opts[:linked_clone],\n 'dest_folder' => dest_folder,\n 'power_on' => opts[:power_on],\n 'wait' => true\n )\n\n setup_network_interfaces({\n uuid: machine['new_vm']['uuid'],\n connection: vs,\n network_name: VSphereConfig.create_vm_defaults[:network_interface_name]\n })\n\n fail CreateVMError, \"Creation of (#{vm_name}) machine failed, retrying\" unless machine || machine['vm_ref']\n set_provider_data(machine['new_vm'], vs: vs)\n end\n\n add_machine_to_drs_rule(\n vs,\n group: opts[:add_to_drs_group],\n machine: \"#{dest_folder}/#{vm_name}\",\n datacenter: opts[:datacenter]\n ) if opts[:add_to_drs_group]\n end\n poweron_vm unless compute.provider_data['power_state'] == 'poweredOn'\n rescue\n # Try to free unsuccessfully started/configured/... VM\n begin\n terminate_vm\n rescue\n nil\n end if instance_uuid\n raise\n end", "def create_virtual_machine(vm)\n kubevirt_client.create_virtual_machine(vm)\n end", "def create_tier1_policy_service_instance(tier_1_id, locale_service_id, service_instance_id, policy_service_instance, opts = {})\n data, _status_code, _headers = create_tier1_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, policy_service_instance, opts)\n data\n end", "def create_tier1_byod_policy_service_instance_0(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts = {})\n data, _status_code, _headers = create_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts)\n data\n end", "def new\n @service = Service.new\n\n # If a valid type is received, apply to the host to create.\n check_priority_param\n @service.priority = @priority if([email protected]?)\n\n # Add custom views paths\n prepend_view_path \"app/views/services\"\n prepend_view_path \"lib/probes/#{@service.probe}/views\"\n\n respond_to do |format|\n format.html\n end\n end", "def create\n req = VCAP::Services::Api::ServiceOfferingRequest.decode(request_body)\n logger.debug(\"Create service request: #{req.extract.inspect}\")\n\n # Should we worry about a race here?\n\n success = nil\n svc = Service.find_by_label(req.label)\n if svc\n raise CloudError.new(CloudError::FORBIDDEN) unless svc.verify_auth_token(@service_auth_token)\n attrs = req.extract.dup\n attrs.delete(:label)\n # Keep DB in sync with configs if the token changes in the config\n attrs[:token] = @service_auth_token if svc.is_builtin?\n svc.update_attributes!(attrs)\n else\n # Service doesn't exist yet. This can only happen for builtin services since service providers must\n # register with us to get a token.\n svc = Service.new(req.extract)\n raise CloudError.new(CloudError::FORBIDDEN) unless svc.is_builtin? && svc.verify_auth_token(@service_auth_token)\n svc.token = @service_auth_token\n svc.save!\n end\n\n render :json => {}\n end", "def createEc2Instance\n\n instance_descriptor = {\n :image_id => @config[\"image_id\"],\n :key_name => @deploy.ssh_key_name,\n :instance_type => @config[\"size\"],\n :disable_api_termination => true,\n :min_count => 1,\n :max_count => 1\n }\n\n instance_descriptor[:iam_instance_profile] = getIAMProfile\n\n security_groups = myFirewallRules.map { |fw| fw.cloud_id }\n if security_groups.size > 0\n instance_descriptor[:security_group_ids] = security_groups\n else\n raise MuError, \"Didn't get any security groups assigned to be in #{@mu_name}, that shouldn't happen\"\n end\n\n if @config['private_ip']\n instance_descriptor[:private_ip_address] = @config['private_ip']\n end\n\n if [email protected]? and @config.has_key?(\"vpc\")\n subnet = mySubnets.sample\n if subnet.nil?\n raise MuError, \"Got null subnet id out of #{@config['vpc']}\"\n end\n MU.log \"Deploying #{@mu_name} into VPC #{@vpc.cloud_id} Subnet #{subnet.cloud_id}\"\n allowBastionAccess\n instance_descriptor[:subnet_id] = subnet.cloud_id\n end\n\n if [email protected]? and [email protected]?\n instance_descriptor[:user_data] = Base64.encode64(@userdata)\n end\n\n MU::Cloud::AWS::Server.waitForAMI(@config[\"image_id\"], region: @region, credentials: @credentials)\n\n instance_descriptor[:block_device_mappings] = MU::Cloud::AWS::Server.configureBlockDevices(image_id: @config[\"image_id\"], storage: @config['storage'], region: @region, credentials: @credentials)\n\n instance_descriptor[:monitoring] = {enabled: @config['monitoring']}\n\n if @tags and @tags.size > 0\n instance_descriptor[:tag_specifications] = [{\n :resource_type => \"instance\",\n :tags => @tags.keys.map { |k|\n { :key => k, :value => @tags[k] }\n }\n }]\n end\n\n MU.log \"Creating EC2 instance #{@mu_name}\", details: instance_descriptor\n\n instance = resp = nil\n loop_if = Proc.new {\n instance = resp.instances.first if resp and resp.instances\n resp.nil? or resp.instances.nil? or instance.nil?\n }\n\n bad_subnets = []\n mysubnet_ids = if mySubnets\n mySubnets.map { |s| s.cloud_id }\n end\n begin\n MU.retrier([Aws::EC2::Errors::InvalidGroupNotFound, Aws::EC2::Errors::InvalidSubnetIDNotFound, Aws::EC2::Errors::InvalidParameterValue], loop_if: loop_if, loop_msg: \"Waiting for run_instances to return #{@mu_name}\") {\n resp = MU::Cloud::AWS.ec2(region: @region, credentials: @credentials).run_instances(instance_descriptor)\n }\n rescue Aws::EC2::Errors::Unsupported => e\n bad_subnets << instance_descriptor[:subnet_id]\n better_subnet = (mysubnet_ids - bad_subnets).sample\n if e.message !~ /is not supported in your requested Availability Zone/ and\n (mysubnet_ids.nil? or mysubnet_ids.empty? or\n mysubnet_ids.size == bad_subnets.size or\n better_subnet.nil? or better_subnet == \"\")\n raise MuError.new e.message, details: mysubnet_ids\n end\n instance_descriptor[:subnet_id] = (mysubnet_ids - bad_subnets).sample\n if instance_descriptor[:subnet_id].nil?\n raise MuError.new \"Specified subnet#{bad_subnets.size > 1 ? \"s do\" : \" does\"} not support instance type #{instance_descriptor[:instance_type]}\", details: bad_subnets\n end\n MU.log \"One or more subnets does not support instance type #{instance_descriptor[:instance_type]}, attempting with #{instance_descriptor[:subnet_id]} instead\", MU::WARN, details: bad_subnets\n retry\n rescue Aws::EC2::Errors::InvalidRequest => e\n MU.log e.message, MU::ERR, details: instance_descriptor\n raise e\n end\n\n MU.log \"#{@mu_name} (#{instance.instance_id}) coming online\"\n\n instance\n end", "def create\n @idti_service = IdtiService.new(idti_service_params)\n\n respond_to do |format|\n if @idti_service.save\n format.html { redirect_to @idti_service, notice: 'Idti service was successfully created.' }\n format.json { render :show, status: :created, location: @idti_service }\n else\n format.html { render :new }\n format.json { render json: @idti_service.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_tier1_service_interface_0_with_http_info(tier_1_id, locale_service_id, interface_id, service_interface, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface_0\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface_0\"\n end\n # verify the required parameter 'service_interface' is set\n if @api_client.config.client_side_validation && service_interface.nil?\n fail ArgumentError, \"Missing the required parameter 'service_interface' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_interface)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#create_tier1_service_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def createEc2Instance\n\t\t name = @server[\"name\"]\n\t\t node = @server['mu_name']\n\t\t\tbegin\n\t\t\t\t@server['iam_role'] = MU::Server.createIAMProfile(\"Server-\"+name, base_profile: @server['iam_role'], extra_policies: @server['iam_policies'])\n\t\t\trescue Aws::EC2::Errors::RequestLimitExceeded => e\n\t\t\t\tsleep 10\n\t\t\t\tretry\n\t\t\tend\n\t\t\t@server['iam_role'] = @server['iam_role']\n\n\t\t\tbegin\n\t\t\t\[email protected]\n\t\t\trescue Aws::EC2::Errors::RequestLimitExceeded => e\n\t\t\t\tsleep 10\n\t\t\t\tretry\n\t\t\tend\n\n\t\t instance_descriptor = {\n\t\t :image_id => @server[\"ami_id\"],\n\t\t :key_name => @deploy.keypairname,\n\t\t :instance_type => @server[\"size\"],\n\t\t :disable_api_termination => true,\n\t\t :min_count => 1,\n\t\t :max_count => 1,\n\t\t\t\t:network_interfaces => [\n\t\t\t\t\t{\n\t\t\t\t\t\t:associate_public_ip_address => name[\"associate_public_ip\"]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t }\n\t\t\t\n\t\t\tif !@server['private_ip'].nil?\n\t\t\t\tinstance_descriptor[:private_ip_address] = @server['private_ip']\n\t\t\tend\n\n\t\t\tvpc_id=subnet_id=nat_host_name=nat_ssh_user = nil\n\t\t\tsubnet_retries = 0\n\t\t\tif !@server[\"vpc\"].nil?\n\t\t\t\tbegin\n\t\t\t\t\tvpc_id, subnet_ids, nat_host_name, nat_ssh_user = MU::VPC.parseVPC(@server['vpc'])\n\t\t\t\trescue Aws::EC2::Errors::ServiceError => e\n\t\t\t\t\tMU.log e.message, MU::ERR, details: @server\n\t\t\t\t\tif subnet_retries < 5\n\t\t\t\t\t subnet_retries = subnet_retries + 1\n\t\t\t\t\t sleep 15\n\t\t\t\t\t retry\n\t\t\t\t\tend\n\t\t\t\t\traise e\n\t\t\t\tend\n\t\t\t\tsubnet_id = subnet_ids.first\n\t\t\t\tif subnet_id.nil? or subnet_id.empty?\n\t\t\t\t\tMU.log \"Got null Subnet id out of #{@server['vpc']}\", MU::ERR\n\t\t\t\t\traise \"deploy failure\"\n\t\t\t\tend\n\n\t\t\t\tMU.log \"Deploying #{node} into VPC #{vpc_id} Subnet #{subnet_id}\"\n\n\t\t\t\tif !@server[\"vpc\"][\"nat_host_name\"].nil? or !@server[\"vpc\"][\"nat_host_id\"].nil?\n\t\t\t\t\tadmin_sg = MU::Server.punchAdminNAT(@server, node)\n\t\t\t\telse\n\t\t\t\t\tadmin_sg = MU::FirewallRule.setAdminSG(vpc_id: vpc_id, region: @server['region'])\n\t\t\t\tend\n\n\t\t\t\tinstance_descriptor[:subnet_id] = subnet_id\n\t\t\t\tnode_sg = MU::FirewallRule.createEc2SG(\n\t\t\t\t\t\t@server[\"name\"].upcase,\n\t\t\t\t\t\t@server[\"ingress_rules\"],\n\t\t\t\t\t\tdescription: \"SG holes for #{node}\",\n\t\t\t\t\t\tvpc_id: vpc_id,\n\t\t\t\t\t\tregion: @server['region']\n\t\t\t\t)\n\t\t\telse\n\t\t\t\tadmin_sg = MU::FirewallRule.setAdminSG(region: @server['region'])\n\t\t\t\tnode_sg = MU::FirewallRule.createEc2SG(\n\t\t\t\t\t\t@server[\"name\"].upcase,\n\t\t\t\t\t\t@server[\"ingress_rules\"],\n\t\t\t\t\t\tdescription: \"SG holes for #{node}\",\n\t\t\t\t\t\tregion: @server['region']\n\t\t\t\t)\n\t\t\tend\n\t\t\tsecurity_groups = Array.new\n\t\t\tsecurity_groups << admin_sg\n\t\t\tsecurity_groups << node_sg\n\t\t\tif !@server[\"add_firewall_rules\"].nil?\n\t\t\t\t@server[\"add_firewall_rules\"].each { |acl|\n\t\t\t\t\tsg = MU::FirewallRule.find(sg_id: acl[\"rule_id\"], name: acl[\"rule_name\"], region: @server['region'])\n\t\t\t\t\tif sg.nil?\n\t\t\t\t\t\tMU.log \"Couldn't find dependent security group #{acl} for server #{node}\", MU::ERR\n\t\t\t\t\t\traise \"deploy failure\"\n\t\t\t\t\tend\n\t\t\t\t\tsecurity_groups << sg.group_id\n\t\t\t\t}\n\t\t\tend\n\n\t\t\tinstance_descriptor[:security_group_ids] = security_groups\n\n\t\t if [email protected]? and [email protected]?\n\t\t instance_descriptor[:user_data] = Base64.encode64(@userdata)\n\t\t end\n\n\t\t if !@server[\"iam_role\"].nil?\n\t\t instance_descriptor[:iam_instance_profile] = { name: @server[\"iam_role\"]}\n\t\t end\n\n\t\t\tconfigured_storage = Array.new\n\t\t\tif @server[\"storage\"]\n\t\t\t\t@server[\"storage\"].each { |vol|\n\t\t\t\t\tconfigured_storage << MU::Server.convertBlockDeviceMapping(vol)\n\t\t\t\t}\n\t\t\tend\n\t\t\n\t\t\tMU::Server.waitForAMI(@server[\"ami_id\"], region: @server['region'])\n\n\t\t\tinstance_descriptor[:block_device_mappings] = configured_storage\n\t\t\tinstance_descriptor[:block_device_mappings].concat(@ephemeral_mappings)\n\n\t\t\tinstance_descriptor[:monitoring] = { enabled: @server['monitoring'] }\n\n\t\t\tMU.log \"Creating EC2 instance #{node}\"\n\t\t\tMU.log \"Instance details for #{node}: #{instance_descriptor}\", MU::DEBUG\n#\t\t\t\tif instance_descriptor[:block_device_mappings].empty?\n#\t\t\t\t\tinstance_descriptor.delete(:block_device_mappings)\n#\t\t\t\tend\n#pp instance_descriptor[:block_device_mappings]\n\t\t\tretries = 0\n\t\t\tbegin\n\t\t\t\tresponse = MU.ec2(@server['region']).run_instances(instance_descriptor)\n\t\t\trescue Aws::EC2::Errors::InvalidGroupNotFound, Aws::EC2::Errors::InvalidSubnetIDNotFound, Aws::EC2::Errors::InvalidParameterValue, Aws::EC2::Errors::RequestLimitExceeded => e\n\t\t\t\tif retries < 10\n\t\t\t\t\tif retries > 7\n\t\t\t\t\t\tMU.log \"Seeing #{e.inspect} while trying to launch #{node}, retrying a few more times...\", MU::WARN, details: instance_descriptor\n\t\t\t\t\tend\n\t\t\t\t\tsleep 10\n\t\t\t\t\tretries = retries + 1\n\t\t\t\t\tretry\n\t\t\t\telse\n\t\t\t\t\traise e\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tinstance = response.instances.first\n\t\t\tMU.log \"#{node} (#{instance.instance_id}) coming online\"\n\n\n\t\t\treturn instance\n\n\t\tend", "def execute\n log.info 'Creating the Basic VM'\n placement_spec = VMPlacementHelper.get_placementspec_vm(service_manager.vapi_config, datacenter_name, folder_name, datastore_name)\n standard_network = NetworkHelper.get_standard_network_mapping(service_manager.vapi_config, @datacenter_name, standard_portgroup_name)\n boot_disk = VCENTER_HARDWARE_DISK_CLASS::CreateSpec.new('type' => VCENTER_HARDWARE_DISK_CLASS::HostBusAdapterType::SCSI,\n 'scsi' => VCENTER_HARDWARE_MODULE::ScsiAddressSpec.new('bus'=>0,'unit'=>0),\n 'new_vmdk' => VCENTER_HARDWARE_DISK_CLASS::VmdkCreateSpec.new() )\n data_disk = VCENTER_HARDWARE_DISK_CLASS::CreateSpec.new('new_vmdk' => VCENTER_HARDWARE_DISK_CLASS::VmdkCreateSpec.new())\n ethernet_nic_0 = VCENTER_HARDWARE_ETHERNET_CLASS::CreateSpec.new('start_connected' => true,\n 'backing' => VCENTER_HARDWARE_ETHERNET_CLASS::BackingSpec.new(\n 'type' => VCENTER_HARDWARE_ETHERNET_CLASS::BackingType::STANDARD_PORTGROUP,\n 'network' => standard_network))\n boot_device_order = [VCENTER_HARDWARE_BOOT_DEVICE_CLASS::EntryCreateSpec.new('type' => VCENTER_HARDWARE_BOOT_DEVICE_CLASS::Type::ETHERNET),\n VCENTER_HARDWARE_BOOT_DEVICE_CLASS::EntryCreateSpec.new('type' => VCENTER_HARDWARE_BOOT_DEVICE_CLASS::Type::DISK)]\n vm_create_spec = VCENTER_VM_CLASS::CreateSpec.new('name' => vm_name,\n 'guest_OS' => VCENTER_VM_GUESTOS_CLASS::WINDOWS_8_64,\n 'placement' => placement_spec,\n 'disks' => [boot_disk, data_disk],\n 'nics' => [ethernet_nic_0],\n 'boot_devices' => boot_device_order)\n log.info 'The CreateVM Spec is '\n #Pretty print the create spec of the VM.\n pp vm_create_spec\n vm_id = vm_svc.create(vm_create_spec)\n log.info \"Created vm #{vm_name} with the VM Identifier #{vm_id}\"\n end", "def set_instance_template request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n uri, body, query_string_params = transcode_set_instance_template_request request_pb\n response = @client_stub.make_post_request(\n uri: uri,\n body: body,\n params: query_string_params,\n options: options\n )\n result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true\n\n yield result, response if block_given?\n result\n end", "def create\n @deployment = Deployment.new(deployment_params)\n\n respond_to do |format|\n if @deployment.save\n format.html { redirect_to @deployment, notice: 'Deployment was successfully created.' }\n format.json { render :show, status: :created, location: @deployment }\n else\n format.html { render :new }\n format.json { render json: @deployment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n params[:deployment_id] = Deployment.find_key(params[:deployment]).id if params.has_key? :deployment\n params[:deployment_id] ||= Deployment.system\n params.require(:name)\n params.require(:deployment_id)\n default_net = nil\n Node.transaction do\n @node = Node.create!(params.permit(:name,\n :description,\n :admin,\n :deployment_id,\n :allocated,\n :alive,\n :system,\n :available,\n :bootenv))\n # Keep suport for mac and ip hints in short form around for legacy Sledgehammer purposes\n if params[:ip]\n default_net = Network.lookup_network(params[:ip]) ||\n Network.find_by_name(\"unmanaged\")\n Attrib.set(\"hint-#{default_net.name}-v4addr\",@node,params[:ip]) if default_net\n Attrib.set(\"hint-admin-macs\", @node, [params[:mac]]) if params[:mac]\n end\n end\n default_net.make_node_role(@node) if default_net\n render api_show @node\n end", "def create\n super(@@service)\n end", "def delete_tier1_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#delete_tier1_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_patch_tier1_l2_vpn_service_with_http_info(tier_1_id, locale_service_id, service_id, l2_vpn_service, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service\"\n end\n # verify the required parameter 'service_id' is set\n if @api_client.config.client_side_validation && service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service\"\n end\n # verify the required parameter 'l2_vpn_service' is set\n if @api_client.config.client_side_validation && l2_vpn_service.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_vpn_service' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/l2vpn-services/{service-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-id' + '}', service_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_vpn_service)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi#create_or_patch_tier1_l2_vpn_service\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @deployment = current_user.deployments.new(params[:deployment])\n\n respond_to do |format|\n if @deployment.save\n unless @deployment.environment.running?\n @deployment.environment.start!\n end\n format.html { redirect_to(@deployment.app, :notice => 'Application was successfully deployed.') }\n format.xml { render :xml => @deployment, :status => :created, :location => @deployment }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @deployment.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @deployment = Deployment.new(params[:deployment])\n\n respond_to do |format|\n if @deployment.save\n format.html { redirect_to @deployment, notice: 'Deployment was successfully created.' }\n format.json { render json: @deployment, status: :created, location: @deployment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @deployment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_tier1_byod_policy_service_instance(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts = {})\n data, _status_code, _headers = create_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts)\n data\n end", "def create\n @instance = @provider.instances.new(params[:instance])\n @instance.state = \"Building\"\n respond_to do |format|\n if @instance.save\n @instance.create_instance(@provider.connect!)\n format.html { redirect_to cloud_provider_instance_path(@provider,@instance), notice: 'Instance was successfully created.' }\n format.json { render json: @instance, status: :created, location: @instance }\n else\n format.html { render action: \"new\" }\n format.json { render json: @instance.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_resource(env)\n env[:ui].info(\"Creating machine\")\n\n config = env[:machine].provider_config\n vra = env[:vra]\n\n EntitledItemsCollection.fetch(env[:vra])\n .find_by_id(config.catalog_item_id)\n .request(cpus: config.cpus,\n memory: config.memory,\n requested_for: config.requested_for,\n subtenant_id: config.subtenant_id,\n lease_days: config.lease_days) { |req|\n config.extra_entries.types.each do |type|\n config.extra_entries.of_type(type).each do |k,v|\n req.set_parameter(k, type, v)\n end\n end\n }\n .join\n .machine\n end", "def create\n @instance_fault = InstanceFault.new(params[:instance_fault])\n\n respond_to do |format|\n if @instance_fault.save\n format.html { redirect_to @instance_fault, notice: 'Instance fault was successfully created.' }\n format.json { render json: @instance_fault, status: :created, location: @instance_fault }\n else\n format.html { render action: \"new\" }\n format.json { render json: @instance_fault.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tb_servicio = TbServicio.new(tb_servicio_params)\n\n respond_to do |format|\n if @tb_servicio.save\n format.html { redirect_to @tb_servicio, notice: 'Tb servicio was successfully created.' }\n format.json { render :show, status: :created, location: @tb_servicio }\n else\n format.html { render :new }\n format.json { render json: @tb_servicio.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @taxi_sevice = TaxiSevice.new(taxi_sevice_params)\n\n respond_to do |format|\n if @taxi_sevice.save\n format.html { redirect_to action: \"index\" }\n else\n format.html { render :new }\n format.json { render json: @taxi_sevice.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @item_tier = ItemTier.new(item_tier_params)\n\n respond_to do |format|\n if @item_tier.save\n format.html { redirect_to @item_tier, notice: 'Item tier was successfully created.' }\n format.json { render :show, status: :created, location: @item_tier }\n else\n format.html { render :new }\n format.json { render json: @item_tier.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_update_tier1_l2_vpn_service_0_with_http_info(tier_1_id, locale_service_id, service_id, l2_vpn_service, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'service_id' is set\n if @api_client.config.client_side_validation && service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'l2_vpn_service' is set\n if @api_client.config.client_side_validation && l2_vpn_service.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_vpn_service' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/l2vpn-services/{service-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-id' + '}', service_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_vpn_service)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2VPNService')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi#create_or_update_tier1_l2_vpn_service_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_on_backend\n lab = Lab.find(self.lab_id)\n Rails.logger.info \"Creating tenant #{self.name} on openstack backend #{lab.name}.\"\n\n # First, run through some checks to ensure we can create the whole tenant properly\n # Check if an external network exists\n admin_network_c = lab.get_neutron(lab.auth_tenant) \n ext_network = admin_network_c.list_networks.select {|n| n.external == true}\n if ext_network.empty?\n Rails.logger.error \"There are no external networks on the OpenStack host\"\n return false\n end\n\n # Check if there are enough available floating ips\n # There does not appear to be an api endpoint to check ips available for an instance to check out\n # TODO - Take another look at this.\n\n # Create the tenant\n identity_c = get_connection(\"identity\")\n identity_c.create_tenant({:name => self.name, :description => \"Created by OpenShift Labs app\", :enabled => true})\n tenant = identity_c.tenants.select {|t| t.name == self.name}.first\n if tenant.nil?\n Rails.logger.error \"Attempted to create tenant with name #{self.name}, but tenant does not exist after creation.\"\n return false\n else\n Rails.logger.info \"Created tenant #{self.name} with tenant id #{tenant.id}.\"\n self.uuid = tenant.id\n end\n\n # If any of the following fails, we need to be sure we delete the OpenStack backend tenant\n begin\n\n # Add the lab's user to the tenant\n # TODO the below assumes an admin role exists. Need to verify that this is always the case.\n role = identity_c.list_roles.select {|r| r[:name] == \"admin\"}.first\n admin_user = identity_c.list_users.select {|u| u.name == lab.username }.first\n Rails.logger.info \"Adding user #{admin_user.name} to the #{self.name} tenant.\"\n identity_c.add_user_to_tenant({:tenant_id => tenant.id, :role_id => role[:id], :user_id => admin_user.id})\n\n # Get the compute and neutron connections\n compute_c = get_connection(\"compute\")\n network_c = get_connection(\"network\")\n\n # Set the quotas appropriately\n # Works needs to be done in the ruby-openstack gem to support this.\n Rails.logger.info \"Setting #{self.name} tenant quotas.\"\n compute_c.set_limits(tenant.id, {:cores => lab.default_quota_cores,\n :floating_ips => lab.default_quota_instances,\n :instances => lab.default_quota_instances,\n :ram => lab.default_quota_ram\n })\n\n # Create a network\n network_name = self.name + \"-network\"\n Rails.logger.info \"Creating network with name #{network_name} for tenant #{self.name}.\"\n network = network_c.create_network(network_name, {:admin_state_up => true})\n self.network = network_name\n\n # Create a subnet\n subnet_name = self.name + \"-subnet\"\n # TODO nameservers are hard-coded, but could change. Need to have them entered somewhere.\n Rails.logger.info \"Creating subnet with name #{subnet_name} for tenant #{self.name}.\"\n subnet = network_c.create_subnet(network.id, \"192.168.1.0/24\", \"4\", {:name => subnet_name, :gateway_ip => \"192.168.1.1\", :enable_dhcp => true, :dns_nameservers => ['10.11.5.3', '10.11.5.4']})\n\n # Create a router and add interface to subnet\n router_name = self.name + \"-router\"\n # TODO we grab the first external network, we should have a user specify which one to use somewhere, in case there are multiple\n external_network = network_c.list_networks.select {|n| n.external == true }.first\n Rails.logger.info \"Creating router with name #{router_name} for tenant #{self.name}.\"\n router = network_c.create_router(router_name, true, {:external_gateway_info => {:network_id => external_network.id}})\n Rails.logger.info \"Adding router interface for subnet #{subnet_name} on router #{router_name}.\"\n network_c.add_router_interface(router.id, subnet.id)\n\n # Get the default security group\n # TODO we assume there is a default security group, probably not the best way to go about this.\n security_group = compute_c.security_groups.select {|k,v| v[:name] == \"default\"}\n self.security_group = \"default\"\n security_group_id = security_group.keys.first\n\n # Delete default security group rules\n Rails.logger.info \"Removing default Ingress security group rules for tenant #{self.name}.\"\n security_group[security_group_id][:rules].each do |rule|\n compute_c.delete_security_group_rule(rule[:id])\n end\n\n # Create necessary security group rules\n Rails.logger.info \"Creating all-open security groups rules for tcp, udp, and icmp on tenant #{self.name}\"\n compute_c.create_security_group_rule(security_group_id, \n {:ip_protocol => \"tcp\", :from_port => 1, :to_port => 65535, :cidr => \"0.0.0.0/0\"})\n compute_c.create_security_group_rule(security_group_id, \n {:ip_protocol => \"udp\", :from_port => 1, :to_port => 65535, :cidr => \"0.0.0.0/0\"})\n compute_c.create_security_group_rule(security_group_id, \n {:ip_protocol => \"icmp\", :from_port => -1, :to_port => -1, :cidr => \"0.0.0.0/0\"})\n\n # Allocate all necessary floating ips\n # TODO shouldn't just get the first pool, should have a dropdown and database entry in project\n Rails.logger.info \"Allocating #{lab.default_quota_instances} floating ips to tenant #{self.name}\"\n floating_ip_pool = compute_c.get_floating_ip_pools.first[\"name\"]\n lab.default_quota_instances.times do\n compute_c.create_floating_ip(:pool => floating_ip_pool)\n end\n \n Rails.logger.info \"Tenant #{self.name} creation completed.\"\n rescue => e\n Rails.logger.error \"Could not create OpenStack backend tenant due to:\"\n Rails.logger.error e.message\n Rails.logger.error e.backtrace\n destroy_backend\n end\n\n end", "def create(cluster_id)\n # create ONE object\n new_object\n\n rc = @one.allocate(format_template(@p_template), cluster_id)\n Utils.exception(rc)\n rc = @one.info\n Utils.exception(rc)\n\n OneProvisionLogger.debug(\n \"#{@type} created with ID: #{@one.id}\"\n )\n\n Integer(@one.id)\n end", "def create_tier1_service_interface_0(tier_1_id, locale_service_id, interface_id, service_interface, opts = {})\n data, _status_code, _headers = create_tier1_service_interface_0_with_http_info(tier_1_id, locale_service_id, interface_id, service_interface, opts)\n data\n end", "def new\n @tier_setting = TierSetting.new(tier: @week.next_missing_tier)\n end", "def create\n @tc_detail_step = TcDetailStep.new(params[:tc_detail_step])\n\n respond_to do |format|\n if @tc_detail_step.save\n format.html { redirect_to @tc_detail_step, notice: 'Tc detail step was successfully created.' }\n format.json { render json: @tc_detail_step, status: :created, location: @tc_detail_step }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tc_detail_step.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n deploy\n end", "def start\n service.pool_action uuid, :create\n end", "def delete_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.delete_tier1_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#delete_tier1_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_tier1_locale_services_0_with_http_info(tier_1_id, locale_services_id, locale_services, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services_0\"\n end\n # verify the required parameter 'locale_services' is set\n if @api_client.config.client_side_validation && locale_services.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(locale_services)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#create_or_replace_tier1_locale_services_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_sap_pvm_instance(instance_hash)\n post(\"cloud-instances/#{guid}/sap\", instance_hash.to_json)\n end", "def create\n @tm_dev1 = TmDev1.new(params[:tm_dev1])\n\n respond_to do |format|\n if @tm_dev1.save\n flash[:notice] = 'TmDev1 was successfully created.'\n format.html { redirect_to(@tm_dev1) }\n format.xml { render :xml => @tm_dev1, :status => :created, :location => @tm_dev1 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @tm_dev1.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create_or_replace_tier1_locale_services_with_http_info(tier_1_id, locale_services_id, locale_services, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services\"\n end\n # verify the required parameter 'locale_services' is set\n if @api_client.config.client_side_validation && locale_services.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(locale_services)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#create_or_replace_tier1_locale_services\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n response.add(exec: \"kubectl create ns #{namespace}\", env: kube_env)\n response.add(exec: \"kubectl label namespace #{namespace} istio-injection=enabled --overwrite\", env: kube_env)\n # errors.add(:kubectl_label_namespace, stderr) if exit_code.positive? and stderr.index('AlreadyExists').nil?\n\n # deploy helm into namespace\n # TODO: Need to generate tiller-rbac\n response.add(exec: kubectl(\"apply -f #{target.write_path}/tiller-k8s-ns.yml\"), env: kube_env)\n response.add(exec: 'helm init --upgrade --wait --service-account tiller', env: kube_env)\n end", "def read_tier1_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def add_instance(opts)\n unless %w[app util].include?(opts[:role].to_s)\n # Fail immediately because we don't have valid arguments.\n raise InvalidInstanceRole, \"Instance role must be one of: app, util\"\n end\n\n # Sanitize the name to remove whitespace if there is any\n if opts[:name]\n name = opts[:name].gsub(/\\s+/, '')\n end\n\n if opts[:role] == 'util'\n unless name && name.length > 0\n raise InvalidInstanceName, \"When specifying a util instance you must also specify a name.\"\n end\n end\n \n request = { \"role\" => opts[:role], \"name\" => opts[:name] }\n request['snapshot_id'] = opts[:snapshot_id] if opts.key?(:snapshot_id)\n request['instance_size'] = opts[:instance_size] if opts.key?(:instance_size)\n\n # We know opts[:role] is right, name can be passed straight to the API.\n # Return the response body for error output, logging, etc.\n return api.post(\"/environments/#{id}/add_instances\", :request => request)\n end", "def create_vm\n if new_resource.clone\n clone_vm\n else\n data = {\n vmid: vmid,\n bootdisk: 'virtio0',\n cores: INSTANCE_SIZE[new_resource.size]['cpu'],\n memory: INSTANCE_SIZE[new_resource.size]['memory'],\n ide2: \"#{new_resource.cdrom},media=cdrom\",\n numa: (new_resource.numa ? 1 : 0),\n ostype: get_type(new_resource.ostype),\n sockets: 1,\n virtio0: \"#{new_resource.storage}:/vm-#{vmid}-disk-1.qcow2,size=#{new_resource.disk}\"\n }.merge(new_resource.net)\n data.merge(hugepages: new_resource.hugepages) if new_resource.hugepages\n api.post(\"/nodes/#{new_resource.host}/qemu\", data)\n end\nend", "def server_create(server_name, template)\n # calculate instance id\n Puppet.debug \"template keys => \" + JSON.pretty_generate(template)\n\n server_id, server_host = ::Pinas::Common.extract_instance_id_from(server_name)\n\n # 1. setup the default options\n options = {\n :name => server_name,\n :flavor_ref => get_flavor(template[:flavor_name]), # For Openstack provider\n :image_ref => get_image(template[:image_name]), # For Openstack provider\n :flavor_id => get_flavor(template[:flavor_name]), # For HPCloud provider\n :image_id => get_image(template[:image_name]), # For HPCloud provider\n :key_name => template[:key_name],\n :security_groups => template[:security_groups],\n }\n Puppet.debug \"setup default options = >\" + JSON.pretty_generate(options)\n # 2. setup the meta data/user data for the server, for boot hooks\n begin\n options[:metadata] = meta_to_hash(ERB.new(template[:meta_data]).result(binding)) if template.has_key?(:meta_data)\n rescue Exception => e\n Puppet.crit \"servers.create in running erb for :metadata, Error: #{e}\"\n raise Puppet::Error, \"Error : #{e}\"\n end\n begin\n options[:user_data] = ERB.new(File.read(template[:user_data])).result(binding) if template.has_key?(:user_data)\n rescue Exception => e\n Puppet.crit \"servers.create in running erb for :user_data, Error: #{e}\"\n raise Puppet::Error, \"Error : #{e}\"\n end\n Puppet.debug \"added metadata and user_data\"\n Puppet.debug \"has network_name key ? #{template.has_key?(:network_name)}\"\n Puppet.debug \"network class => #{network.class}\"\n Puppet.debug \"template[:network_name] => #{template[:network_name]}\"\n Puppet.debug \"template[:network_name] => #{template['network_name']}\"\n # 3. get the network uuid and name\n if @network != nil and template.has_key?(:network_name) and template[:network_name] != ''\n Puppet.debug \"adding network #{template[:network_name]}\"\n networks = Array.new\n nics = Array.new\n nics << get_networkid(template[:network_name])\n # nics << template[:network_name]\n Puppet.debug \"working on nics => #{nics}.\"\n begin\n nics.each do |net|\n Puppet.debug \"working on net => #{net}\"\n network = find_match(@network.networks, net)\n networks.push('net_id' => network.id) if network\n end\n options[:nics] = networks\n rescue Exception => e\n raise Puppet::Error, \"Problem assigning nics, #{e}\"\n end\n Puppet.debug \"after options, got = >\" + JSON.pretty_generate(options)\n end\n # 4. create new server and wait for it to be ready.\n # TODO: implement retryable and wait for code. need to confirm we have a timeout in fog.\n # server = @compute.servers.create(options)\n # retryable(on: Timeout::Error, tries: 200) do\n # begin\n # server.wait_for(30) { ready? }\n # rescue RuntimeError, Fog::Errors::TimeoutError => e\n # end\n # end\n Puppet.debug \"attempting to create server #{server_name}\"\n new_server = nil\n begin\n new_server = @compute.servers.create(options)\n new_server.wait_for { ready?}\n new_server.wait_for { !addresses.nil? }\n rescue Exception => e\n Puppet.crit \"servers.create Error: #{e}\"\n raise Puppet::Error, \"Error : #{e}\"\n end\n\n Puppet.notice \"server created #{server_name} on net #{template[:network_name]} \"\n begin\n newserver_ip_assign(new_server)\n rescue Exception => e\n Puppet.crit \"server_ip_assign Error: #{e}\"\n raise Puppet::Error, \"Error : #{e}\"\n end\n\n end", "def create\n @tech_serv = TechServ.new(tech_serv_params)\n\n respond_to do |format|\n if @tech_serv.save\n format.html { redirect_to [:admin, @tech_serv], notice: '技术服务创建成功.' }\n format.json { render action: 'show', status: :created, location: @tech_serv }\n else\n format.html { render action: 'new' }\n format.json { render json: @tech_serv.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @service = Service.create(service_params)\n end", "def create_instance project_id:, instance_id:\n # [START spanner_create_instance]\n # project_id = \"Your Google Cloud project ID\"\n # instance_id = \"Your Spanner instance ID\"\n\n require \"google/cloud/spanner\"\n require \"google/cloud/spanner/admin/instance\"\n\n instance_admin_client = Google::Cloud::Spanner::Admin::Instance.instance_admin\n\n project_path = instance_admin_client.project_path project: project_id\n instance_path = instance_admin_client.instance_path project: project_id, instance: instance_id\n instance_config_path = instance_admin_client.instance_config_path project: project_id, instance_config: \"regional-us-central1\"\n\n job = instance_admin_client.create_instance parent: project_path,\n instance_id: instance_id,\n instance: { name: instance_path,\n config: instance_config_path,\n display_name: instance_id,\n node_count: 2,\n labels: { cloud_spanner_samples: \"true\" } }\n\n puts \"Waiting for create instance operation to complete\"\n\n job.wait_until_done!\n\n if job.error?\n puts job.error\n else\n puts \"Created instance #{instance_id}\"\n end\n # [END spanner_create_instance]\nend", "def call\n # Update service and update context\n self.service = Entities::Service.find_by_system_name(remote: threescale_client,\n system_name: service_system_name)\n if service.nil?\n # Create service and update context\n self.service = Entities::Service.create(remote: threescale_client,\n service_params: service_settings)\n logger.info \"Created service id: #{service.id}, name: #{service_name}\"\n else\n service.update(service_settings)\n logger.info \"Updated service id: #{service.id}, name: #{service_name}\"\n end\n\n report['id'] = service.id\n report['system_name'] = service.system_name\n report['name'] = service.name\n report['backend_version'] = api_spec.service_backend_version\n end", "def start\n debug \"Call 'start' for Pacemaker service '#{name}' on node '#{hostname}'\"\n disable_basic_service_on_action :start\n\n enable unless primitive_is_managed? name\n\n if pacemaker_options[:cleanup_on_start]\n if not pacemaker_options[:cleanup_only_if_failures] or primitive_has_failures? name, hostname\n cleanup\n end\n end\n\n if pacemaker_options[:add_location_constraint]\n service_location_add full_name, hostname unless service_location_exists? full_name, hostname\n end\n\n if primitive_is_multistate? name\n service_start_mode pacemaker_options[:start_mode_multistate]\n elsif primitive_is_clone? name\n service_start_mode pacemaker_options[:start_mode_clone]\n else\n service_start_mode pacemaker_options[:start_mode_simple]\n end\n\n debug cluster_debug_report \"#{@resource} start\"\n end", "def deploy(id, host, xml_text, lcm_state, deploy_id)\n # Restore if we need to\n if lcm_state != \"BOOT\" && lcm_state != \"BOOT_FAILURE\"\n restore(deploy_id)\n return deploy_id\n end\n\n # Otherwise deploy the VM\n\n begin\n ec2_info = get_deployment_info(host, xml_text)\n rescue Exception => e\n raise e\n end\n\n load_default_template_values\n\n if !ec2_value(ec2_info, 'AMI')\n raise \"Cannot find AMI in deployment file\"\n end\n\n opts = generate_options(:run, ec2_info, {\n :min_count => 1,\n :max_count => 1})\n\n # The OpenNebula context will be only included if not USERDATA\n # is provided by the user\n if !ec2_value(ec2_info, 'USERDATA')\n xml = OpenNebula::XMLElement.new\n xml.initialize_xml(xml_text, @provision_type == :host ? 'HOST' : 'VM')\n\n if xml.has_elements?('TEMPLATE/CONTEXT')\n # if requested, we generated cloud-init compatible data\n if ec2_value(ec2_info, 'CLOUD_INIT') =~ /^(yes|true)$/i\n context_str = generate_cc(xml, 'TEMPLATE/CONTEXT')\n else\n # Since there is only 1 level ',' will not be added\n context_str = xml.template_like_str('TEMPLATE/CONTEXT')\n\n if xml['TEMPLATE/CONTEXT/TOKEN'] == 'YES'\n # TODO use OneGate library\n token_str = generate_onegate_token(xml)\n if token_str\n context_str << \"\\nONEGATE_TOKEN=\\\"#{token_str}\\\"\"\n end\n end\n end\n\n userdata_key = EC2[:run][:args][\"USERDATA\"][:opt]\n opts[userdata_key] = Base64.encode64(context_str)\n end\n end\n\n instances = @ec2.create_instances(opts)\n instance = instances.first\n\n start_time = Time.now\n\n while Time.now - start_time < @state_change_timeout\n begin\n break if instance.exists?\n rescue => e\n OpenNebula::log_error(\"RESCUE: #{e.inspect}\")\n end\n\n sleep 2\n end\n\n tags = generate_options(:tags, ec2_info)[:tags] || {}\n\n tag_array = []\n tags.each{ |key,value|\n tag_array << {\n :key => key,\n :value => value\n }\n }\n\n instance.create_tags(:tags => tag_array) if tag_array.length > 0\n\n elastic_ip = ec2_value(ec2_info, 'ELASTICIP')\n\n wait_state('running', instance.id)\n\n if elastic_ip\n\n if elastic_ip.match(Resolv::IPv4::Regex)\n address_key = :public_ip\n else\n address_key = :allocation_id\n end\n\n address = {\n :instance_id => instance.id,\n address_key => elastic_ip\n }\n\n @ec2.client.associate_address(address)\n end\n\n if @provision_type == :host\n instance.create_tags(tags: [{\n key: 'Name',\n value: host['//HOST/TEMPLATE/PROVISION/HOSTNAME']\n },{\n key: 'ONE_HOST_ID',\n value: 'TODO'\n }])\n else\n instance.create_tags(tags: [{\n key: 'ONE_ID',\n value: id\n }])\n end\n\n puts(instance.id)\n end" ]
[ "0.5966708", "0.5942072", "0.57729286", "0.5761244", "0.5721337", "0.56805056", "0.56785", "0.5611529", "0.5593497", "0.55571204", "0.5545514", "0.55265534", "0.54787594", "0.547161", "0.5469635", "0.5414918", "0.5377364", "0.5366835", "0.5365857", "0.5330026", "0.52807426", "0.5213805", "0.52121437", "0.52099836", "0.52098954", "0.52089155", "0.51838696", "0.51812506", "0.5169881", "0.5169322", "0.5154237", "0.51484066", "0.5147955", "0.5145149", "0.51359206", "0.5128676", "0.51215565", "0.51188076", "0.5112452", "0.51117074", "0.510633", "0.51049495", "0.5082782", "0.50798464", "0.50725496", "0.50705254", "0.5065784", "0.5059393", "0.5054563", "0.5053797", "0.50476557", "0.50473636", "0.5043863", "0.503217", "0.5029017", "0.5024421", "0.5024257", "0.5020483", "0.4998035", "0.49857104", "0.49855745", "0.49820104", "0.4981916", "0.49758676", "0.4975084", "0.4965129", "0.4958163", "0.4957547", "0.4957095", "0.49525255", "0.4951802", "0.49503034", "0.4942069", "0.49333388", "0.4927079", "0.49247357", "0.49242157", "0.49240592", "0.4911053", "0.49040028", "0.48960388", "0.48955616", "0.48900965", "0.48840144", "0.488383", "0.48820594", "0.48760706", "0.48738527", "0.48727754", "0.48718324", "0.4870541", "0.48638284", "0.4861212", "0.4856551", "0.48552194", "0.48454356", "0.48432195", "0.48363066", "0.48355147", "0.48263288" ]
0.50953096
42
Create Tier1 service instance endpoint Create Tier1 Service instance endpoint.
def patch_tier1_service_instance_endpoint(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {}) patch_tier1_service_instance_endpoint_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts) nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_tier1_service_instance_endpoint_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint' is set\n if @api_client.config.client_side_validation && service_instance_endpoint.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_instance_endpoint)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInstanceEndpoint')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_service_instance_endpoint_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_tier1_service_instance_endpoint_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_endpoint' is set\n if @api_client.config.client_side_validation && service_instance_endpoint.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_instance_endpoint)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInstanceEndpoint')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_service_instance_endpoint\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_tier1_0_with_http_info(tier_1_id, tier1, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1_0\"\n end\n # verify the required parameter 'tier1' is set\n if @api_client.config.client_side_validation && tier1.nil?\n fail ArgumentError, \"Missing the required parameter 'tier1' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(tier1)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#create_or_replace_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_tier1_with_http_info(tier_1_id, tier1, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1\"\n end\n # verify the required parameter 'tier1' is set\n if @api_client.config.client_side_validation && tier1.nil?\n fail ArgumentError, \"Missing the required parameter 'tier1' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(tier1)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#create_or_replace_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'policy_service_instance' is set\n if @api_client.config.client_side_validation && policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n super(@@service)\n end", "def create_tier1_service_interface_0_with_http_info(tier_1_id, locale_service_id, interface_id, service_interface, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface_0\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface_0\"\n end\n # verify the required parameter 'service_interface' is set\n if @api_client.config.client_side_validation && service_interface.nil?\n fail ArgumentError, \"Missing the required parameter 'service_interface' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_interface)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#create_tier1_service_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_tier1_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance\"\n end\n # verify the required parameter 'policy_service_instance' is set\n if @api_client.config.client_side_validation && policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_tier1_service_interface_with_http_info(tier_1_id, locale_service_id, interface_id, service_interface, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface\"\n end\n # verify the required parameter 'service_interface' is set\n if @api_client.config.client_side_validation && service_interface.nil?\n fail ArgumentError, \"Missing the required parameter 'service_interface' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_interface)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#create_tier1_service_interface\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_service\n super.tap do |service_template|\n service_template.cookbook('poise-service')\n create_monit_config\n end\n end", "def create\n @t1 = T1.new(params[:t1])\n\n respond_to do |format|\n if @t1.save\n flash[:notice] = 'T1 was successfully created.'\n format.html { redirect_to(@t1) }\n format.xml { render :xml => @t1, :status => :created, :location => @t1 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @t1.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create_or_replace_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port_0\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port_0\"\n end\n # verify the required parameter 'port_id' is set\n if @api_client.config.client_side_validation && port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port_0\"\n end\n # verify the required parameter 'segment_port' is set\n if @api_client.config.client_side_validation && segment_port.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_port' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(segment_port)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentPort')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#create_or_replace_tier1_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port\"\n end\n # verify the required parameter 'port_id' is set\n if @api_client.config.client_side_validation && port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port\"\n end\n # verify the required parameter 'segment_port' is set\n if @api_client.config.client_side_validation && segment_port.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_port' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(segment_port)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentPort')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#create_or_replace_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port\"\n end\n # verify the required parameter 'port_id' is set\n if @api_client.config.client_side_validation && port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port\"\n end\n # verify the required parameter 'segment_port' is set\n if @api_client.config.client_side_validation && segment_port.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_port' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(segment_port)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentPort')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#create_or_replace_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def new\n @service = Service.new\n\n # If a valid type is received, apply to the host to create.\n check_priority_param\n @service.priority = @priority if([email protected]?)\n\n # Add custom views paths\n prepend_view_path \"app/views/services\"\n prepend_view_path \"lib/probes/#{@service.probe}/views\"\n\n respond_to do |format|\n format.html\n end\n end", "def new\n @service = Service.new\n end", "def create_service\n # Check signals here to be nice and abort early if possible.\n check_signals!\n # Enable automatically creates the service with Runit.\n directory \"/var/log/#{new_resource.service_name}\" do\n owner 'root'\n group 'root'\n mode '700'\n end\n end", "def create_tier1_service_instance_endpoint_0(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n data, _status_code, _headers = create_tier1_service_instance_endpoint_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts)\n data\n end", "def create\n @service = Service.create(service_params)\n end", "def start\n service.pool_action uuid, :create\n end", "def create_or_replace_tier1_locale_services_0_with_http_info(tier_1_id, locale_services_id, locale_services, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services_0\"\n end\n # verify the required parameter 'locale_services' is set\n if @api_client.config.client_side_validation && locale_services.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(locale_services)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#create_or_replace_tier1_locale_services_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n\n service= params[:connector][:service]\n\n case service\n when 'Scanner'\n Scanner.connect(params[:connector])\n when 'Converter'\n Converter.connect(params[:connector])\n sleep(0.5) ##just to avoid to much going on in parallel, should not be needed, just better\n Converter.run_conversion(Page.for_batch_conversion)\n when 'Hardware'\n Hardware.connect(params[:connector])\n sleep(0.5)\n Hardware.blink_ok_status_led\n Hardware.watch_scanner_button_on\n when 'TouchSwitch'\n TouchSwitch.connect(params[:connector])\n else\n raise \"Create Connection with unkown service: #{service}\"\n end\n\n push_app_status\n head :ok\n end", "def create_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'byod_policy_service_instance' is set\n if @api_client.config.client_side_validation && byod_policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'byod_policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(byod_policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_byod_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_patch_tier1_l2_vpn_service_0_with_http_info(tier_1_id, locale_service_id, service_id, l2_vpn_service, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'service_id' is set\n if @api_client.config.client_side_validation && service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'l2_vpn_service' is set\n if @api_client.config.client_side_validation && l2_vpn_service.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_vpn_service' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/l2vpn-services/{service-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-id' + '}', service_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_vpn_service)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi#create_or_patch_tier1_l2_vpn_service_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_tier1_locale_services_with_http_info(tier_1_id, locale_services_id, locale_services, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services\"\n end\n # verify the required parameter 'locale_services' is set\n if @api_client.config.client_side_validation && locale_services.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(locale_services)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#create_or_replace_tier1_locale_services\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def service_create(name, display_name, executable_on_host,startup=2)\n\t\tif session_has_services_depend?\n\t\t\tmeterpreter_service_create(name, display_name, executable_on_host,startup)\n\t\telse\n\t\t\tshell_service_create(name, display_name, executable_on_host,startup)\n\t\tend\n\tend", "def patch_tier1_service_instance_endpoint_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint' is set\n if @api_client.config.client_side_validation && service_instance_endpoint.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_instance_endpoint)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#patch_tier1_service_instance_endpoint_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @idti_service = IdtiService.new(idti_service_params)\n\n respond_to do |format|\n if @idti_service.save\n format.html { redirect_to @idti_service, notice: 'Idti service was successfully created.' }\n format.json { render :show, status: :created, location: @idti_service }\n else\n format.html { render :new }\n format.json { render json: @idti_service.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_tier1_service_instance_endpoint(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n data, _status_code, _headers = create_tier1_service_instance_endpoint_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts)\n data\n end", "def create_service_instance_endpoint_with_http_info(tier_0_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint ...'\n end\n # verify the required parameter 'tier_0_id' is set\n if @api_client.config.client_side_validation && tier_0_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_0_id' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_endpoint' is set\n if @api_client.config.client_side_validation && service_instance_endpoint.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint\"\n end\n # resource path\n local_var_path = '/global-infra/tier-0s/{tier-0-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-0-id' + '}', tier_0_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_instance_endpoint)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInstanceEndpoint')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi#create_service_instance_endpoint\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_service_instance(name, space_guid, service_plan_id)\n service_plan_instance = CFoundry::V2::ServicePlan.new(service_plan_id, @client)\n service_instance = @client.managed_service_instance\n service_instance.name = name\n service_instance.service_plan = service_plan_instance\n service_instance.space = @client.space(space_guid)\n service_instance.create!\n service_instance\n end", "def patch_tier1_0_with_http_info(tier_1_id, tier1, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.patch_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.patch_tier1_0\"\n end\n # verify the required parameter 'tier1' is set\n if @api_client.config.client_side_validation && tier1.nil?\n fail ArgumentError, \"Missing the required parameter 'tier1' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.patch_tier1_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(tier1)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#patch_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port_0\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port_0\"\n end\n # verify the required parameter 'port_id' is set\n if @api_client.config.client_side_validation && port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentPort')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#get_tier1_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @servicetype = Servicetype.new(params[:servicetype])\n\n respond_to do |format|\n if @servicetype.save\n format.html { redirect_to @servicetype, notice: 'Servicetype was successfully created.' }\n format.json { render json: @servicetype, status: :created, location: @servicetype }\n else\n format.html { render action: \"new\" }\n format.json { render json: @servicetype.errors, status: :unprocessable_entity }\n end\n end\n end", "def run\n super\n opt_port = _get_option \"port\"\n opt_protocol = _get_option \"protocol\"\n _create_network_service_entity(@entity,opt_port,opt_protocol,{})\n end", "def create\n submenu_item 'services-new'\n @service = Service.new(params[:service])\n @service_type = @service.type\n service_param\n\n @service.tenant_id = current_user.tenant_id\n\n # service_params = Service.extract_params(params[:service])\n # service_params = Service.extract_thresholds(service_params)\n # @service = Service.new(service_params)\n\n respond_to do |format|\n if @service.save\n flash[:notice] = \"#{@service.name}创建成功\"\n format.html { redirect_to(@service) }\n else\n dictionary\n format.html { render :action => \"new\" }\n end\n end\n end", "def create_service_instance_endpoint_0_with_http_info(tier_0_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint_0 ...'\n end\n # verify the required parameter 'tier_0_id' is set\n if @api_client.config.client_side_validation && tier_0_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_0_id' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint' is set\n if @api_client.config.client_side_validation && service_instance_endpoint.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint_0\"\n end\n # resource path\n local_var_path = '/infra/tier-0s/{tier-0-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-0-id' + '}', tier_0_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_instance_endpoint)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInstanceEndpoint')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi#create_service_instance_endpoint_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def newTransport\n\n end", "def create_server\n\n end", "def create_service(data=nil)\n if (!data.blank? && data.is_a?(Hash))\n @service = Service.create(data)\n else\n @service = Service.create(:name => \"Test Service #{rand(1..1000)}\", :description => \"Test service description.\", :active => true, :probe => \"dummy\", :probe_config => {:value => 1}, :interval => 60, :clean_interval => 86400, :priority => Service::PRIORITY_NORMAL, :resume => :mean_value)\n end\n end", "def create_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'byod_policy_service_instance' is set\n if @api_client.config.client_side_validation && byod_policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'byod_policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(byod_policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_byod_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_tier1_interface_0_with_http_info(tier_1_id, locale_services_id, interface_id, tier1_interface, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_or_replace_tier1_interface_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_or_replace_tier1_interface_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_or_replace_tier1_interface_0\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_or_replace_tier1_interface_0\"\n end\n # verify the required parameter 'tier1_interface' is set\n if @api_client.config.client_side_validation && tier1_interface.nil?\n fail ArgumentError, \"Missing the required parameter 'tier1_interface' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_or_replace_tier1_interface_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}/interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(tier1_interface)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1Interface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#create_or_replace_tier1_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_tier1_service_interface(tier_1_id, locale_service_id, interface_id, service_interface, opts = {})\n data, _status_code, _headers = create_tier1_service_interface_with_http_info(tier_1_id, locale_service_id, interface_id, service_interface, opts)\n data\n end", "def create\n @servicetype = Servicetype.new(params[:servicetype])\n\n respond_to do |format|\n if @servicetype.save\n format.html { redirect_to @servicetype, :notice => 'Servicetype was successfully created.' }\n format.json { render :json => @servicetype, :status => :created, :location => @servicetype }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @servicetype.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create_or_replace_tier1_interface_with_http_info(tier_1_id, locale_services_id, interface_id, tier1_interface, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_or_replace_tier1_interface ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_or_replace_tier1_interface\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_or_replace_tier1_interface\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_or_replace_tier1_interface\"\n end\n # verify the required parameter 'tier1_interface' is set\n if @api_client.config.client_side_validation && tier1_interface.nil?\n fail ArgumentError, \"Missing the required parameter 'tier1_interface' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_or_replace_tier1_interface\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}/interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(tier1_interface)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1Interface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#create_or_replace_tier1_interface\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_tier1_service_instance_endpoint_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_endpoint' is set\n if @api_client.config.client_side_validation && service_instance_endpoint.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_instance_endpoint)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#patch_tier1_service_instance_endpoint\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_tier1_service_interface_0(tier_1_id, locale_service_id, interface_id, service_interface, opts = {})\n data, _status_code, _headers = create_tier1_service_interface_0_with_http_info(tier_1_id, locale_service_id, interface_id, service_interface, opts)\n data\n end", "def create_or_replace_tier1_0(tier_1_id, tier1, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_0_with_http_info(tier_1_id, tier1, opts)\n data\n end", "def start_service\n DRb.start_service \n @space = Rinda::TupleSpaceProxy.new(DRbObject.new(nil, @uri))\n end", "def create(type)\n @call_params[:type] = type\n @client.call(self.class, __callee__.to_s, @call_params)\n end", "def create_or_patch_tier1_l2_vpn_service_with_http_info(tier_1_id, locale_service_id, service_id, l2_vpn_service, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service\"\n end\n # verify the required parameter 'service_id' is set\n if @api_client.config.client_side_validation && service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service\"\n end\n # verify the required parameter 'l2_vpn_service' is set\n if @api_client.config.client_side_validation && l2_vpn_service.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_vpn_service' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/l2vpn-services/{service-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-id' + '}', service_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_vpn_service)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi#create_or_patch_tier1_l2_vpn_service\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_tier1_with_http_info(tier_1_id, tier1, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.patch_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.patch_tier1\"\n end\n # verify the required parameter 'tier1' is set\n if @api_client.config.client_side_validation && tier1.nil?\n fail ArgumentError, \"Missing the required parameter 'tier1' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.patch_tier1\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(tier1)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#patch_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_instance\n create_instances(1).first\n end", "def create_or_update_tier1_l2_vpn_service_0_with_http_info(tier_1_id, locale_service_id, service_id, l2_vpn_service, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'service_id' is set\n if @api_client.config.client_side_validation && service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'l2_vpn_service' is set\n if @api_client.config.client_side_validation && l2_vpn_service.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_vpn_service' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/l2vpn-services/{service-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-id' + '}', service_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_vpn_service)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2VPNService')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi#create_or_update_tier1_l2_vpn_service_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def add_tier\n begin\n with_transaction do\n Tier.create!(\n name: params[:name],\n stage: params[:stage],\n pipeline_id: @pipeline.id\n )\n\n render json: tiers_for_pipeline_view\n end\n rescue Exception => e\n error = \"#{ConfluxErrors::TierCreationFailed} - #{e}\"\n logger.error { error }\n render json: { message: error }, status: 500\n end\n end", "def create\n @taxi_sevice = TaxiSevice.new(taxi_sevice_params)\n\n respond_to do |format|\n if @taxi_sevice.save\n format.html { redirect_to action: \"index\" }\n else\n format.html { render :new }\n format.json { render json: @taxi_sevice.errors, status: :unprocessable_entity }\n end\n end\n end", "def get_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port\"\n end\n # verify the required parameter 'port_id' is set\n if @api_client.config.client_side_validation && port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentPort')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#get_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def tier1_gateway_reprocess_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.tier1_gateway_reprocess_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.tier1_gateway_reprocess_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}?action=reprocess'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#tier1_gateway_reprocess_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_url_template(rest_method)\n ServiceCatalographer::Util.generate_rest_endpoint_url_template(rest_method)\n end", "def get_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port\"\n end\n # verify the required parameter 'port_id' is set\n if @api_client.config.client_side_validation && port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentPort')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#get_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_gen1_account(name) \n\n account_create = {\n \"location\"=> \"centralus\",\n \"tags\"=> {\n \"test_key\"=> \"test_value\"\n },\n \"identity\"=> {\n \"type\"=> \"SystemAssigned\"\n },\n \"properties\"=> {\n \"encryptionState\"=> \"Enabled\",\n \"encryptionConfig\"=> {\n \"type\"=> \"ServiceManaged\",\n },\n \"firewallState\"=> \"Disabled\",\n \"firewallRules\"=> [\n \n ],\n \"trustedIdProviderState\"=> \"Disabled\",\n \"trustedIdProviders\"=> [\n \n ],\n \n \"newTier\"=> \"Consumption\",\n \"firewallAllowAzureIps\"=> \"Enabled\"\n }\n }\n\n response = HTTParty.put(\"https://management.azure.com/subscriptions/#{subscriptionId}/resourceGroups/#{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/#{name}?api-version=2016-11-01\", {\n\n body: account_create.to_json,\n\n headers: {\n \"Authorization\" => \"Bearer #{bearerToken}\",\n \"Content-Type\" => 'application/json', \n \"Accept\" => '*/*',\n \"Cache-Control\" => 'no-cache',\n \"Connection\" => 'keep-alive',\n \"cache-control\" => 'no-cache'\n },\n \n verify: true,\n })\n\n return JSON.parse response.read_body\n end", "def create_or_replace_tier1(tier_1_id, tier1, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_with_http_info(tier_1_id, tier1, opts)\n data\n end", "def start_service(*args)\n end", "def call\n # Update service and update context\n self.service = Entities::Service.find_by_system_name(remote: threescale_client,\n system_name: service_system_name)\n if service.nil?\n # Create service and update context\n self.service = Entities::Service.create(remote: threescale_client,\n service_params: service_settings)\n logger.info \"Created service id: #{service.id}, name: #{service_name}\"\n else\n service.update(service_settings)\n logger.info \"Updated service id: #{service.id}, name: #{service_name}\"\n end\n\n report['id'] = service.id\n report['system_name'] = service.system_name\n report['name'] = service.name\n report['backend_version'] = api_spec.service_backend_version\n end", "def create\n @payment_tier = PaymentTier.new(payment_tier_params)\n authorize! :manage, @payment_tier\n\n respond_to do |format|\n if @payment_tier.save\n format.html { redirect_to @payment_tier, notice: 'Payment tier was successfully created.' }\n format.json { render :show, status: :created, location: @payment_tier }\n else\n format.html { render :new }\n format.json { render json: @payment_tier.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_trip\n # Only attempt to create trip if all the necessary pieces are there\n return false unless @itinerary && @trip && @service && @user\n \n label = request_label(:book, trip_id)\n \n @http_request_bundler.add(\n label, \n @url + \"/create_trip\", \n :post,\n head: headers,\n body: body_for_booking(@booking_options).to_json\n ).response!(label)\n end", "def create_trip trip, driver_name\n\t\tif @drivers.has_key? driver_name\t\t\t\n\t\t\t@drivers[driver_name].add_trip trip\n\t\telse\n\t\t\tputs \"No driver #{driver_name} registered, created a new driver\"\n\t\t\tdriver = self.create_driver driver_name\n\t\t\tdriver.add_trip trip\n\t\tend\t\n\tend", "def instantiate_service\n @service = ContestService.new\n end", "def service_endpoint; end", "def service_endpoint; end", "def tier1_gateway_reprocess_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.tier1_gateway_reprocess ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.tier1_gateway_reprocess\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}?action=reprocess'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#tier1_gateway_reprocess\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @tb_servicio = TbServicio.new(tb_servicio_params)\n\n respond_to do |format|\n if @tb_servicio.save\n format.html { redirect_to @tb_servicio, notice: 'Tb servicio was successfully created.' }\n format.json { render :show, status: :created, location: @tb_servicio }\n else\n format.html { render :new }\n format.json { render json: @tb_servicio.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_carrier_service\n puts \" ____________ CREATE CARRIER SERVICE ______\"\n connectApi\n ShopifyAPI::CarrierService.create({\n \"carrier_service\": {\n \"name\": \"Livraison à domicile avec Urbit\",\n \"callback_url\": \"https://conticini-urbit.herokuapp.com/shipping\",\n \"service_discovery\": true\n }\n })\n end", "def service_type_name\n \"REST\"\n end", "def create\n service = current_account.services.build\n create_service = ServiceCreator.new(service: service)\n create_service.call(service_params.to_h)\n service.reload if service.persisted? # It has been touched\n respond_with(service)\n end", "def create(name)\n configure [\"interface #{name}\", 'no ip address', 'switchport']\n end", "def create_or_update_tier1_l2_vpn_service_with_http_info(tier_1_id, locale_service_id, service_id, l2_vpn_service, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service\"\n end\n # verify the required parameter 'service_id' is set\n if @api_client.config.client_side_validation && service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service\"\n end\n # verify the required parameter 'l2_vpn_service' is set\n if @api_client.config.client_side_validation && l2_vpn_service.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_vpn_service' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/l2vpn-services/{service-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-id' + '}', service_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_vpn_service)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2VPNService')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi#create_or_update_tier1_l2_vpn_service\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @v1_provider_operation = V1::ProviderOperation.new(v1_provider_operation_params)\n\n respond_to do |format|\n if @v1_provider_operation.save\n format.html { redirect_to @v1_provider_operation, notice: 'Provider operation was successfully created.' }\n format.json { render :show, status: :created, location: @v1_provider_operation }\n else\n format.html { render :new }\n format.json { render json: @v1_provider_operation.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tech_serv = TechServ.new(tech_serv_params)\n\n respond_to do |format|\n if @tech_serv.save\n format.html { redirect_to [:admin, @tech_serv], notice: '技术服务创建成功.' }\n format.json { render action: 'show', status: :created, location: @tech_serv }\n else\n format.html { render action: 'new' }\n format.json { render json: @tech_serv.errors, status: :unprocessable_entity }\n end\n end\n end", "def vertx_start\n @consul_client.request(:PUT, \"/v1/agent/service/register\") { |response|\n if response.status_code() == 200\n puts \"Registered foo service with Consul\"\n else \n puts \"Failed to register foo service with Consul\"\n end\n }.end({\n \"ID\" => \"foo_service\",\n \"Name\" => \"foo\",\n \"Tags\" => [\n \"service\"\n ],\n \"Port\" => SERVICE_PORT\n }.to_json)\nend", "def create\n service = current_account.services.build\n create_service = ServiceCreator.new(service: service)\n create_service.call(service_params)\n service.reload if service.persisted? # It has been touched\n respond_with(service)\n end", "def create\n @approximate_service = ApproximateService.new(params[:approximate_service])\n\n respond_to do |format|\n if @approximate_service.save\n format.html { redirect_to(@approximate_service, :notice => 'ApproximateService was successfully created.') }\n format.xml { render :xml => @approximate_service, :status => :created, :location => @approximate_service }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @approximate_service.errors, :status => :unprocessable_entity }\n end\n end\n end", "def start_service\n object = DBusObject.new(@main, self)\n service = @bus.request_service(SERVICE)\n service.export object\n end", "def read_tier1_policy_service_instance_endpoint_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInstanceEndpoint')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance_endpoint_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.delete_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.delete_tier1_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#delete_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create(name, config)\n # @step: validate the user defined options\n validate(config)\n\n # @step: create the infrastructure deployment\n begin\n provision_aks(name, config)\n rescue StandardError => e\n raise InfrastructureError, \"failed to provision cluster, error: #{e}\"\n end\n\n # @step: bootstrap the cluster\n begin\n provision_cluster(name, config)\n rescue StandardError => e\n raise InfrastructureError, \"failed to bootstrap cluster, error: #{e}\"\n end\n end", "def generate\n\t\ttemplate('service.tt', \"lib/services/#{name.underscore}_service.rb\")\n\tend", "def create_driver\n parse_service_description\n\n @driver = SOAP::RPC::Driver.new @control_url, @type\n\n mapping_registry = UPnP::SOAPRegistry.new\n\n @actions.each do |name, arguments|\n soapaction = \"#{@type}##{name}\"\n qname = XSD::QName.new @type, name\n\n # TODO map ranges, enumerations\n arguments = arguments.map do |direction, arg_name, variable|\n type, = @variables[variable]\n\n schema_name = XSD::QName.new nil, arg_name\n\n mapping_registry.register :class => type, :schema_name => schema_name\n\n [direction, arg_name, @variables[variable].first]\n end\n\n @driver.proxy.add_rpc_method qname, soapaction, name, arguments\n @driver.send :add_rpc_method_interface, name, arguments\n end\n\n @driver.mapping_registry = mapping_registry\n\n @variables = nil\n end", "def delete_tier1_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.delete_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.delete_tier1\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#delete_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n feature_enable unless feature_enabled\n X__RESOURCE_NAME__X_router\n end", "def create\n @tourist_site_app_service = TouristSiteAppService.new(tourist_site_app_service_params)\n\n respond_to do |format|\n if @tourist_site_app_service.save\n format.html { redirect_to @tourist_site_app_service, notice: 'Tourist site app service was successfully created.' }\n format.json { render :show, status: :created, location: @tourist_site_app_service }\n else\n format.html { render :new }\n format.json { render json: @tourist_site_app_service.errors, status: :unprocessable_entity }\n end\n end\n end", "def delete_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.delete_tier1_segment_port_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.delete_tier1_segment_port_0\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.delete_tier1_segment_port_0\"\n end\n # verify the required parameter 'port_id' is set\n if @api_client.config.client_side_validation && port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.delete_tier1_segment_port_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#delete_tier1_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_service(name, description)\n response = @client.post(\"/api/v1/services\", { \"name\" => name, \"description\" => description })\n return JSON.parse(response.body)\n end", "def create_service_by_names(name, space_guid, service_plan_name, service_type_name)\n service = @client.services.select{ |srv| srv.label == service_type_name }\n\n if service != []\n service_plan_id = @client.service_plans_by_service_guid(service.first.guid).each.find { |current_plan| current_plan.name == service_plan_name }.guid\n create_service_instance(name, space_guid, service_plan_id)\n else\n return false\n end\n end", "def create\n @port_service = PortService.new(port_service_params)\n\n respond_to do |format|\n if @port_service.save\n format.html { redirect_to @port_service, notice: 'Port service was successfully created.' }\n format.json { render :show, status: :created, location: @port_service }\n else\n format.html { render :new }\n format.json { render json: @port_service.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @method1 = Method1.new(params[:method1])\n\n respond_to do |format|\n if @method1.save\n format.html { redirect_to(@method1, :notice => 'Method1 was successfully created.') }\n format.xml { render :xml => @method1, :status => :created, :location => @method1 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @method1.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @one_time_stop = OneTimeStop.new(params[:one_time_stop])\n\n respond_to do |format|\n if @one_time_stop.save\n format.html { redirect_to @one_time_stop, notice: 'One time stop was successfully created.' }\n format.json { render json: @one_time_stop, status: :created, location: @one_time_stop }\n else\n format.html { render action: \"new\" }\n format.json { render json: @one_time_stop.errors, status: :unprocessable_entity }\n end\n end\n end", "def service(nickname, reserved, distribution, type)\n end", "def newMicroServiceType(name,abbr,style,opmode,min=1,max=1)\n\nend", "def create\n @tour_service = TourService.new(tour_service_params)\n\n respond_to do |format|\n if @tour_service.save\n\n format.html { redirect_to action:\"index\" }\n format.json { render :show, status: :created, location: @tour_service }\n else\n format.html { render :new }\n format.json { render json: @tour_service.errors, status: :unprocessable_entity }\n end\n end\n end", "def create(id, name: nil, type: :PRODUCTION, labels: nil, clusters: nil)\n end" ]
[ "0.6255446", "0.6160107", "0.59500915", "0.5949246", "0.5872546", "0.58042", "0.5798773", "0.57841635", "0.5781504", "0.5667666", "0.5664266", "0.56641316", "0.55803627", "0.55576456", "0.5546595", "0.5509095", "0.5476701", "0.5467246", "0.5462339", "0.5422024", "0.54111105", "0.5364136", "0.53586334", "0.53501445", "0.5341932", "0.5338575", "0.5320438", "0.5312692", "0.5309631", "0.53093755", "0.5303847", "0.52991974", "0.5277667", "0.5271184", "0.5266815", "0.52650434", "0.5263886", "0.52559936", "0.52557915", "0.5254452", "0.5254338", "0.52530396", "0.5251216", "0.5228382", "0.522151", "0.5209804", "0.5207137", "0.5206563", "0.520512", "0.52048296", "0.52013564", "0.5193425", "0.5189865", "0.51883996", "0.5187259", "0.5181755", "0.51797515", "0.51781917", "0.51746655", "0.51746637", "0.51708853", "0.5165582", "0.5137648", "0.5129766", "0.5126896", "0.5126864", "0.5104034", "0.5088741", "0.5088202", "0.5088202", "0.5079411", "0.50720483", "0.50702894", "0.5065637", "0.50651735", "0.50606865", "0.5052408", "0.5039189", "0.50389683", "0.5038095", "0.5035218", "0.5034029", "0.50220317", "0.50202507", "0.50130755", "0.5009951", "0.50086623", "0.50080895", "0.50061625", "0.5004094", "0.5002074", "0.50018036", "0.5000226", "0.49990404", "0.4998888", "0.49908394", "0.49897653", "0.4975731", "0.49723923", "0.4971379", "0.4968171" ]
0.0
-1
Create Tier1 service instance endpoint Create Tier1 Service instance endpoint.
def patch_tier1_service_instance_endpoint_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint ...' end # verify the required parameter 'tier_1_id' is set if @api_client.config.client_side_validation && tier_1_id.nil? fail ArgumentError, "Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint" end # verify the required parameter 'locale_service_id' is set if @api_client.config.client_side_validation && locale_service_id.nil? fail ArgumentError, "Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint" end # verify the required parameter 'service_instance_id' is set if @api_client.config.client_side_validation && service_instance_id.nil? fail ArgumentError, "Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint" end # verify the required parameter 'service_instance_endpoint_id' is set if @api_client.config.client_side_validation && service_instance_endpoint_id.nil? fail ArgumentError, "Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint" end # verify the required parameter 'service_instance_endpoint' is set if @api_client.config.client_side_validation && service_instance_endpoint.nil? fail ArgumentError, "Missing the required parameter 'service_instance_endpoint' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint" end # resource path local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(service_instance_endpoint) auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#patch_tier1_service_instance_endpoint\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_tier1_service_instance_endpoint_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint' is set\n if @api_client.config.client_side_validation && service_instance_endpoint.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_instance_endpoint)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInstanceEndpoint')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_service_instance_endpoint_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_tier1_service_instance_endpoint_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_endpoint' is set\n if @api_client.config.client_side_validation && service_instance_endpoint.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_instance_endpoint)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInstanceEndpoint')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_service_instance_endpoint\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_tier1_0_with_http_info(tier_1_id, tier1, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1_0\"\n end\n # verify the required parameter 'tier1' is set\n if @api_client.config.client_side_validation && tier1.nil?\n fail ArgumentError, \"Missing the required parameter 'tier1' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(tier1)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#create_or_replace_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_tier1_with_http_info(tier_1_id, tier1, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1\"\n end\n # verify the required parameter 'tier1' is set\n if @api_client.config.client_side_validation && tier1.nil?\n fail ArgumentError, \"Missing the required parameter 'tier1' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(tier1)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#create_or_replace_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'policy_service_instance' is set\n if @api_client.config.client_side_validation && policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n super(@@service)\n end", "def create_tier1_service_interface_0_with_http_info(tier_1_id, locale_service_id, interface_id, service_interface, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface_0\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface_0\"\n end\n # verify the required parameter 'service_interface' is set\n if @api_client.config.client_side_validation && service_interface.nil?\n fail ArgumentError, \"Missing the required parameter 'service_interface' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_interface)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#create_tier1_service_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_tier1_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance\"\n end\n # verify the required parameter 'policy_service_instance' is set\n if @api_client.config.client_side_validation && policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_tier1_service_interface_with_http_info(tier_1_id, locale_service_id, interface_id, service_interface, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface\"\n end\n # verify the required parameter 'service_interface' is set\n if @api_client.config.client_side_validation && service_interface.nil?\n fail ArgumentError, \"Missing the required parameter 'service_interface' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_interface)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#create_tier1_service_interface\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_service\n super.tap do |service_template|\n service_template.cookbook('poise-service')\n create_monit_config\n end\n end", "def create\n @t1 = T1.new(params[:t1])\n\n respond_to do |format|\n if @t1.save\n flash[:notice] = 'T1 was successfully created.'\n format.html { redirect_to(@t1) }\n format.xml { render :xml => @t1, :status => :created, :location => @t1 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @t1.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create_or_replace_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port_0\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port_0\"\n end\n # verify the required parameter 'port_id' is set\n if @api_client.config.client_side_validation && port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port_0\"\n end\n # verify the required parameter 'segment_port' is set\n if @api_client.config.client_side_validation && segment_port.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_port' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(segment_port)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentPort')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#create_or_replace_tier1_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port\"\n end\n # verify the required parameter 'port_id' is set\n if @api_client.config.client_side_validation && port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port\"\n end\n # verify the required parameter 'segment_port' is set\n if @api_client.config.client_side_validation && segment_port.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_port' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(segment_port)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentPort')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#create_or_replace_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port\"\n end\n # verify the required parameter 'port_id' is set\n if @api_client.config.client_side_validation && port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port\"\n end\n # verify the required parameter 'segment_port' is set\n if @api_client.config.client_side_validation && segment_port.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_port' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(segment_port)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentPort')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#create_or_replace_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def new\n @service = Service.new\n\n # If a valid type is received, apply to the host to create.\n check_priority_param\n @service.priority = @priority if([email protected]?)\n\n # Add custom views paths\n prepend_view_path \"app/views/services\"\n prepend_view_path \"lib/probes/#{@service.probe}/views\"\n\n respond_to do |format|\n format.html\n end\n end", "def new\n @service = Service.new\n end", "def create_service\n # Check signals here to be nice and abort early if possible.\n check_signals!\n # Enable automatically creates the service with Runit.\n directory \"/var/log/#{new_resource.service_name}\" do\n owner 'root'\n group 'root'\n mode '700'\n end\n end", "def create_tier1_service_instance_endpoint_0(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n data, _status_code, _headers = create_tier1_service_instance_endpoint_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts)\n data\n end", "def create\n @service = Service.create(service_params)\n end", "def start\n service.pool_action uuid, :create\n end", "def create_or_replace_tier1_locale_services_0_with_http_info(tier_1_id, locale_services_id, locale_services, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services_0\"\n end\n # verify the required parameter 'locale_services' is set\n if @api_client.config.client_side_validation && locale_services.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(locale_services)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#create_or_replace_tier1_locale_services_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n\n service= params[:connector][:service]\n\n case service\n when 'Scanner'\n Scanner.connect(params[:connector])\n when 'Converter'\n Converter.connect(params[:connector])\n sleep(0.5) ##just to avoid to much going on in parallel, should not be needed, just better\n Converter.run_conversion(Page.for_batch_conversion)\n when 'Hardware'\n Hardware.connect(params[:connector])\n sleep(0.5)\n Hardware.blink_ok_status_led\n Hardware.watch_scanner_button_on\n when 'TouchSwitch'\n TouchSwitch.connect(params[:connector])\n else\n raise \"Create Connection with unkown service: #{service}\"\n end\n\n push_app_status\n head :ok\n end", "def create_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'byod_policy_service_instance' is set\n if @api_client.config.client_side_validation && byod_policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'byod_policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(byod_policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_byod_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_patch_tier1_l2_vpn_service_0_with_http_info(tier_1_id, locale_service_id, service_id, l2_vpn_service, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'service_id' is set\n if @api_client.config.client_side_validation && service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'l2_vpn_service' is set\n if @api_client.config.client_side_validation && l2_vpn_service.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_vpn_service' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/l2vpn-services/{service-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-id' + '}', service_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_vpn_service)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi#create_or_patch_tier1_l2_vpn_service_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_tier1_locale_services_with_http_info(tier_1_id, locale_services_id, locale_services, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services\"\n end\n # verify the required parameter 'locale_services' is set\n if @api_client.config.client_side_validation && locale_services.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(locale_services)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#create_or_replace_tier1_locale_services\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def service_create(name, display_name, executable_on_host,startup=2)\n\t\tif session_has_services_depend?\n\t\t\tmeterpreter_service_create(name, display_name, executable_on_host,startup)\n\t\telse\n\t\t\tshell_service_create(name, display_name, executable_on_host,startup)\n\t\tend\n\tend", "def patch_tier1_service_instance_endpoint_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint' is set\n if @api_client.config.client_side_validation && service_instance_endpoint.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_instance_endpoint)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#patch_tier1_service_instance_endpoint_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @idti_service = IdtiService.new(idti_service_params)\n\n respond_to do |format|\n if @idti_service.save\n format.html { redirect_to @idti_service, notice: 'Idti service was successfully created.' }\n format.json { render :show, status: :created, location: @idti_service }\n else\n format.html { render :new }\n format.json { render json: @idti_service.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_tier1_service_instance_endpoint(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n data, _status_code, _headers = create_tier1_service_instance_endpoint_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts)\n data\n end", "def create_service_instance_endpoint_with_http_info(tier_0_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint ...'\n end\n # verify the required parameter 'tier_0_id' is set\n if @api_client.config.client_side_validation && tier_0_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_0_id' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_endpoint' is set\n if @api_client.config.client_side_validation && service_instance_endpoint.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint\"\n end\n # resource path\n local_var_path = '/global-infra/tier-0s/{tier-0-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-0-id' + '}', tier_0_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_instance_endpoint)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInstanceEndpoint')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi#create_service_instance_endpoint\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_service_instance(name, space_guid, service_plan_id)\n service_plan_instance = CFoundry::V2::ServicePlan.new(service_plan_id, @client)\n service_instance = @client.managed_service_instance\n service_instance.name = name\n service_instance.service_plan = service_plan_instance\n service_instance.space = @client.space(space_guid)\n service_instance.create!\n service_instance\n end", "def patch_tier1_0_with_http_info(tier_1_id, tier1, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.patch_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.patch_tier1_0\"\n end\n # verify the required parameter 'tier1' is set\n if @api_client.config.client_side_validation && tier1.nil?\n fail ArgumentError, \"Missing the required parameter 'tier1' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.patch_tier1_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(tier1)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#patch_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port_0\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port_0\"\n end\n # verify the required parameter 'port_id' is set\n if @api_client.config.client_side_validation && port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentPort')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#get_tier1_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @servicetype = Servicetype.new(params[:servicetype])\n\n respond_to do |format|\n if @servicetype.save\n format.html { redirect_to @servicetype, notice: 'Servicetype was successfully created.' }\n format.json { render json: @servicetype, status: :created, location: @servicetype }\n else\n format.html { render action: \"new\" }\n format.json { render json: @servicetype.errors, status: :unprocessable_entity }\n end\n end\n end", "def run\n super\n opt_port = _get_option \"port\"\n opt_protocol = _get_option \"protocol\"\n _create_network_service_entity(@entity,opt_port,opt_protocol,{})\n end", "def create\n submenu_item 'services-new'\n @service = Service.new(params[:service])\n @service_type = @service.type\n service_param\n\n @service.tenant_id = current_user.tenant_id\n\n # service_params = Service.extract_params(params[:service])\n # service_params = Service.extract_thresholds(service_params)\n # @service = Service.new(service_params)\n\n respond_to do |format|\n if @service.save\n flash[:notice] = \"#{@service.name}创建成功\"\n format.html { redirect_to(@service) }\n else\n dictionary\n format.html { render :action => \"new\" }\n end\n end\n end", "def create_service_instance_endpoint_0_with_http_info(tier_0_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint_0 ...'\n end\n # verify the required parameter 'tier_0_id' is set\n if @api_client.config.client_side_validation && tier_0_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_0_id' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint' is set\n if @api_client.config.client_side_validation && service_instance_endpoint.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint_0\"\n end\n # resource path\n local_var_path = '/infra/tier-0s/{tier-0-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-0-id' + '}', tier_0_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_instance_endpoint)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInstanceEndpoint')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi#create_service_instance_endpoint_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def newTransport\n\n end", "def create_server\n\n end", "def create_service(data=nil)\n if (!data.blank? && data.is_a?(Hash))\n @service = Service.create(data)\n else\n @service = Service.create(:name => \"Test Service #{rand(1..1000)}\", :description => \"Test service description.\", :active => true, :probe => \"dummy\", :probe_config => {:value => 1}, :interval => 60, :clean_interval => 86400, :priority => Service::PRIORITY_NORMAL, :resume => :mean_value)\n end\n end", "def create_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'byod_policy_service_instance' is set\n if @api_client.config.client_side_validation && byod_policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'byod_policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(byod_policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_byod_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_tier1_interface_0_with_http_info(tier_1_id, locale_services_id, interface_id, tier1_interface, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_or_replace_tier1_interface_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_or_replace_tier1_interface_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_or_replace_tier1_interface_0\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_or_replace_tier1_interface_0\"\n end\n # verify the required parameter 'tier1_interface' is set\n if @api_client.config.client_side_validation && tier1_interface.nil?\n fail ArgumentError, \"Missing the required parameter 'tier1_interface' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_or_replace_tier1_interface_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}/interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(tier1_interface)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1Interface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#create_or_replace_tier1_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_tier1_service_interface(tier_1_id, locale_service_id, interface_id, service_interface, opts = {})\n data, _status_code, _headers = create_tier1_service_interface_with_http_info(tier_1_id, locale_service_id, interface_id, service_interface, opts)\n data\n end", "def create\n @servicetype = Servicetype.new(params[:servicetype])\n\n respond_to do |format|\n if @servicetype.save\n format.html { redirect_to @servicetype, :notice => 'Servicetype was successfully created.' }\n format.json { render :json => @servicetype, :status => :created, :location => @servicetype }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @servicetype.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create_or_replace_tier1_interface_with_http_info(tier_1_id, locale_services_id, interface_id, tier1_interface, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_or_replace_tier1_interface ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_or_replace_tier1_interface\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_or_replace_tier1_interface\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_or_replace_tier1_interface\"\n end\n # verify the required parameter 'tier1_interface' is set\n if @api_client.config.client_side_validation && tier1_interface.nil?\n fail ArgumentError, \"Missing the required parameter 'tier1_interface' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_or_replace_tier1_interface\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}/interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(tier1_interface)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1Interface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#create_or_replace_tier1_interface\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_tier1_service_interface_0(tier_1_id, locale_service_id, interface_id, service_interface, opts = {})\n data, _status_code, _headers = create_tier1_service_interface_0_with_http_info(tier_1_id, locale_service_id, interface_id, service_interface, opts)\n data\n end", "def create_or_replace_tier1_0(tier_1_id, tier1, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_0_with_http_info(tier_1_id, tier1, opts)\n data\n end", "def start_service\n DRb.start_service \n @space = Rinda::TupleSpaceProxy.new(DRbObject.new(nil, @uri))\n end", "def create(type)\n @call_params[:type] = type\n @client.call(self.class, __callee__.to_s, @call_params)\n end", "def create_or_patch_tier1_l2_vpn_service_with_http_info(tier_1_id, locale_service_id, service_id, l2_vpn_service, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service\"\n end\n # verify the required parameter 'service_id' is set\n if @api_client.config.client_side_validation && service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service\"\n end\n # verify the required parameter 'l2_vpn_service' is set\n if @api_client.config.client_side_validation && l2_vpn_service.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_vpn_service' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/l2vpn-services/{service-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-id' + '}', service_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_vpn_service)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi#create_or_patch_tier1_l2_vpn_service\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_tier1_with_http_info(tier_1_id, tier1, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.patch_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.patch_tier1\"\n end\n # verify the required parameter 'tier1' is set\n if @api_client.config.client_side_validation && tier1.nil?\n fail ArgumentError, \"Missing the required parameter 'tier1' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.patch_tier1\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(tier1)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#patch_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_instance\n create_instances(1).first\n end", "def create_or_update_tier1_l2_vpn_service_0_with_http_info(tier_1_id, locale_service_id, service_id, l2_vpn_service, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'service_id' is set\n if @api_client.config.client_side_validation && service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'l2_vpn_service' is set\n if @api_client.config.client_side_validation && l2_vpn_service.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_vpn_service' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/l2vpn-services/{service-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-id' + '}', service_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_vpn_service)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2VPNService')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi#create_or_update_tier1_l2_vpn_service_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def add_tier\n begin\n with_transaction do\n Tier.create!(\n name: params[:name],\n stage: params[:stage],\n pipeline_id: @pipeline.id\n )\n\n render json: tiers_for_pipeline_view\n end\n rescue Exception => e\n error = \"#{ConfluxErrors::TierCreationFailed} - #{e}\"\n logger.error { error }\n render json: { message: error }, status: 500\n end\n end", "def create\n @taxi_sevice = TaxiSevice.new(taxi_sevice_params)\n\n respond_to do |format|\n if @taxi_sevice.save\n format.html { redirect_to action: \"index\" }\n else\n format.html { render :new }\n format.json { render json: @taxi_sevice.errors, status: :unprocessable_entity }\n end\n end\n end", "def get_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port\"\n end\n # verify the required parameter 'port_id' is set\n if @api_client.config.client_side_validation && port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentPort')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#get_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def tier1_gateway_reprocess_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.tier1_gateway_reprocess_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.tier1_gateway_reprocess_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}?action=reprocess'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#tier1_gateway_reprocess_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_url_template(rest_method)\n ServiceCatalographer::Util.generate_rest_endpoint_url_template(rest_method)\n end", "def get_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port\"\n end\n # verify the required parameter 'port_id' is set\n if @api_client.config.client_side_validation && port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentPort')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#get_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_gen1_account(name) \n\n account_create = {\n \"location\"=> \"centralus\",\n \"tags\"=> {\n \"test_key\"=> \"test_value\"\n },\n \"identity\"=> {\n \"type\"=> \"SystemAssigned\"\n },\n \"properties\"=> {\n \"encryptionState\"=> \"Enabled\",\n \"encryptionConfig\"=> {\n \"type\"=> \"ServiceManaged\",\n },\n \"firewallState\"=> \"Disabled\",\n \"firewallRules\"=> [\n \n ],\n \"trustedIdProviderState\"=> \"Disabled\",\n \"trustedIdProviders\"=> [\n \n ],\n \n \"newTier\"=> \"Consumption\",\n \"firewallAllowAzureIps\"=> \"Enabled\"\n }\n }\n\n response = HTTParty.put(\"https://management.azure.com/subscriptions/#{subscriptionId}/resourceGroups/#{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/#{name}?api-version=2016-11-01\", {\n\n body: account_create.to_json,\n\n headers: {\n \"Authorization\" => \"Bearer #{bearerToken}\",\n \"Content-Type\" => 'application/json', \n \"Accept\" => '*/*',\n \"Cache-Control\" => 'no-cache',\n \"Connection\" => 'keep-alive',\n \"cache-control\" => 'no-cache'\n },\n \n verify: true,\n })\n\n return JSON.parse response.read_body\n end", "def create_or_replace_tier1(tier_1_id, tier1, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_with_http_info(tier_1_id, tier1, opts)\n data\n end", "def start_service(*args)\n end", "def call\n # Update service and update context\n self.service = Entities::Service.find_by_system_name(remote: threescale_client,\n system_name: service_system_name)\n if service.nil?\n # Create service and update context\n self.service = Entities::Service.create(remote: threescale_client,\n service_params: service_settings)\n logger.info \"Created service id: #{service.id}, name: #{service_name}\"\n else\n service.update(service_settings)\n logger.info \"Updated service id: #{service.id}, name: #{service_name}\"\n end\n\n report['id'] = service.id\n report['system_name'] = service.system_name\n report['name'] = service.name\n report['backend_version'] = api_spec.service_backend_version\n end", "def create\n @payment_tier = PaymentTier.new(payment_tier_params)\n authorize! :manage, @payment_tier\n\n respond_to do |format|\n if @payment_tier.save\n format.html { redirect_to @payment_tier, notice: 'Payment tier was successfully created.' }\n format.json { render :show, status: :created, location: @payment_tier }\n else\n format.html { render :new }\n format.json { render json: @payment_tier.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_trip\n # Only attempt to create trip if all the necessary pieces are there\n return false unless @itinerary && @trip && @service && @user\n \n label = request_label(:book, trip_id)\n \n @http_request_bundler.add(\n label, \n @url + \"/create_trip\", \n :post,\n head: headers,\n body: body_for_booking(@booking_options).to_json\n ).response!(label)\n end", "def create_trip trip, driver_name\n\t\tif @drivers.has_key? driver_name\t\t\t\n\t\t\t@drivers[driver_name].add_trip trip\n\t\telse\n\t\t\tputs \"No driver #{driver_name} registered, created a new driver\"\n\t\t\tdriver = self.create_driver driver_name\n\t\t\tdriver.add_trip trip\n\t\tend\t\n\tend", "def instantiate_service\n @service = ContestService.new\n end", "def service_endpoint; end", "def service_endpoint; end", "def tier1_gateway_reprocess_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.tier1_gateway_reprocess ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.tier1_gateway_reprocess\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}?action=reprocess'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#tier1_gateway_reprocess\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @tb_servicio = TbServicio.new(tb_servicio_params)\n\n respond_to do |format|\n if @tb_servicio.save\n format.html { redirect_to @tb_servicio, notice: 'Tb servicio was successfully created.' }\n format.json { render :show, status: :created, location: @tb_servicio }\n else\n format.html { render :new }\n format.json { render json: @tb_servicio.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_carrier_service\n puts \" ____________ CREATE CARRIER SERVICE ______\"\n connectApi\n ShopifyAPI::CarrierService.create({\n \"carrier_service\": {\n \"name\": \"Livraison à domicile avec Urbit\",\n \"callback_url\": \"https://conticini-urbit.herokuapp.com/shipping\",\n \"service_discovery\": true\n }\n })\n end", "def service_type_name\n \"REST\"\n end", "def create\n service = current_account.services.build\n create_service = ServiceCreator.new(service: service)\n create_service.call(service_params.to_h)\n service.reload if service.persisted? # It has been touched\n respond_with(service)\n end", "def create(name)\n configure [\"interface #{name}\", 'no ip address', 'switchport']\n end", "def create_or_update_tier1_l2_vpn_service_with_http_info(tier_1_id, locale_service_id, service_id, l2_vpn_service, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service\"\n end\n # verify the required parameter 'service_id' is set\n if @api_client.config.client_side_validation && service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service\"\n end\n # verify the required parameter 'l2_vpn_service' is set\n if @api_client.config.client_side_validation && l2_vpn_service.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_vpn_service' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/l2vpn-services/{service-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-id' + '}', service_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_vpn_service)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2VPNService')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi#create_or_update_tier1_l2_vpn_service\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @v1_provider_operation = V1::ProviderOperation.new(v1_provider_operation_params)\n\n respond_to do |format|\n if @v1_provider_operation.save\n format.html { redirect_to @v1_provider_operation, notice: 'Provider operation was successfully created.' }\n format.json { render :show, status: :created, location: @v1_provider_operation }\n else\n format.html { render :new }\n format.json { render json: @v1_provider_operation.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tech_serv = TechServ.new(tech_serv_params)\n\n respond_to do |format|\n if @tech_serv.save\n format.html { redirect_to [:admin, @tech_serv], notice: '技术服务创建成功.' }\n format.json { render action: 'show', status: :created, location: @tech_serv }\n else\n format.html { render action: 'new' }\n format.json { render json: @tech_serv.errors, status: :unprocessable_entity }\n end\n end\n end", "def vertx_start\n @consul_client.request(:PUT, \"/v1/agent/service/register\") { |response|\n if response.status_code() == 200\n puts \"Registered foo service with Consul\"\n else \n puts \"Failed to register foo service with Consul\"\n end\n }.end({\n \"ID\" => \"foo_service\",\n \"Name\" => \"foo\",\n \"Tags\" => [\n \"service\"\n ],\n \"Port\" => SERVICE_PORT\n }.to_json)\nend", "def create\n service = current_account.services.build\n create_service = ServiceCreator.new(service: service)\n create_service.call(service_params)\n service.reload if service.persisted? # It has been touched\n respond_with(service)\n end", "def create\n @approximate_service = ApproximateService.new(params[:approximate_service])\n\n respond_to do |format|\n if @approximate_service.save\n format.html { redirect_to(@approximate_service, :notice => 'ApproximateService was successfully created.') }\n format.xml { render :xml => @approximate_service, :status => :created, :location => @approximate_service }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @approximate_service.errors, :status => :unprocessable_entity }\n end\n end\n end", "def start_service\n object = DBusObject.new(@main, self)\n service = @bus.request_service(SERVICE)\n service.export object\n end", "def read_tier1_policy_service_instance_endpoint_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInstanceEndpoint')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance_endpoint_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.delete_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.delete_tier1_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#delete_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create(name, config)\n # @step: validate the user defined options\n validate(config)\n\n # @step: create the infrastructure deployment\n begin\n provision_aks(name, config)\n rescue StandardError => e\n raise InfrastructureError, \"failed to provision cluster, error: #{e}\"\n end\n\n # @step: bootstrap the cluster\n begin\n provision_cluster(name, config)\n rescue StandardError => e\n raise InfrastructureError, \"failed to bootstrap cluster, error: #{e}\"\n end\n end", "def generate\n\t\ttemplate('service.tt', \"lib/services/#{name.underscore}_service.rb\")\n\tend", "def create_driver\n parse_service_description\n\n @driver = SOAP::RPC::Driver.new @control_url, @type\n\n mapping_registry = UPnP::SOAPRegistry.new\n\n @actions.each do |name, arguments|\n soapaction = \"#{@type}##{name}\"\n qname = XSD::QName.new @type, name\n\n # TODO map ranges, enumerations\n arguments = arguments.map do |direction, arg_name, variable|\n type, = @variables[variable]\n\n schema_name = XSD::QName.new nil, arg_name\n\n mapping_registry.register :class => type, :schema_name => schema_name\n\n [direction, arg_name, @variables[variable].first]\n end\n\n @driver.proxy.add_rpc_method qname, soapaction, name, arguments\n @driver.send :add_rpc_method_interface, name, arguments\n end\n\n @driver.mapping_registry = mapping_registry\n\n @variables = nil\n end", "def delete_tier1_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.delete_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.delete_tier1\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#delete_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n feature_enable unless feature_enabled\n X__RESOURCE_NAME__X_router\n end", "def create\n @tourist_site_app_service = TouristSiteAppService.new(tourist_site_app_service_params)\n\n respond_to do |format|\n if @tourist_site_app_service.save\n format.html { redirect_to @tourist_site_app_service, notice: 'Tourist site app service was successfully created.' }\n format.json { render :show, status: :created, location: @tourist_site_app_service }\n else\n format.html { render :new }\n format.json { render json: @tourist_site_app_service.errors, status: :unprocessable_entity }\n end\n end\n end", "def delete_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.delete_tier1_segment_port_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.delete_tier1_segment_port_0\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.delete_tier1_segment_port_0\"\n end\n # verify the required parameter 'port_id' is set\n if @api_client.config.client_side_validation && port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.delete_tier1_segment_port_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#delete_tier1_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_service(name, description)\n response = @client.post(\"/api/v1/services\", { \"name\" => name, \"description\" => description })\n return JSON.parse(response.body)\n end", "def create_service_by_names(name, space_guid, service_plan_name, service_type_name)\n service = @client.services.select{ |srv| srv.label == service_type_name }\n\n if service != []\n service_plan_id = @client.service_plans_by_service_guid(service.first.guid).each.find { |current_plan| current_plan.name == service_plan_name }.guid\n create_service_instance(name, space_guid, service_plan_id)\n else\n return false\n end\n end", "def create\n @port_service = PortService.new(port_service_params)\n\n respond_to do |format|\n if @port_service.save\n format.html { redirect_to @port_service, notice: 'Port service was successfully created.' }\n format.json { render :show, status: :created, location: @port_service }\n else\n format.html { render :new }\n format.json { render json: @port_service.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @method1 = Method1.new(params[:method1])\n\n respond_to do |format|\n if @method1.save\n format.html { redirect_to(@method1, :notice => 'Method1 was successfully created.') }\n format.xml { render :xml => @method1, :status => :created, :location => @method1 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @method1.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @one_time_stop = OneTimeStop.new(params[:one_time_stop])\n\n respond_to do |format|\n if @one_time_stop.save\n format.html { redirect_to @one_time_stop, notice: 'One time stop was successfully created.' }\n format.json { render json: @one_time_stop, status: :created, location: @one_time_stop }\n else\n format.html { render action: \"new\" }\n format.json { render json: @one_time_stop.errors, status: :unprocessable_entity }\n end\n end\n end", "def service(nickname, reserved, distribution, type)\n end", "def newMicroServiceType(name,abbr,style,opmode,min=1,max=1)\n\nend", "def create\n @tour_service = TourService.new(tour_service_params)\n\n respond_to do |format|\n if @tour_service.save\n\n format.html { redirect_to action:\"index\" }\n format.json { render :show, status: :created, location: @tour_service }\n else\n format.html { render :new }\n format.json { render json: @tour_service.errors, status: :unprocessable_entity }\n end\n end\n end", "def create(id, name: nil, type: :PRODUCTION, labels: nil, clusters: nil)\n end" ]
[ "0.6255446", "0.6160107", "0.59500915", "0.5949246", "0.5872546", "0.58042", "0.5798773", "0.57841635", "0.5781504", "0.5667666", "0.5664266", "0.56641316", "0.55803627", "0.55576456", "0.5546595", "0.5509095", "0.5476701", "0.5467246", "0.5462339", "0.5422024", "0.54111105", "0.5364136", "0.53586334", "0.53501445", "0.5341932", "0.5338575", "0.5320438", "0.5312692", "0.5309631", "0.53093755", "0.5303847", "0.52991974", "0.5277667", "0.5271184", "0.5266815", "0.52650434", "0.5263886", "0.52559936", "0.52557915", "0.5254452", "0.5254338", "0.52530396", "0.5251216", "0.5228382", "0.522151", "0.5207137", "0.5206563", "0.520512", "0.52048296", "0.52013564", "0.5193425", "0.5189865", "0.51883996", "0.5187259", "0.5181755", "0.51797515", "0.51781917", "0.51746655", "0.51746637", "0.51708853", "0.5165582", "0.5137648", "0.5129766", "0.5126896", "0.5126864", "0.5104034", "0.5088741", "0.5088202", "0.5088202", "0.5079411", "0.50720483", "0.50702894", "0.5065637", "0.50651735", "0.50606865", "0.5052408", "0.5039189", "0.50389683", "0.5038095", "0.5035218", "0.5034029", "0.50220317", "0.50202507", "0.50130755", "0.5009951", "0.50086623", "0.50080895", "0.50061625", "0.5004094", "0.5002074", "0.50018036", "0.5000226", "0.49990404", "0.4998888", "0.49908394", "0.49897653", "0.4975731", "0.49723923", "0.4971379", "0.4968171" ]
0.5209804
45
Create Tier1 service instance endpoint Create Tier1 Service instance endpoint.
def patch_tier1_service_instance_endpoint_0(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {}) patch_tier1_service_instance_endpoint_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts) nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_tier1_service_instance_endpoint_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint' is set\n if @api_client.config.client_side_validation && service_instance_endpoint.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_instance_endpoint)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInstanceEndpoint')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_service_instance_endpoint_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_tier1_service_instance_endpoint_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_endpoint' is set\n if @api_client.config.client_side_validation && service_instance_endpoint.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_instance_endpoint)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInstanceEndpoint')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_service_instance_endpoint\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_tier1_0_with_http_info(tier_1_id, tier1, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1_0\"\n end\n # verify the required parameter 'tier1' is set\n if @api_client.config.client_side_validation && tier1.nil?\n fail ArgumentError, \"Missing the required parameter 'tier1' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(tier1)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#create_or_replace_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_tier1_with_http_info(tier_1_id, tier1, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1\"\n end\n # verify the required parameter 'tier1' is set\n if @api_client.config.client_side_validation && tier1.nil?\n fail ArgumentError, \"Missing the required parameter 'tier1' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(tier1)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#create_or_replace_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'policy_service_instance' is set\n if @api_client.config.client_side_validation && policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n super(@@service)\n end", "def create_tier1_service_interface_0_with_http_info(tier_1_id, locale_service_id, interface_id, service_interface, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface_0\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface_0\"\n end\n # verify the required parameter 'service_interface' is set\n if @api_client.config.client_side_validation && service_interface.nil?\n fail ArgumentError, \"Missing the required parameter 'service_interface' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_interface)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#create_tier1_service_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_tier1_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance\"\n end\n # verify the required parameter 'policy_service_instance' is set\n if @api_client.config.client_side_validation && policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_tier1_service_interface_with_http_info(tier_1_id, locale_service_id, interface_id, service_interface, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface\"\n end\n # verify the required parameter 'service_interface' is set\n if @api_client.config.client_side_validation && service_interface.nil?\n fail ArgumentError, \"Missing the required parameter 'service_interface' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_interface)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#create_tier1_service_interface\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_service\n super.tap do |service_template|\n service_template.cookbook('poise-service')\n create_monit_config\n end\n end", "def create\n @t1 = T1.new(params[:t1])\n\n respond_to do |format|\n if @t1.save\n flash[:notice] = 'T1 was successfully created.'\n format.html { redirect_to(@t1) }\n format.xml { render :xml => @t1, :status => :created, :location => @t1 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @t1.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create_or_replace_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port_0\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port_0\"\n end\n # verify the required parameter 'port_id' is set\n if @api_client.config.client_side_validation && port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port_0\"\n end\n # verify the required parameter 'segment_port' is set\n if @api_client.config.client_side_validation && segment_port.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_port' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(segment_port)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentPort')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#create_or_replace_tier1_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port\"\n end\n # verify the required parameter 'port_id' is set\n if @api_client.config.client_side_validation && port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port\"\n end\n # verify the required parameter 'segment_port' is set\n if @api_client.config.client_side_validation && segment_port.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_port' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(segment_port)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentPort')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#create_or_replace_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port\"\n end\n # verify the required parameter 'port_id' is set\n if @api_client.config.client_side_validation && port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port\"\n end\n # verify the required parameter 'segment_port' is set\n if @api_client.config.client_side_validation && segment_port.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_port' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(segment_port)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentPort')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#create_or_replace_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def new\n @service = Service.new\n\n # If a valid type is received, apply to the host to create.\n check_priority_param\n @service.priority = @priority if([email protected]?)\n\n # Add custom views paths\n prepend_view_path \"app/views/services\"\n prepend_view_path \"lib/probes/#{@service.probe}/views\"\n\n respond_to do |format|\n format.html\n end\n end", "def new\n @service = Service.new\n end", "def create_service\n # Check signals here to be nice and abort early if possible.\n check_signals!\n # Enable automatically creates the service with Runit.\n directory \"/var/log/#{new_resource.service_name}\" do\n owner 'root'\n group 'root'\n mode '700'\n end\n end", "def create_tier1_service_instance_endpoint_0(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n data, _status_code, _headers = create_tier1_service_instance_endpoint_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts)\n data\n end", "def create\n @service = Service.create(service_params)\n end", "def start\n service.pool_action uuid, :create\n end", "def create_or_replace_tier1_locale_services_0_with_http_info(tier_1_id, locale_services_id, locale_services, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services_0\"\n end\n # verify the required parameter 'locale_services' is set\n if @api_client.config.client_side_validation && locale_services.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(locale_services)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#create_or_replace_tier1_locale_services_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n\n service= params[:connector][:service]\n\n case service\n when 'Scanner'\n Scanner.connect(params[:connector])\n when 'Converter'\n Converter.connect(params[:connector])\n sleep(0.5) ##just to avoid to much going on in parallel, should not be needed, just better\n Converter.run_conversion(Page.for_batch_conversion)\n when 'Hardware'\n Hardware.connect(params[:connector])\n sleep(0.5)\n Hardware.blink_ok_status_led\n Hardware.watch_scanner_button_on\n when 'TouchSwitch'\n TouchSwitch.connect(params[:connector])\n else\n raise \"Create Connection with unkown service: #{service}\"\n end\n\n push_app_status\n head :ok\n end", "def create_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'byod_policy_service_instance' is set\n if @api_client.config.client_side_validation && byod_policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'byod_policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(byod_policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_byod_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_patch_tier1_l2_vpn_service_0_with_http_info(tier_1_id, locale_service_id, service_id, l2_vpn_service, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'service_id' is set\n if @api_client.config.client_side_validation && service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'l2_vpn_service' is set\n if @api_client.config.client_side_validation && l2_vpn_service.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_vpn_service' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/l2vpn-services/{service-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-id' + '}', service_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_vpn_service)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi#create_or_patch_tier1_l2_vpn_service_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_tier1_locale_services_with_http_info(tier_1_id, locale_services_id, locale_services, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services\"\n end\n # verify the required parameter 'locale_services' is set\n if @api_client.config.client_side_validation && locale_services.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(locale_services)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#create_or_replace_tier1_locale_services\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def service_create(name, display_name, executable_on_host,startup=2)\n\t\tif session_has_services_depend?\n\t\t\tmeterpreter_service_create(name, display_name, executable_on_host,startup)\n\t\telse\n\t\t\tshell_service_create(name, display_name, executable_on_host,startup)\n\t\tend\n\tend", "def patch_tier1_service_instance_endpoint_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint' is set\n if @api_client.config.client_side_validation && service_instance_endpoint.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_instance_endpoint)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#patch_tier1_service_instance_endpoint_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @idti_service = IdtiService.new(idti_service_params)\n\n respond_to do |format|\n if @idti_service.save\n format.html { redirect_to @idti_service, notice: 'Idti service was successfully created.' }\n format.json { render :show, status: :created, location: @idti_service }\n else\n format.html { render :new }\n format.json { render json: @idti_service.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_service_instance_endpoint_with_http_info(tier_0_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint ...'\n end\n # verify the required parameter 'tier_0_id' is set\n if @api_client.config.client_side_validation && tier_0_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_0_id' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_endpoint' is set\n if @api_client.config.client_side_validation && service_instance_endpoint.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint\"\n end\n # resource path\n local_var_path = '/global-infra/tier-0s/{tier-0-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-0-id' + '}', tier_0_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_instance_endpoint)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInstanceEndpoint')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi#create_service_instance_endpoint\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_tier1_service_instance_endpoint(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n data, _status_code, _headers = create_tier1_service_instance_endpoint_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts)\n data\n end", "def create_service_instance(name, space_guid, service_plan_id)\n service_plan_instance = CFoundry::V2::ServicePlan.new(service_plan_id, @client)\n service_instance = @client.managed_service_instance\n service_instance.name = name\n service_instance.service_plan = service_plan_instance\n service_instance.space = @client.space(space_guid)\n service_instance.create!\n service_instance\n end", "def patch_tier1_0_with_http_info(tier_1_id, tier1, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.patch_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.patch_tier1_0\"\n end\n # verify the required parameter 'tier1' is set\n if @api_client.config.client_side_validation && tier1.nil?\n fail ArgumentError, \"Missing the required parameter 'tier1' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.patch_tier1_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(tier1)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#patch_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port_0\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port_0\"\n end\n # verify the required parameter 'port_id' is set\n if @api_client.config.client_side_validation && port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentPort')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#get_tier1_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @servicetype = Servicetype.new(params[:servicetype])\n\n respond_to do |format|\n if @servicetype.save\n format.html { redirect_to @servicetype, notice: 'Servicetype was successfully created.' }\n format.json { render json: @servicetype, status: :created, location: @servicetype }\n else\n format.html { render action: \"new\" }\n format.json { render json: @servicetype.errors, status: :unprocessable_entity }\n end\n end\n end", "def run\n super\n opt_port = _get_option \"port\"\n opt_protocol = _get_option \"protocol\"\n _create_network_service_entity(@entity,opt_port,opt_protocol,{})\n end", "def create\n submenu_item 'services-new'\n @service = Service.new(params[:service])\n @service_type = @service.type\n service_param\n\n @service.tenant_id = current_user.tenant_id\n\n # service_params = Service.extract_params(params[:service])\n # service_params = Service.extract_thresholds(service_params)\n # @service = Service.new(service_params)\n\n respond_to do |format|\n if @service.save\n flash[:notice] = \"#{@service.name}创建成功\"\n format.html { redirect_to(@service) }\n else\n dictionary\n format.html { render :action => \"new\" }\n end\n end\n end", "def create_service_instance_endpoint_0_with_http_info(tier_0_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint_0 ...'\n end\n # verify the required parameter 'tier_0_id' is set\n if @api_client.config.client_side_validation && tier_0_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_0_id' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint' is set\n if @api_client.config.client_side_validation && service_instance_endpoint.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint_0\"\n end\n # resource path\n local_var_path = '/infra/tier-0s/{tier-0-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-0-id' + '}', tier_0_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_instance_endpoint)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInstanceEndpoint')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi#create_service_instance_endpoint_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def newTransport\n\n end", "def create_server\n\n end", "def create_service(data=nil)\n if (!data.blank? && data.is_a?(Hash))\n @service = Service.create(data)\n else\n @service = Service.create(:name => \"Test Service #{rand(1..1000)}\", :description => \"Test service description.\", :active => true, :probe => \"dummy\", :probe_config => {:value => 1}, :interval => 60, :clean_interval => 86400, :priority => Service::PRIORITY_NORMAL, :resume => :mean_value)\n end\n end", "def create_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'byod_policy_service_instance' is set\n if @api_client.config.client_side_validation && byod_policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'byod_policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(byod_policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_byod_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_tier1_interface_0_with_http_info(tier_1_id, locale_services_id, interface_id, tier1_interface, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_or_replace_tier1_interface_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_or_replace_tier1_interface_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_or_replace_tier1_interface_0\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_or_replace_tier1_interface_0\"\n end\n # verify the required parameter 'tier1_interface' is set\n if @api_client.config.client_side_validation && tier1_interface.nil?\n fail ArgumentError, \"Missing the required parameter 'tier1_interface' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_or_replace_tier1_interface_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}/interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(tier1_interface)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1Interface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#create_or_replace_tier1_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_tier1_service_interface(tier_1_id, locale_service_id, interface_id, service_interface, opts = {})\n data, _status_code, _headers = create_tier1_service_interface_with_http_info(tier_1_id, locale_service_id, interface_id, service_interface, opts)\n data\n end", "def create\n @servicetype = Servicetype.new(params[:servicetype])\n\n respond_to do |format|\n if @servicetype.save\n format.html { redirect_to @servicetype, :notice => 'Servicetype was successfully created.' }\n format.json { render :json => @servicetype, :status => :created, :location => @servicetype }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @servicetype.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create_or_replace_tier1_interface_with_http_info(tier_1_id, locale_services_id, interface_id, tier1_interface, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_or_replace_tier1_interface ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_or_replace_tier1_interface\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_or_replace_tier1_interface\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_or_replace_tier1_interface\"\n end\n # verify the required parameter 'tier1_interface' is set\n if @api_client.config.client_side_validation && tier1_interface.nil?\n fail ArgumentError, \"Missing the required parameter 'tier1_interface' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_or_replace_tier1_interface\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}/interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(tier1_interface)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1Interface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#create_or_replace_tier1_interface\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_tier1_service_instance_endpoint_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_endpoint' is set\n if @api_client.config.client_side_validation && service_instance_endpoint.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_instance_endpoint)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#patch_tier1_service_instance_endpoint\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create(type)\n @call_params[:type] = type\n @client.call(self.class, __callee__.to_s, @call_params)\n end", "def create_or_replace_tier1_0(tier_1_id, tier1, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_0_with_http_info(tier_1_id, tier1, opts)\n data\n end", "def create_tier1_service_interface_0(tier_1_id, locale_service_id, interface_id, service_interface, opts = {})\n data, _status_code, _headers = create_tier1_service_interface_0_with_http_info(tier_1_id, locale_service_id, interface_id, service_interface, opts)\n data\n end", "def start_service\n DRb.start_service \n @space = Rinda::TupleSpaceProxy.new(DRbObject.new(nil, @uri))\n end", "def create_or_patch_tier1_l2_vpn_service_with_http_info(tier_1_id, locale_service_id, service_id, l2_vpn_service, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service\"\n end\n # verify the required parameter 'service_id' is set\n if @api_client.config.client_side_validation && service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service\"\n end\n # verify the required parameter 'l2_vpn_service' is set\n if @api_client.config.client_side_validation && l2_vpn_service.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_vpn_service' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/l2vpn-services/{service-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-id' + '}', service_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_vpn_service)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi#create_or_patch_tier1_l2_vpn_service\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_tier1_with_http_info(tier_1_id, tier1, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.patch_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.patch_tier1\"\n end\n # verify the required parameter 'tier1' is set\n if @api_client.config.client_side_validation && tier1.nil?\n fail ArgumentError, \"Missing the required parameter 'tier1' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.patch_tier1\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(tier1)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#patch_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_instance\n create_instances(1).first\n end", "def add_tier\n begin\n with_transaction do\n Tier.create!(\n name: params[:name],\n stage: params[:stage],\n pipeline_id: @pipeline.id\n )\n\n render json: tiers_for_pipeline_view\n end\n rescue Exception => e\n error = \"#{ConfluxErrors::TierCreationFailed} - #{e}\"\n logger.error { error }\n render json: { message: error }, status: 500\n end\n end", "def create_or_update_tier1_l2_vpn_service_0_with_http_info(tier_1_id, locale_service_id, service_id, l2_vpn_service, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'service_id' is set\n if @api_client.config.client_side_validation && service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'l2_vpn_service' is set\n if @api_client.config.client_side_validation && l2_vpn_service.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_vpn_service' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/l2vpn-services/{service-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-id' + '}', service_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_vpn_service)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2VPNService')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi#create_or_update_tier1_l2_vpn_service_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @taxi_sevice = TaxiSevice.new(taxi_sevice_params)\n\n respond_to do |format|\n if @taxi_sevice.save\n format.html { redirect_to action: \"index\" }\n else\n format.html { render :new }\n format.json { render json: @taxi_sevice.errors, status: :unprocessable_entity }\n end\n end\n end", "def get_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port\"\n end\n # verify the required parameter 'port_id' is set\n if @api_client.config.client_side_validation && port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentPort')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#get_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def tier1_gateway_reprocess_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.tier1_gateway_reprocess_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.tier1_gateway_reprocess_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}?action=reprocess'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#tier1_gateway_reprocess_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_url_template(rest_method)\n ServiceCatalographer::Util.generate_rest_endpoint_url_template(rest_method)\n end", "def get_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port\"\n end\n # verify the required parameter 'port_id' is set\n if @api_client.config.client_side_validation && port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentPort')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#get_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_gen1_account(name) \n\n account_create = {\n \"location\"=> \"centralus\",\n \"tags\"=> {\n \"test_key\"=> \"test_value\"\n },\n \"identity\"=> {\n \"type\"=> \"SystemAssigned\"\n },\n \"properties\"=> {\n \"encryptionState\"=> \"Enabled\",\n \"encryptionConfig\"=> {\n \"type\"=> \"ServiceManaged\",\n },\n \"firewallState\"=> \"Disabled\",\n \"firewallRules\"=> [\n \n ],\n \"trustedIdProviderState\"=> \"Disabled\",\n \"trustedIdProviders\"=> [\n \n ],\n \n \"newTier\"=> \"Consumption\",\n \"firewallAllowAzureIps\"=> \"Enabled\"\n }\n }\n\n response = HTTParty.put(\"https://management.azure.com/subscriptions/#{subscriptionId}/resourceGroups/#{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/#{name}?api-version=2016-11-01\", {\n\n body: account_create.to_json,\n\n headers: {\n \"Authorization\" => \"Bearer #{bearerToken}\",\n \"Content-Type\" => 'application/json', \n \"Accept\" => '*/*',\n \"Cache-Control\" => 'no-cache',\n \"Connection\" => 'keep-alive',\n \"cache-control\" => 'no-cache'\n },\n \n verify: true,\n })\n\n return JSON.parse response.read_body\n end", "def create_or_replace_tier1(tier_1_id, tier1, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_with_http_info(tier_1_id, tier1, opts)\n data\n end", "def start_service(*args)\n end", "def call\n # Update service and update context\n self.service = Entities::Service.find_by_system_name(remote: threescale_client,\n system_name: service_system_name)\n if service.nil?\n # Create service and update context\n self.service = Entities::Service.create(remote: threescale_client,\n service_params: service_settings)\n logger.info \"Created service id: #{service.id}, name: #{service_name}\"\n else\n service.update(service_settings)\n logger.info \"Updated service id: #{service.id}, name: #{service_name}\"\n end\n\n report['id'] = service.id\n report['system_name'] = service.system_name\n report['name'] = service.name\n report['backend_version'] = api_spec.service_backend_version\n end", "def create_trip\n # Only attempt to create trip if all the necessary pieces are there\n return false unless @itinerary && @trip && @service && @user\n \n label = request_label(:book, trip_id)\n \n @http_request_bundler.add(\n label, \n @url + \"/create_trip\", \n :post,\n head: headers,\n body: body_for_booking(@booking_options).to_json\n ).response!(label)\n end", "def create\n @payment_tier = PaymentTier.new(payment_tier_params)\n authorize! :manage, @payment_tier\n\n respond_to do |format|\n if @payment_tier.save\n format.html { redirect_to @payment_tier, notice: 'Payment tier was successfully created.' }\n format.json { render :show, status: :created, location: @payment_tier }\n else\n format.html { render :new }\n format.json { render json: @payment_tier.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_trip trip, driver_name\n\t\tif @drivers.has_key? driver_name\t\t\t\n\t\t\t@drivers[driver_name].add_trip trip\n\t\telse\n\t\t\tputs \"No driver #{driver_name} registered, created a new driver\"\n\t\t\tdriver = self.create_driver driver_name\n\t\t\tdriver.add_trip trip\n\t\tend\t\n\tend", "def instantiate_service\n @service = ContestService.new\n end", "def service_endpoint; end", "def service_endpoint; end", "def tier1_gateway_reprocess_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.tier1_gateway_reprocess ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.tier1_gateway_reprocess\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}?action=reprocess'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#tier1_gateway_reprocess\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @tb_servicio = TbServicio.new(tb_servicio_params)\n\n respond_to do |format|\n if @tb_servicio.save\n format.html { redirect_to @tb_servicio, notice: 'Tb servicio was successfully created.' }\n format.json { render :show, status: :created, location: @tb_servicio }\n else\n format.html { render :new }\n format.json { render json: @tb_servicio.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_carrier_service\n puts \" ____________ CREATE CARRIER SERVICE ______\"\n connectApi\n ShopifyAPI::CarrierService.create({\n \"carrier_service\": {\n \"name\": \"Livraison à domicile avec Urbit\",\n \"callback_url\": \"https://conticini-urbit.herokuapp.com/shipping\",\n \"service_discovery\": true\n }\n })\n end", "def create\n service = current_account.services.build\n create_service = ServiceCreator.new(service: service)\n create_service.call(service_params.to_h)\n service.reload if service.persisted? # It has been touched\n respond_with(service)\n end", "def service_type_name\n \"REST\"\n end", "def create(name)\n configure [\"interface #{name}\", 'no ip address', 'switchport']\n end", "def create_or_update_tier1_l2_vpn_service_with_http_info(tier_1_id, locale_service_id, service_id, l2_vpn_service, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service\"\n end\n # verify the required parameter 'service_id' is set\n if @api_client.config.client_side_validation && service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service\"\n end\n # verify the required parameter 'l2_vpn_service' is set\n if @api_client.config.client_side_validation && l2_vpn_service.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_vpn_service' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/l2vpn-services/{service-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-id' + '}', service_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_vpn_service)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2VPNService')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi#create_or_update_tier1_l2_vpn_service\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @tech_serv = TechServ.new(tech_serv_params)\n\n respond_to do |format|\n if @tech_serv.save\n format.html { redirect_to [:admin, @tech_serv], notice: '技术服务创建成功.' }\n format.json { render action: 'show', status: :created, location: @tech_serv }\n else\n format.html { render action: 'new' }\n format.json { render json: @tech_serv.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @v1_provider_operation = V1::ProviderOperation.new(v1_provider_operation_params)\n\n respond_to do |format|\n if @v1_provider_operation.save\n format.html { redirect_to @v1_provider_operation, notice: 'Provider operation was successfully created.' }\n format.json { render :show, status: :created, location: @v1_provider_operation }\n else\n format.html { render :new }\n format.json { render json: @v1_provider_operation.errors, status: :unprocessable_entity }\n end\n end\n end", "def vertx_start\n @consul_client.request(:PUT, \"/v1/agent/service/register\") { |response|\n if response.status_code() == 200\n puts \"Registered foo service with Consul\"\n else \n puts \"Failed to register foo service with Consul\"\n end\n }.end({\n \"ID\" => \"foo_service\",\n \"Name\" => \"foo\",\n \"Tags\" => [\n \"service\"\n ],\n \"Port\" => SERVICE_PORT\n }.to_json)\nend", "def create\n service = current_account.services.build\n create_service = ServiceCreator.new(service: service)\n create_service.call(service_params)\n service.reload if service.persisted? # It has been touched\n respond_with(service)\n end", "def create\n @approximate_service = ApproximateService.new(params[:approximate_service])\n\n respond_to do |format|\n if @approximate_service.save\n format.html { redirect_to(@approximate_service, :notice => 'ApproximateService was successfully created.') }\n format.xml { render :xml => @approximate_service, :status => :created, :location => @approximate_service }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @approximate_service.errors, :status => :unprocessable_entity }\n end\n end\n end", "def start_service\n object = DBusObject.new(@main, self)\n service = @bus.request_service(SERVICE)\n service.export object\n end", "def read_tier1_policy_service_instance_endpoint_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInstanceEndpoint')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance_endpoint_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create(name, config)\n # @step: validate the user defined options\n validate(config)\n\n # @step: create the infrastructure deployment\n begin\n provision_aks(name, config)\n rescue StandardError => e\n raise InfrastructureError, \"failed to provision cluster, error: #{e}\"\n end\n\n # @step: bootstrap the cluster\n begin\n provision_cluster(name, config)\n rescue StandardError => e\n raise InfrastructureError, \"failed to bootstrap cluster, error: #{e}\"\n end\n end", "def delete_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.delete_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.delete_tier1_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#delete_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def generate\n\t\ttemplate('service.tt', \"lib/services/#{name.underscore}_service.rb\")\n\tend", "def create_driver\n parse_service_description\n\n @driver = SOAP::RPC::Driver.new @control_url, @type\n\n mapping_registry = UPnP::SOAPRegistry.new\n\n @actions.each do |name, arguments|\n soapaction = \"#{@type}##{name}\"\n qname = XSD::QName.new @type, name\n\n # TODO map ranges, enumerations\n arguments = arguments.map do |direction, arg_name, variable|\n type, = @variables[variable]\n\n schema_name = XSD::QName.new nil, arg_name\n\n mapping_registry.register :class => type, :schema_name => schema_name\n\n [direction, arg_name, @variables[variable].first]\n end\n\n @driver.proxy.add_rpc_method qname, soapaction, name, arguments\n @driver.send :add_rpc_method_interface, name, arguments\n end\n\n @driver.mapping_registry = mapping_registry\n\n @variables = nil\n end", "def delete_tier1_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.delete_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.delete_tier1\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#delete_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n feature_enable unless feature_enabled\n X__RESOURCE_NAME__X_router\n end", "def create\n @tourist_site_app_service = TouristSiteAppService.new(tourist_site_app_service_params)\n\n respond_to do |format|\n if @tourist_site_app_service.save\n format.html { redirect_to @tourist_site_app_service, notice: 'Tourist site app service was successfully created.' }\n format.json { render :show, status: :created, location: @tourist_site_app_service }\n else\n format.html { render :new }\n format.json { render json: @tourist_site_app_service.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_service(name, description)\n response = @client.post(\"/api/v1/services\", { \"name\" => name, \"description\" => description })\n return JSON.parse(response.body)\n end", "def delete_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.delete_tier1_segment_port_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.delete_tier1_segment_port_0\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.delete_tier1_segment_port_0\"\n end\n # verify the required parameter 'port_id' is set\n if @api_client.config.client_side_validation && port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.delete_tier1_segment_port_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#delete_tier1_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_service_by_names(name, space_guid, service_plan_name, service_type_name)\n service = @client.services.select{ |srv| srv.label == service_type_name }\n\n if service != []\n service_plan_id = @client.service_plans_by_service_guid(service.first.guid).each.find { |current_plan| current_plan.name == service_plan_name }.guid\n create_service_instance(name, space_guid, service_plan_id)\n else\n return false\n end\n end", "def create\n @port_service = PortService.new(port_service_params)\n\n respond_to do |format|\n if @port_service.save\n format.html { redirect_to @port_service, notice: 'Port service was successfully created.' }\n format.json { render :show, status: :created, location: @port_service }\n else\n format.html { render :new }\n format.json { render json: @port_service.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @one_time_stop = OneTimeStop.new(params[:one_time_stop])\n\n respond_to do |format|\n if @one_time_stop.save\n format.html { redirect_to @one_time_stop, notice: 'One time stop was successfully created.' }\n format.json { render json: @one_time_stop, status: :created, location: @one_time_stop }\n else\n format.html { render action: \"new\" }\n format.json { render json: @one_time_stop.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @method1 = Method1.new(params[:method1])\n\n respond_to do |format|\n if @method1.save\n format.html { redirect_to(@method1, :notice => 'Method1 was successfully created.') }\n format.xml { render :xml => @method1, :status => :created, :location => @method1 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @method1.errors, :status => :unprocessable_entity }\n end\n end\n end", "def service(nickname, reserved, distribution, type)\n end", "def newMicroServiceType(name,abbr,style,opmode,min=1,max=1)\n\nend", "def create\n @tour_service = TourService.new(tour_service_params)\n\n respond_to do |format|\n if @tour_service.save\n\n format.html { redirect_to action:\"index\" }\n format.json { render :show, status: :created, location: @tour_service }\n else\n format.html { render :new }\n format.json { render json: @tour_service.errors, status: :unprocessable_entity }\n end\n end\n end", "def create(id, name: nil, type: :PRODUCTION, labels: nil, clusters: nil)\n end" ]
[ "0.625494", "0.61595315", "0.5949357", "0.59484917", "0.58725363", "0.580553", "0.57975584", "0.57841337", "0.5780229", "0.56689835", "0.56659293", "0.5663308", "0.5579451", "0.55567473", "0.5547634", "0.55096066", "0.5477932", "0.54663014", "0.54636806", "0.5423361", "0.5410323", "0.53655314", "0.5358775", "0.5349724", "0.53410494", "0.5339918", "0.53193796", "0.5314034", "0.53097194", "0.530873", "0.53049344", "0.52977467", "0.52760047", "0.527257", "0.5268527", "0.5266893", "0.52642184", "0.52584326", "0.52567077", "0.5255992", "0.5254453", "0.525166", "0.52497286", "0.5229681", "0.522006", "0.52087003", "0.5206781", "0.520588", "0.52056783", "0.5205229", "0.5200904", "0.5191903", "0.5191352", "0.5189275", "0.5187981", "0.5183935", "0.51780766", "0.51773185", "0.51753634", "0.5172999", "0.5172376", "0.51648605", "0.51379406", "0.5130566", "0.51289606", "0.5128466", "0.5105412", "0.5088903", "0.5087977", "0.5087977", "0.5078556", "0.5074264", "0.50709975", "0.5066319", "0.50648624", "0.5061784", "0.5051976", "0.5040853", "0.5039976", "0.50383884", "0.5036351", "0.5034839", "0.502199", "0.50190383", "0.5011901", "0.5011825", "0.5010289", "0.5008901", "0.5004806", "0.50044507", "0.50035834", "0.500137", "0.5000283", "0.49996138", "0.49991298", "0.49909967", "0.49907213", "0.49762383", "0.4974046", "0.497299", "0.49701765" ]
0.0
-1
Create Tier1 service instance endpoint Create Tier1 Service instance endpoint.
def patch_tier1_service_instance_endpoint_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0 ...' end # verify the required parameter 'tier_1_id' is set if @api_client.config.client_side_validation && tier_1_id.nil? fail ArgumentError, "Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0" end # verify the required parameter 'locale_service_id' is set if @api_client.config.client_side_validation && locale_service_id.nil? fail ArgumentError, "Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0" end # verify the required parameter 'service_instance_id' is set if @api_client.config.client_side_validation && service_instance_id.nil? fail ArgumentError, "Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0" end # verify the required parameter 'service_instance_endpoint_id' is set if @api_client.config.client_side_validation && service_instance_endpoint_id.nil? fail ArgumentError, "Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0" end # verify the required parameter 'service_instance_endpoint' is set if @api_client.config.client_side_validation && service_instance_endpoint.nil? fail ArgumentError, "Missing the required parameter 'service_instance_endpoint' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint_0" end # resource path local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(service_instance_endpoint) auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#patch_tier1_service_instance_endpoint_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_tier1_service_instance_endpoint_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint' is set\n if @api_client.config.client_side_validation && service_instance_endpoint.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_instance_endpoint)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInstanceEndpoint')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_service_instance_endpoint_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_tier1_service_instance_endpoint_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_endpoint' is set\n if @api_client.config.client_side_validation && service_instance_endpoint.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_service_instance_endpoint\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_instance_endpoint)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInstanceEndpoint')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_service_instance_endpoint\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_tier1_0_with_http_info(tier_1_id, tier1, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1_0\"\n end\n # verify the required parameter 'tier1' is set\n if @api_client.config.client_side_validation && tier1.nil?\n fail ArgumentError, \"Missing the required parameter 'tier1' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(tier1)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#create_or_replace_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_tier1_with_http_info(tier_1_id, tier1, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1\"\n end\n # verify the required parameter 'tier1' is set\n if @api_client.config.client_side_validation && tier1.nil?\n fail ArgumentError, \"Missing the required parameter 'tier1' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.create_or_replace_tier1\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(tier1)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#create_or_replace_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'policy_service_instance' is set\n if @api_client.config.client_side_validation && policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n super(@@service)\n end", "def create_tier1_service_interface_0_with_http_info(tier_1_id, locale_service_id, interface_id, service_interface, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface_0\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface_0\"\n end\n # verify the required parameter 'service_interface' is set\n if @api_client.config.client_side_validation && service_interface.nil?\n fail ArgumentError, \"Missing the required parameter 'service_interface' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_interface)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#create_tier1_service_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_tier1_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance\"\n end\n # verify the required parameter 'policy_service_instance' is set\n if @api_client.config.client_side_validation && policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_tier1_service_interface_with_http_info(tier_1_id, locale_service_id, interface_id, service_interface, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface\"\n end\n # verify the required parameter 'service_interface' is set\n if @api_client.config.client_side_validation && service_interface.nil?\n fail ArgumentError, \"Missing the required parameter 'service_interface' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_tier1_service_interface\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_interface)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#create_tier1_service_interface\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_service\n super.tap do |service_template|\n service_template.cookbook('poise-service')\n create_monit_config\n end\n end", "def create\n @t1 = T1.new(params[:t1])\n\n respond_to do |format|\n if @t1.save\n flash[:notice] = 'T1 was successfully created.'\n format.html { redirect_to(@t1) }\n format.xml { render :xml => @t1, :status => :created, :location => @t1 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @t1.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create_or_replace_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port_0\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port_0\"\n end\n # verify the required parameter 'port_id' is set\n if @api_client.config.client_side_validation && port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port_0\"\n end\n # verify the required parameter 'segment_port' is set\n if @api_client.config.client_side_validation && segment_port.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_port' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(segment_port)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentPort')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#create_or_replace_tier1_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port\"\n end\n # verify the required parameter 'port_id' is set\n if @api_client.config.client_side_validation && port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port\"\n end\n # verify the required parameter 'segment_port' is set\n if @api_client.config.client_side_validation && segment_port.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_port' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(segment_port)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentPort')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#create_or_replace_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port\"\n end\n # verify the required parameter 'port_id' is set\n if @api_client.config.client_side_validation && port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port\"\n end\n # verify the required parameter 'segment_port' is set\n if @api_client.config.client_side_validation && segment_port.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_port' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(segment_port)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentPort')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#create_or_replace_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def new\n @service = Service.new\n\n # If a valid type is received, apply to the host to create.\n check_priority_param\n @service.priority = @priority if([email protected]?)\n\n # Add custom views paths\n prepend_view_path \"app/views/services\"\n prepend_view_path \"lib/probes/#{@service.probe}/views\"\n\n respond_to do |format|\n format.html\n end\n end", "def new\n @service = Service.new\n end", "def create_service\n # Check signals here to be nice and abort early if possible.\n check_signals!\n # Enable automatically creates the service with Runit.\n directory \"/var/log/#{new_resource.service_name}\" do\n owner 'root'\n group 'root'\n mode '700'\n end\n end", "def create_tier1_service_instance_endpoint_0(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n data, _status_code, _headers = create_tier1_service_instance_endpoint_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts)\n data\n end", "def create\n @service = Service.create(service_params)\n end", "def start\n service.pool_action uuid, :create\n end", "def create_or_replace_tier1_locale_services_0_with_http_info(tier_1_id, locale_services_id, locale_services, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services_0\"\n end\n # verify the required parameter 'locale_services' is set\n if @api_client.config.client_side_validation && locale_services.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(locale_services)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#create_or_replace_tier1_locale_services_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n\n service= params[:connector][:service]\n\n case service\n when 'Scanner'\n Scanner.connect(params[:connector])\n when 'Converter'\n Converter.connect(params[:connector])\n sleep(0.5) ##just to avoid to much going on in parallel, should not be needed, just better\n Converter.run_conversion(Page.for_batch_conversion)\n when 'Hardware'\n Hardware.connect(params[:connector])\n sleep(0.5)\n Hardware.blink_ok_status_led\n Hardware.watch_scanner_button_on\n when 'TouchSwitch'\n TouchSwitch.connect(params[:connector])\n else\n raise \"Create Connection with unkown service: #{service}\"\n end\n\n push_app_status\n head :ok\n end", "def create_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'byod_policy_service_instance' is set\n if @api_client.config.client_side_validation && byod_policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'byod_policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(byod_policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_byod_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_patch_tier1_l2_vpn_service_0_with_http_info(tier_1_id, locale_service_id, service_id, l2_vpn_service, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'service_id' is set\n if @api_client.config.client_side_validation && service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'l2_vpn_service' is set\n if @api_client.config.client_side_validation && l2_vpn_service.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_vpn_service' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/l2vpn-services/{service-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-id' + '}', service_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_vpn_service)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi#create_or_patch_tier1_l2_vpn_service_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_tier1_locale_services_with_http_info(tier_1_id, locale_services_id, locale_services, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services\"\n end\n # verify the required parameter 'locale_services' is set\n if @api_client.config.client_side_validation && locale_services.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.create_or_replace_tier1_locale_services\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(locale_services)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#create_or_replace_tier1_locale_services\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def service_create(name, display_name, executable_on_host,startup=2)\n\t\tif session_has_services_depend?\n\t\t\tmeterpreter_service_create(name, display_name, executable_on_host,startup)\n\t\telse\n\t\t\tshell_service_create(name, display_name, executable_on_host,startup)\n\t\tend\n\tend", "def create\n @idti_service = IdtiService.new(idti_service_params)\n\n respond_to do |format|\n if @idti_service.save\n format.html { redirect_to @idti_service, notice: 'Idti service was successfully created.' }\n format.json { render :show, status: :created, location: @idti_service }\n else\n format.html { render :new }\n format.json { render json: @idti_service.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_tier1_service_instance_endpoint(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n data, _status_code, _headers = create_tier1_service_instance_endpoint_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts)\n data\n end", "def create_service_instance_endpoint_with_http_info(tier_0_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint ...'\n end\n # verify the required parameter 'tier_0_id' is set\n if @api_client.config.client_side_validation && tier_0_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_0_id' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_endpoint' is set\n if @api_client.config.client_side_validation && service_instance_endpoint.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint\"\n end\n # resource path\n local_var_path = '/global-infra/tier-0s/{tier-0-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-0-id' + '}', tier_0_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_instance_endpoint)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInstanceEndpoint')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi#create_service_instance_endpoint\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_service_instance(name, space_guid, service_plan_id)\n service_plan_instance = CFoundry::V2::ServicePlan.new(service_plan_id, @client)\n service_instance = @client.managed_service_instance\n service_instance.name = name\n service_instance.service_plan = service_plan_instance\n service_instance.space = @client.space(space_guid)\n service_instance.create!\n service_instance\n end", "def patch_tier1_0_with_http_info(tier_1_id, tier1, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.patch_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.patch_tier1_0\"\n end\n # verify the required parameter 'tier1' is set\n if @api_client.config.client_side_validation && tier1.nil?\n fail ArgumentError, \"Missing the required parameter 'tier1' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.patch_tier1_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(tier1)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#patch_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port_0\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port_0\"\n end\n # verify the required parameter 'port_id' is set\n if @api_client.config.client_side_validation && port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentPort')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#get_tier1_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @servicetype = Servicetype.new(params[:servicetype])\n\n respond_to do |format|\n if @servicetype.save\n format.html { redirect_to @servicetype, notice: 'Servicetype was successfully created.' }\n format.json { render json: @servicetype, status: :created, location: @servicetype }\n else\n format.html { render action: \"new\" }\n format.json { render json: @servicetype.errors, status: :unprocessable_entity }\n end\n end\n end", "def run\n super\n opt_port = _get_option \"port\"\n opt_protocol = _get_option \"protocol\"\n _create_network_service_entity(@entity,opt_port,opt_protocol,{})\n end", "def create\n submenu_item 'services-new'\n @service = Service.new(params[:service])\n @service_type = @service.type\n service_param\n\n @service.tenant_id = current_user.tenant_id\n\n # service_params = Service.extract_params(params[:service])\n # service_params = Service.extract_thresholds(service_params)\n # @service = Service.new(service_params)\n\n respond_to do |format|\n if @service.save\n flash[:notice] = \"#{@service.name}创建成功\"\n format.html { redirect_to(@service) }\n else\n dictionary\n format.html { render :action => \"new\" }\n end\n end\n end", "def create_service_instance_endpoint_0_with_http_info(tier_0_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint_0 ...'\n end\n # verify the required parameter 'tier_0_id' is set\n if @api_client.config.client_side_validation && tier_0_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_0_id' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint' is set\n if @api_client.config.client_side_validation && service_instance_endpoint.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint' when calling PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi.create_service_instance_endpoint_0\"\n end\n # resource path\n local_var_path = '/infra/tier-0s/{tier-0-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-0-id' + '}', tier_0_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_instance_endpoint)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInstanceEndpoint')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier0GatewaysApi#create_service_instance_endpoint_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def newTransport\n\n end", "def create_server\n\n end", "def create_service(data=nil)\n if (!data.blank? && data.is_a?(Hash))\n @service = Service.create(data)\n else\n @service = Service.create(:name => \"Test Service #{rand(1..1000)}\", :description => \"Test service description.\", :active => true, :probe => \"dummy\", :probe_config => {:value => 1}, :interval => 60, :clean_interval => 86400, :priority => Service::PRIORITY_NORMAL, :resume => :mean_value)\n end\n end", "def create_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, byod_policy_service_instance, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'byod_policy_service_instance' is set\n if @api_client.config.client_side_validation && byod_policy_service_instance.nil?\n fail ArgumentError, \"Missing the required parameter 'byod_policy_service_instance' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.create_tier1_byod_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(byod_policy_service_instance)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#create_tier1_byod_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_tier1_interface_0_with_http_info(tier_1_id, locale_services_id, interface_id, tier1_interface, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_or_replace_tier1_interface_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_or_replace_tier1_interface_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_or_replace_tier1_interface_0\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_or_replace_tier1_interface_0\"\n end\n # verify the required parameter 'tier1_interface' is set\n if @api_client.config.client_side_validation && tier1_interface.nil?\n fail ArgumentError, \"Missing the required parameter 'tier1_interface' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_or_replace_tier1_interface_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}/interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(tier1_interface)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1Interface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#create_or_replace_tier1_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_tier1_service_interface(tier_1_id, locale_service_id, interface_id, service_interface, opts = {})\n data, _status_code, _headers = create_tier1_service_interface_with_http_info(tier_1_id, locale_service_id, interface_id, service_interface, opts)\n data\n end", "def create\n @servicetype = Servicetype.new(params[:servicetype])\n\n respond_to do |format|\n if @servicetype.save\n format.html { redirect_to @servicetype, :notice => 'Servicetype was successfully created.' }\n format.json { render :json => @servicetype, :status => :created, :location => @servicetype }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @servicetype.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create_or_replace_tier1_interface_with_http_info(tier_1_id, locale_services_id, interface_id, tier1_interface, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_or_replace_tier1_interface ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_or_replace_tier1_interface\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_or_replace_tier1_interface\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_or_replace_tier1_interface\"\n end\n # verify the required parameter 'tier1_interface' is set\n if @api_client.config.client_side_validation && tier1_interface.nil?\n fail ArgumentError, \"Missing the required parameter 'tier1_interface' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.create_or_replace_tier1_interface\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}/interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(tier1_interface)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1Interface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#create_or_replace_tier1_interface\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_tier1_service_instance_endpoint_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, service_instance_endpoint, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_endpoint' is set\n if @api_client.config.client_side_validation && service_instance_endpoint.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.patch_tier1_service_instance_endpoint\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(service_instance_endpoint)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#patch_tier1_service_instance_endpoint\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_tier1_service_interface_0(tier_1_id, locale_service_id, interface_id, service_interface, opts = {})\n data, _status_code, _headers = create_tier1_service_interface_0_with_http_info(tier_1_id, locale_service_id, interface_id, service_interface, opts)\n data\n end", "def create_or_replace_tier1_0(tier_1_id, tier1, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_0_with_http_info(tier_1_id, tier1, opts)\n data\n end", "def start_service\n DRb.start_service \n @space = Rinda::TupleSpaceProxy.new(DRbObject.new(nil, @uri))\n end", "def create(type)\n @call_params[:type] = type\n @client.call(self.class, __callee__.to_s, @call_params)\n end", "def create_or_patch_tier1_l2_vpn_service_with_http_info(tier_1_id, locale_service_id, service_id, l2_vpn_service, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service\"\n end\n # verify the required parameter 'service_id' is set\n if @api_client.config.client_side_validation && service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service\"\n end\n # verify the required parameter 'l2_vpn_service' is set\n if @api_client.config.client_side_validation && l2_vpn_service.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_vpn_service' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_patch_tier1_l2_vpn_service\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/l2vpn-services/{service-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-id' + '}', service_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_vpn_service)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi#create_or_patch_tier1_l2_vpn_service\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_tier1_with_http_info(tier_1_id, tier1, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.patch_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.patch_tier1\"\n end\n # verify the required parameter 'tier1' is set\n if @api_client.config.client_side_validation && tier1.nil?\n fail ArgumentError, \"Missing the required parameter 'tier1' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.patch_tier1\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(tier1)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#patch_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_instance\n create_instances(1).first\n end", "def create_or_update_tier1_l2_vpn_service_0_with_http_info(tier_1_id, locale_service_id, service_id, l2_vpn_service, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'service_id' is set\n if @api_client.config.client_side_validation && service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service_0\"\n end\n # verify the required parameter 'l2_vpn_service' is set\n if @api_client.config.client_side_validation && l2_vpn_service.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_vpn_service' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/l2vpn-services/{service-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-id' + '}', service_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_vpn_service)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2VPNService')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi#create_or_update_tier1_l2_vpn_service_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def add_tier\n begin\n with_transaction do\n Tier.create!(\n name: params[:name],\n stage: params[:stage],\n pipeline_id: @pipeline.id\n )\n\n render json: tiers_for_pipeline_view\n end\n rescue Exception => e\n error = \"#{ConfluxErrors::TierCreationFailed} - #{e}\"\n logger.error { error }\n render json: { message: error }, status: 500\n end\n end", "def create\n @taxi_sevice = TaxiSevice.new(taxi_sevice_params)\n\n respond_to do |format|\n if @taxi_sevice.save\n format.html { redirect_to action: \"index\" }\n else\n format.html { render :new }\n format.json { render json: @taxi_sevice.errors, status: :unprocessable_entity }\n end\n end\n end", "def get_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port\"\n end\n # verify the required parameter 'port_id' is set\n if @api_client.config.client_side_validation && port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentPort')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#get_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def tier1_gateway_reprocess_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.tier1_gateway_reprocess_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.tier1_gateway_reprocess_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}?action=reprocess'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#tier1_gateway_reprocess_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_url_template(rest_method)\n ServiceCatalographer::Util.generate_rest_endpoint_url_template(rest_method)\n end", "def get_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port\"\n end\n # verify the required parameter 'port_id' is set\n if @api_client.config.client_side_validation && port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.get_tier1_segment_port\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentPort')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#get_tier1_segment_port\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_gen1_account(name) \n\n account_create = {\n \"location\"=> \"centralus\",\n \"tags\"=> {\n \"test_key\"=> \"test_value\"\n },\n \"identity\"=> {\n \"type\"=> \"SystemAssigned\"\n },\n \"properties\"=> {\n \"encryptionState\"=> \"Enabled\",\n \"encryptionConfig\"=> {\n \"type\"=> \"ServiceManaged\",\n },\n \"firewallState\"=> \"Disabled\",\n \"firewallRules\"=> [\n \n ],\n \"trustedIdProviderState\"=> \"Disabled\",\n \"trustedIdProviders\"=> [\n \n ],\n \n \"newTier\"=> \"Consumption\",\n \"firewallAllowAzureIps\"=> \"Enabled\"\n }\n }\n\n response = HTTParty.put(\"https://management.azure.com/subscriptions/#{subscriptionId}/resourceGroups/#{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/#{name}?api-version=2016-11-01\", {\n\n body: account_create.to_json,\n\n headers: {\n \"Authorization\" => \"Bearer #{bearerToken}\",\n \"Content-Type\" => 'application/json', \n \"Accept\" => '*/*',\n \"Cache-Control\" => 'no-cache',\n \"Connection\" => 'keep-alive',\n \"cache-control\" => 'no-cache'\n },\n \n verify: true,\n })\n\n return JSON.parse response.read_body\n end", "def create_or_replace_tier1(tier_1_id, tier1, opts = {})\n data, _status_code, _headers = create_or_replace_tier1_with_http_info(tier_1_id, tier1, opts)\n data\n end", "def start_service(*args)\n end", "def call\n # Update service and update context\n self.service = Entities::Service.find_by_system_name(remote: threescale_client,\n system_name: service_system_name)\n if service.nil?\n # Create service and update context\n self.service = Entities::Service.create(remote: threescale_client,\n service_params: service_settings)\n logger.info \"Created service id: #{service.id}, name: #{service_name}\"\n else\n service.update(service_settings)\n logger.info \"Updated service id: #{service.id}, name: #{service_name}\"\n end\n\n report['id'] = service.id\n report['system_name'] = service.system_name\n report['name'] = service.name\n report['backend_version'] = api_spec.service_backend_version\n end", "def create\n @payment_tier = PaymentTier.new(payment_tier_params)\n authorize! :manage, @payment_tier\n\n respond_to do |format|\n if @payment_tier.save\n format.html { redirect_to @payment_tier, notice: 'Payment tier was successfully created.' }\n format.json { render :show, status: :created, location: @payment_tier }\n else\n format.html { render :new }\n format.json { render json: @payment_tier.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_trip\n # Only attempt to create trip if all the necessary pieces are there\n return false unless @itinerary && @trip && @service && @user\n \n label = request_label(:book, trip_id)\n \n @http_request_bundler.add(\n label, \n @url + \"/create_trip\", \n :post,\n head: headers,\n body: body_for_booking(@booking_options).to_json\n ).response!(label)\n end", "def create_trip trip, driver_name\n\t\tif @drivers.has_key? driver_name\t\t\t\n\t\t\t@drivers[driver_name].add_trip trip\n\t\telse\n\t\t\tputs \"No driver #{driver_name} registered, created a new driver\"\n\t\t\tdriver = self.create_driver driver_name\n\t\t\tdriver.add_trip trip\n\t\tend\t\n\tend", "def instantiate_service\n @service = ContestService.new\n end", "def service_endpoint; end", "def service_endpoint; end", "def tier1_gateway_reprocess_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.tier1_gateway_reprocess ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.tier1_gateway_reprocess\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}?action=reprocess'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#tier1_gateway_reprocess\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @tb_servicio = TbServicio.new(tb_servicio_params)\n\n respond_to do |format|\n if @tb_servicio.save\n format.html { redirect_to @tb_servicio, notice: 'Tb servicio was successfully created.' }\n format.json { render :show, status: :created, location: @tb_servicio }\n else\n format.html { render :new }\n format.json { render json: @tb_servicio.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_carrier_service\n puts \" ____________ CREATE CARRIER SERVICE ______\"\n connectApi\n ShopifyAPI::CarrierService.create({\n \"carrier_service\": {\n \"name\": \"Livraison à domicile avec Urbit\",\n \"callback_url\": \"https://conticini-urbit.herokuapp.com/shipping\",\n \"service_discovery\": true\n }\n })\n end", "def service_type_name\n \"REST\"\n end", "def create\n service = current_account.services.build\n create_service = ServiceCreator.new(service: service)\n create_service.call(service_params.to_h)\n service.reload if service.persisted? # It has been touched\n respond_with(service)\n end", "def create(name)\n configure [\"interface #{name}\", 'no ip address', 'switchport']\n end", "def create_or_update_tier1_l2_vpn_service_with_http_info(tier_1_id, locale_service_id, service_id, l2_vpn_service, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service\"\n end\n # verify the required parameter 'service_id' is set\n if @api_client.config.client_side_validation && service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_id' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service\"\n end\n # verify the required parameter 'l2_vpn_service' is set\n if @api_client.config.client_side_validation && l2_vpn_service.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_vpn_service' when calling PolicyNetworkingNetworkServicesVPNL2VPNServicesApi.create_or_update_tier1_l2_vpn_service\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/l2vpn-services/{service-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-id' + '}', service_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_vpn_service)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2VPNService')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingNetworkServicesVPNL2VPNServicesApi#create_or_update_tier1_l2_vpn_service\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @v1_provider_operation = V1::ProviderOperation.new(v1_provider_operation_params)\n\n respond_to do |format|\n if @v1_provider_operation.save\n format.html { redirect_to @v1_provider_operation, notice: 'Provider operation was successfully created.' }\n format.json { render :show, status: :created, location: @v1_provider_operation }\n else\n format.html { render :new }\n format.json { render json: @v1_provider_operation.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tech_serv = TechServ.new(tech_serv_params)\n\n respond_to do |format|\n if @tech_serv.save\n format.html { redirect_to [:admin, @tech_serv], notice: '技术服务创建成功.' }\n format.json { render action: 'show', status: :created, location: @tech_serv }\n else\n format.html { render action: 'new' }\n format.json { render json: @tech_serv.errors, status: :unprocessable_entity }\n end\n end\n end", "def vertx_start\n @consul_client.request(:PUT, \"/v1/agent/service/register\") { |response|\n if response.status_code() == 200\n puts \"Registered foo service with Consul\"\n else \n puts \"Failed to register foo service with Consul\"\n end\n }.end({\n \"ID\" => \"foo_service\",\n \"Name\" => \"foo\",\n \"Tags\" => [\n \"service\"\n ],\n \"Port\" => SERVICE_PORT\n }.to_json)\nend", "def create\n service = current_account.services.build\n create_service = ServiceCreator.new(service: service)\n create_service.call(service_params)\n service.reload if service.persisted? # It has been touched\n respond_with(service)\n end", "def create\n @approximate_service = ApproximateService.new(params[:approximate_service])\n\n respond_to do |format|\n if @approximate_service.save\n format.html { redirect_to(@approximate_service, :notice => 'ApproximateService was successfully created.') }\n format.xml { render :xml => @approximate_service, :status => :created, :location => @approximate_service }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @approximate_service.errors, :status => :unprocessable_entity }\n end\n end\n end", "def start_service\n object = DBusObject.new(@main, self)\n service = @bus.request_service(SERVICE)\n service.export object\n end", "def read_tier1_policy_service_instance_endpoint_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInstanceEndpoint')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance_endpoint_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.delete_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.delete_tier1_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#delete_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create(name, config)\n # @step: validate the user defined options\n validate(config)\n\n # @step: create the infrastructure deployment\n begin\n provision_aks(name, config)\n rescue StandardError => e\n raise InfrastructureError, \"failed to provision cluster, error: #{e}\"\n end\n\n # @step: bootstrap the cluster\n begin\n provision_cluster(name, config)\n rescue StandardError => e\n raise InfrastructureError, \"failed to bootstrap cluster, error: #{e}\"\n end\n end", "def generate\n\t\ttemplate('service.tt', \"lib/services/#{name.underscore}_service.rb\")\n\tend", "def create_driver\n parse_service_description\n\n @driver = SOAP::RPC::Driver.new @control_url, @type\n\n mapping_registry = UPnP::SOAPRegistry.new\n\n @actions.each do |name, arguments|\n soapaction = \"#{@type}##{name}\"\n qname = XSD::QName.new @type, name\n\n # TODO map ranges, enumerations\n arguments = arguments.map do |direction, arg_name, variable|\n type, = @variables[variable]\n\n schema_name = XSD::QName.new nil, arg_name\n\n mapping_registry.register :class => type, :schema_name => schema_name\n\n [direction, arg_name, @variables[variable].first]\n end\n\n @driver.proxy.add_rpc_method qname, soapaction, name, arguments\n @driver.send :add_rpc_method_interface, name, arguments\n end\n\n @driver.mapping_registry = mapping_registry\n\n @variables = nil\n end", "def delete_tier1_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.delete_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.delete_tier1\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#delete_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n feature_enable unless feature_enabled\n X__RESOURCE_NAME__X_router\n end", "def create\n @tourist_site_app_service = TouristSiteAppService.new(tourist_site_app_service_params)\n\n respond_to do |format|\n if @tourist_site_app_service.save\n format.html { redirect_to @tourist_site_app_service, notice: 'Tourist site app service was successfully created.' }\n format.json { render :show, status: :created, location: @tourist_site_app_service }\n else\n format.html { render :new }\n format.json { render json: @tourist_site_app_service.errors, status: :unprocessable_entity }\n end\n end\n end", "def delete_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.delete_tier1_segment_port_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.delete_tier1_segment_port_0\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.delete_tier1_segment_port_0\"\n end\n # verify the required parameter 'port_id' is set\n if @api_client.config.client_side_validation && port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.delete_tier1_segment_port_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsPortsApi#delete_tier1_segment_port_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_service(name, description)\n response = @client.post(\"/api/v1/services\", { \"name\" => name, \"description\" => description })\n return JSON.parse(response.body)\n end", "def create_service_by_names(name, space_guid, service_plan_name, service_type_name)\n service = @client.services.select{ |srv| srv.label == service_type_name }\n\n if service != []\n service_plan_id = @client.service_plans_by_service_guid(service.first.guid).each.find { |current_plan| current_plan.name == service_plan_name }.guid\n create_service_instance(name, space_guid, service_plan_id)\n else\n return false\n end\n end", "def create\n @port_service = PortService.new(port_service_params)\n\n respond_to do |format|\n if @port_service.save\n format.html { redirect_to @port_service, notice: 'Port service was successfully created.' }\n format.json { render :show, status: :created, location: @port_service }\n else\n format.html { render :new }\n format.json { render json: @port_service.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @method1 = Method1.new(params[:method1])\n\n respond_to do |format|\n if @method1.save\n format.html { redirect_to(@method1, :notice => 'Method1 was successfully created.') }\n format.xml { render :xml => @method1, :status => :created, :location => @method1 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @method1.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @one_time_stop = OneTimeStop.new(params[:one_time_stop])\n\n respond_to do |format|\n if @one_time_stop.save\n format.html { redirect_to @one_time_stop, notice: 'One time stop was successfully created.' }\n format.json { render json: @one_time_stop, status: :created, location: @one_time_stop }\n else\n format.html { render action: \"new\" }\n format.json { render json: @one_time_stop.errors, status: :unprocessable_entity }\n end\n end\n end", "def service(nickname, reserved, distribution, type)\n end", "def newMicroServiceType(name,abbr,style,opmode,min=1,max=1)\n\nend", "def create\n @tour_service = TourService.new(tour_service_params)\n\n respond_to do |format|\n if @tour_service.save\n\n format.html { redirect_to action:\"index\" }\n format.json { render :show, status: :created, location: @tour_service }\n else\n format.html { render :new }\n format.json { render json: @tour_service.errors, status: :unprocessable_entity }\n end\n end\n end", "def create(id, name: nil, type: :PRODUCTION, labels: nil, clusters: nil)\n end" ]
[ "0.6255446", "0.6160107", "0.59500915", "0.5949246", "0.5872546", "0.58042", "0.5798773", "0.57841635", "0.5781504", "0.5667666", "0.5664266", "0.56641316", "0.55803627", "0.55576456", "0.5546595", "0.5509095", "0.5476701", "0.5467246", "0.5462339", "0.5422024", "0.54111105", "0.5364136", "0.53586334", "0.53501445", "0.5341932", "0.5338575", "0.5312692", "0.5309631", "0.53093755", "0.5303847", "0.52991974", "0.5277667", "0.5271184", "0.5266815", "0.52650434", "0.5263886", "0.52559936", "0.52557915", "0.5254452", "0.5254338", "0.52530396", "0.5251216", "0.5228382", "0.522151", "0.5209804", "0.5207137", "0.5206563", "0.520512", "0.52048296", "0.52013564", "0.5193425", "0.5189865", "0.51883996", "0.5187259", "0.5181755", "0.51797515", "0.51781917", "0.51746655", "0.51746637", "0.51708853", "0.5165582", "0.5137648", "0.5129766", "0.5126896", "0.5126864", "0.5104034", "0.5088741", "0.5088202", "0.5088202", "0.5079411", "0.50720483", "0.50702894", "0.5065637", "0.50651735", "0.50606865", "0.5052408", "0.5039189", "0.50389683", "0.5038095", "0.5035218", "0.5034029", "0.50220317", "0.50202507", "0.50130755", "0.5009951", "0.50086623", "0.50080895", "0.50061625", "0.5004094", "0.5002074", "0.50018036", "0.5000226", "0.49990404", "0.4998888", "0.49908394", "0.49897653", "0.4975731", "0.49723923", "0.4971379", "0.4968171" ]
0.5320438
26
Read all service instance objects under a tier1 Read all service instance objects under a tier1
def read_all_policy_service_instances_for_tier1(tier_1_id, locale_service_id, opts = {}) data, _status_code, _headers = read_all_policy_service_instances_for_tier1_with_http_info(tier_1_id, locale_service_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all_instances\n Puppet.debug(\"all_instances - cached instances is: #{cached_instances}\")\n Puppet.debug(\"all_instances - cached instances object id: #{cached_instances.object_id}\")\n # return cache if it has been created, this means that this function will only need\n # to be loaded once, returning all instances that exist of this resource in vsphere\n # then, we can lookup our version by name/id/whatever. This saves a TON of processing\n return cached_instances unless cached_instances.nil?\n\n # Want to return an array of instances\n # each hash should have the same properties as the properties\n # of this \"type\"\n # remember the keys should be symbols, aka :ntp_servers not 'ntp_servers'\n # This is a tracking hash which will contain info about each host and NTP server relationships\n cmd = <<-EOF\n $ntp_servers_hash = @{}\n $hosts = #{powercli_get_online_hosts}\n foreach($h in $hosts) {\n $servers = Get-VMHostNtpServer -VMHost $h\n if ($servers) {\n $ntp_servers_hash[$h.Name] = @($servers)\n } else {\n $ntp_servers_hash[$h.Name] = @()\n }\n }\n $ntp_servers_hash | ConvertTo-Json\n EOF\n\n ntpservers_stdout = powercli_connect_exec(cmd)[:stdout]\n # json parse expects a json string, powershell does not stdout with quotes\n # we might be able to remove this line because powershell exits with a viable ruby array already:\n # [\n # \"time1.dev.encore.tech\",\n # \"time2.dev.encore.tech\"\n # ]\n # what happens if this returns null??\n ntpservers_hash = JSON.parse(ntpservers_stdout)\n\n # create instance hash - this contains info about ONE host at a time\n # the values should match the data \"shape\" (ie have the same fields) as our\n # type.\n # the key, should be the title/namevar so we can do a lookup in our\n # read_instance function\n cached_instances_set({})\n ntpservers_hash.each do |esx_host, ntp_servers_array|\n cached_instances[esx_host] = {\n ensure: :present,\n esx_host: esx_host,\n ntp_servers: ntp_servers_array,\n }\n end\n Puppet.debug(\"all_instances - cached instances is at end: #{cached_instances}\")\n Puppet.debug(\"all_instances - cached instances object_id at end: #{cached_instances.object_id}\")\n cached_instances\n end", "def read_all_policy_service_instances_for_tier1_with_http_info(tier_1_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstanceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_all_policy_service_instances_for_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_all_policy_service_instances_for_tier1_0(tier_1_id, locale_service_id, opts = {})\n data, _status_code, _headers = read_all_policy_service_instances_for_tier1_0_with_http_info(tier_1_id, locale_service_id, opts)\n data\n end", "def read_all_policy_service_instances_for_tier1_0_with_http_info(tier_1_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1_0\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstanceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_all_policy_service_instances_for_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def load_records\n native_instance(true)\n native_instance.top(limit) if limit.present?\n Array(service.native_instance.execute)\n end", "def services\n related_objects_by_type(\"Service\")\n end", "def services\n\t\tService.find(:all)\n\tend", "def read_facts_xinetd_services(srvs, type = 'std')\n xinetd_services = {}\n\n srvs.each do |srv|\n srv_name = \"srv_#{srv}\"\n xinetd_services[srv_name] = check_xinetd_service(srv, type)\n end\n\n xinetd_services\nend", "def read_vms\n end", "def all\n @service.all\n end", "def instances\n Egi::Fedcloud::Vmhound::Log.info \"[#{self.class}] Retrieving active instances\"\n fetch_instances\n end", "def index\n @idti_services = IdtiService.all\n end", "def read_tier1(tier_1_id, opts = {})\n data, _status_code, _headers = read_tier1_with_http_info(tier_1_id, opts)\n data\n end", "def index\n @tb_servicios = TbServicio.all\n end", "def all(params=nil)\n instance = ConektaObject.new\n url = Util.types[self.class_name.downcase].url\n requestor = Requestor.new\n response = requestor.request(:get, url)\n instance.load_from(response)\n instance\n end", "def list_tier1_byod_policy_service_instances(tier_1_id, locale_service_id, opts = {})\n data, _status_code, _headers = list_tier1_byod_policy_service_instances_with_http_info(tier_1_id, locale_service_id, opts)\n data\n end", "def index\n @sermon_reflections = SermonReflection.all\n # @event_sermon_reflections = EventSermonReflection.all\n end", "def all_instances\n Puppet.debug(\"all_instances - cached instances is: #{cached_instances}\")\n Puppet.debug(\"all_instances - cached instances object id: #{cached_instances.object_id}\")\n # return cache if it has been created, this means that this function will only need\n # to be loaded once, returning all instances that exist of this resource in vsphere\n # then, we can lookup our version by name/id/whatever. This saves a TON of processing\n return cached_instances unless cached_instances.nil?\n\n # Fetch the current status of the portgroup\n cmd = <<-EOF\n $portgroup_hash = @{}\n $hosts = #{powercli_get_online_hosts}\n foreach($h in $hosts) {\n # We silently continue on errors otherwise PowerCLI creates an error if the\n # portgroup does not exist on the host which pollutes our $portgroup_hash return object\n $pg = Get-VirtualSwitch -Host $h -Standard -Name #{resource[:vswitch_name]} | Get-VirtualPortGroup -Name #{resource[:portgroup]} -ErrorAction SilentlyContinue\n if ($pg) {\n $obj_hash = @{}\n $obj_hash.Add('portgroup', $pg.Name)\n $obj_hash.Add('vlan', $pg.VLanId)\n $obj_hash.Add('vswitch_name', $pg.VirtualSwitchName)\n $portgroup_hash[$h.Name] = @($obj_hash)\n } else {\n # create empty hashtable\n $obj_hash = @{}\n $portgroup_hash[$h.Name] = @($obj_hash)\n }\n }\n $portgroup_hash | ConvertTo-Json\n EOF\n\n portgroups_stdout = powercli_connect_exec(cmd)[:stdout]\n\n unless portgroups_stdout.empty?\n portgroups_hash = JSON.parse(portgroups_stdout)\n cached_instances_set({})\n portgroups_hash.each do |esx_host, pg_array|\n # Extracting hash from array object\n pg_hash = pg_array[0]\n cached_instances[esx_host] = {\n ensure: :present,\n esx_host: esx_host,\n vswitch_name: pg_hash['vswitch_name'],\n vlan: pg_hash['vlan'],\n portgroup: pg_hash['portgroup'],\n }\n end\n end\n Puppet.debug(\"all_instances - cached instances is at end: #{cached_instances}\")\n Puppet.debug(\"all_instances - cached instances object_id at end: #{cached_instances.object_id}\")\n cached_instances\n end", "def index\n @invoice_services = InvoiceService.all\n end", "def read_service_types()\n types = []\n @client.services.each do |type|\n types << type.label\n end\n\n types\n end", "def list_tier1_locale_services_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServicesListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#list_tier1_locale_services\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_instances\n instances = [ ]\n get_clouds.each do |cloud|\n instances += cloud.instances.index(:filter => [], :view => 'tiny')\n end\n instances\n end", "def main_services\n main_co.services\n end", "def vault_objects(vault_id)\n request_get(\"/vault/#{vault_id}\")\n end", "def list_tier1_locale_services_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services_0\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServicesListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#list_tier1_locale_services_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_0(tier_1_id, opts = {})\n data, _status_code, _headers = read_tier1_0_with_http_info(tier_1_id, opts)\n data\n end", "def list_tier1(opts = {})\n data, _status_code, _headers = list_tier1_with_http_info(opts)\n data\n end", "def get_all(options = {})\n custom_params = options[:dc] ? use_named_parameter('dc', options[:dc]) : nil\n ret = send_get_request(@conn, ['/v1/catalog/nodes'], options, custom_params)\n JSON.parse(ret.body).map { |service| OpenStruct.new service }\n end", "def instances\n instances = []\n JSON.parse(resource['/instances'].get)[\"instances\"].each do |i|\n instances << Instance.new(i)\n end\n return instances\n end", "def index\n @service_classes = ServiceClass.all\n end", "def services\n unless @services\n rows = database.view(VIEW_NAME, reduce: false, key: [1, name])['rows'] rescue []\n ids = rows.map {|row| row['value'] }\n @services = Service.all.keys(ids).to_a\n end\n @services\n end", "def read_tier1_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#read_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def fetch_instance(shortname = :all, options = {})\n return instances if instances && !options[:force]\n\n fetch_stack\n unless instance_list\n self.instance_list = self.instances =\n aws_client.describe_instances(stack_id: stack[:stack_id])[:instances]\n end\n\n if shortname != :all\n fetch_layer(shortname, force: true)\n self.instances = []\n\n layers.each do |layer|\n instance = aws_client.describe_instances(\n layer_id: layer[:layer_id])\n self.instances << instance[:instances]\n end\n\n self.instances.flatten!\n end\n end", "def all\n containers = service.list_containers\n data = []\n containers.each do |container|\n c = parse_storage_object(container)\n c[:acl] = 'unknown'\n data << c\n end\n load(data)\n end", "def read_tier1_byod_policy_service_instance_0(tier_1_id, locale_service_id, service_instance_id, opts = {})\n data, _status_code, _headers = read_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts)\n data\n end", "def get_all_sobjects(type)\n case type\n when 'Account'\n records = @client.materialize(type).query(\"Agents__c != ''\")\n when 'ccrmbasic__Email__c'\n records = @client.materialize(type).query(\"ccrmbasic__Contact__c != ''\")\n else\n records = @client.materialize(type).all\n end\n sobjects = records.dup.to_a\n while records.next_page?\n sobjects += records.next_page\n records = records.next_page\n end\n sobjects\n end", "def load_services(svcs)\n unless @services\n @services = Gruf.services.concat(svcs)\n @services.uniq!\n end\n @services\n end", "def index\n page = params[:page]\n per_page = (params[:per_page] || 10).to_i\n if page\n entities = _all_instances_query.page(page).per(per_page)\n render json: entities, entity: _get_class,\n meta: { total_pages: entities.total_pages, total_count: entities.total_count }\n else\n entities = _all_instances_query\n respond_with entities, entity: '_get_class'\n end\n end", "def read_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#read_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_tier1_byod_policy_service_instances_0(tier_1_id, locale_service_id, opts = {})\n data, _status_code, _headers = list_tier1_byod_policy_service_instances_0_with_http_info(tier_1_id, locale_service_id, opts)\n data\n end", "def instances\n IbmCloudRest.get \"#{@uri}/instances\"\n end", "def get_records(type)\n if @action == 'initial_run'\n @logger.info \"Getting all records from SalesForce for #{type}\"\n records = get_all_sobjects(type)\n else\n @logger.info \"Getting records for yesterday from SalesForce for #{type}\"\n records = @client.materialize(type)\n \n datetime = DateTime.now\n datetime = datetime -= 1\n records.query(\"lastmodifieddate >= #{datetime}\")\n end\n end", "def resources(oneview_type = nil, oneview_name = nil)\n oneview_type = @options[:oneview_type] if oneview_type.nil?\n oneview_name = @options[:oneview_name] if oneview_name.nil?\n raise 'Oneview resource type must be specified.' if oneview_type.nil?\n\n # Determine the endpoint that needs to be called\n endpoint = format('/rest/%s', oneview_type)\n\n # Find the resources\n response = oneview_client.rest_get(endpoint)\n resources = oneview_client.response_handler(response)\n\n return resources if oneview_name.nil?\n\n # Filter the resources by the name if it has been specified\n resources['members'].select { |r| r['name'] == oneview_name }\n end", "def init_instances\n instances = []\n next_token = nil\n all_records_retrieved = false\n\n until all_records_retrieved\n response = @@client.describe_instances({\n next_token: next_token\n })\n next_token = response.next_token\n all_records_retrieved = next_token.nil? || next_token.empty?\n instances << response.reservations.map { |r| r.instances }\n end\n\n instances.flatten\n end", "def read_tier1_byod_policy_service_instance(tier_1_id, locale_service_id, service_instance_id, opts = {})\n data, _status_code, _headers = read_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts)\n data\n end", "def read_all_policy_service_instances_for_tier0(tier_0_id, locale_service_id, opts = {})\n data, _status_code, _headers = read_all_policy_service_instances_for_tier0_with_http_info(tier_0_id, locale_service_id, opts)\n data\n end", "def services\n\t\tselect {|x| x.class == Service }\n\tend", "def read_service_payments\r\n read_service_payment while peek == 'SVC'\r\n self\r\n end", "def active_instances\n Egi::Fedcloud::Vmhound::Log.info \"[#{self.class}] Retrieving running instances\"\n fetch_instances ['ACTIVE']\n end", "def index\n @servicos = Servico.all\n end", "def index\n @customer_services = CustomerService.all\n end", "def query_for_services(type = nil, pool = nil)\n\n raise \"Type must not be nil if pool is nil\" if type.nil? && !pool.nil?\n\n @discovery_urls.each do |discovery_url|\n resource = \"/v1/service\"\n resource += \"/#{type}\" if ! type.nil?\n resource += \"/#{pool}\" if ! pool.nil?\n\n service_uri = URI.parse(discovery_url).merge(resource)\n\n @logger.debug(\"Get Request: #{service_uri.to_s}\")\n\n begin\n response = @client.get(service_uri.to_s, nil, nil)\n\n if response.status >= 200 && response.status <= 299\n service_data = JSON.parse(response.body)\n\n return service_data\n end\n\n @logger.error(\"#{service_uri.to_s}: Response Status #{response.status}\")\n @logger.error(response.body)\n\n rescue\n @logger.error(\"#{service_uri.to_s}: #{$!}\")\n end\n\n end\n\n raise \"Failed to get all services from any of [ #{@discovery_urls.join(\",\")} ]\"\n\n end", "def index\n @servicemen = Serviceman.all\n end", "def list_services\n @services\n end", "def index\n @registro_servicios = Registro::Servicio.all\n end", "def object_instances\n return [] if object_definition.blank?\n \n latest_version = ::AP::VoiceExtension::Voice::Config.instance.latest_version\n klazz = \"::#{latest_version.upcase}::#{object_definition.name}\".constantize\n query_scope = object_definition.query_scope\n objects = klazz.respond_to?(query_scope.to_sym) ? klazz.send(query_scope.to_sym) : []\n if objects.blank?\n return []\n else\n return objects\n end\n end", "def instances(type)\n @instances[type]\n end", "def index\n @service_tables = ServiceTable.all\n end", "def index\n @request_services = RequestService.all\n end", "def get_services(sObjectType, oParams)\n case sObjectType\n when :services\n # oParams[sObjectType] will provide the controller object.\n # This one can be interpreted only by controller code,\n # except if controller declares how to map with this object.\n # Processes can deal only process mapped data.\n # Currently there is no services process function. No need to map.\n services = oParams[:services]\n if !oParams[:list_services].is_a?(Array)\n service_to_find = [oParams[:list_services]]\n else\n service_to_find = oParams[:list_services]\n end\n # Search for service. Ex: Can be :Networking or network. I currently do\n # not know why...\n search_services = services.rh_get(:service_catalog)\n service = nil\n service_to_find.each do |sServiceElem|\n if search_services.key?(sServiceElem)\n service = sServiceElem\n break\n end\n end\n\n controller_error 'Unable to find services %s',\n service_to_find if service.nil?\n result = services.rh_get(:service_catalog, service).keys\n result.delete('name')\n result.each_index do |iIndex|\n result[iIndex] = result[iIndex].to_s if result[iIndex].is_a?(Symbol)\n end\n return result\n else\n controller_error \"'%s' is not a valid object for 'get_services'\",\n sObjectType\n end\n end", "def read_tier1_locale_services_with_http_info(tier_1_id, locale_services_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#read_tier1_locale_services\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def fetch_databag_tenants\n db_tenants = Array.new\n chef_api_connect.search.query(:foundation, '*:*', start: 0).rows.each do |tenant|\n db_tenants << tenant['raw_data']['id']\n end\n return db_tenants\nend", "def load_objects\n instance_variable_set(\"@#{model_name.underscore.pluralize}\", (@instances = model.where(params || {}) rescue nil))\n end", "def index\n @emt_services = EmtService.all\n end", "def index\n\t@aservices = Aservice.all #@aservices variable de clase\n end", "def read_vms\n args = %w[list --all --no-header --json -o name,uuid]\n vms_arr = json { execute_prlctl(*args) }\n templates_arr = json { execute_prlctl(*args, '--template') }\n\n vms = vms_arr | templates_arr\n Hash[vms.map { |i| [i.fetch('name'), i.fetch('uuid')] }]\n end", "def read_tier1_locale_services(tier_1_id, locale_services_id, opts = {})\n data, _status_code, _headers = read_tier1_locale_services_with_http_info(tier_1_id, locale_services_id, opts)\n data\n end", "def vm_instances\n @conn.vminstances\n end", "def get_all_replicas(id, options = GetAllReplicasOptions.new) end", "def list_services(client, args, options)\n response = client.get(RESOURCE_PATH)\n\n if CloudClient::is_error?(response)\n [response.code.to_i, response.to_s]\n else\n #[0,response.body]\n if options[:json]\n [0,response.body]\n else\n array_list = JSON.parse(response.body)\n SERVICE_TABLE.show(array_list['DOCUMENT_POOL']['DOCUMENT'])\n 0\n end\n end\nend", "def get_services\n reply = @client.call(:get_services)\n\n data = reply.body.dig(:get_services_response,\n :get_services_result,\n :array_of_string)\n data = check_if_data_exists(data)\n\n data.map do |attrs|\n {\n id: Integer(attrs[:string][0], 10),\n name: attrs[:string][1]\n }\n end\n end", "def read(query)\n connect if @persevere.nil?\n query = Persevere.enhance(query)\n \n resources = Array.new\n tblname = query.model.storage_name\n \n json_query, headers = query.to_json_query\n \n path = \"/#{tblname}/#{json_query}\"\n DataMapper.logger.debug(\"--> PATH/QUERY/HEADERS: #{path} #{headers.inspect}\")\n \n response = @persevere.retrieve(path, headers)\n \n if response.code.match(/20?/)\n results = JSON.parse(response.body)\n results.each do |rsrc_hash|\n # Typecast attributes, DM expects them properly cast\n query.fields.each do |prop|\n object_reference = false\n pname = prop.field.to_s\n\n value = rsrc_hash[pname]\n # Dereference references\n unless value.nil?\n if prop.field == 'id'\n rsrc_hash[pname] = prop.typecast(value.to_s.match(/(#{tblname})?\\/?([a-zA-Z0-9_-]+$)/)[2])\n else\n rsrc_hash[pname] = prop.typecast(value)\n end\n end\n # Shift date/time objects to the correct timezone because persevere is UTC\n case prop \n when DateTime then rsrc_hash[pname] = value.new_offset(Rational(Time.now.getlocal.gmt_offset/3600, 24))\n when Time then rsrc_hash[pname] = value.getlocal\n end\n end\n end\n resources = query.model.load(results, query)\n end\n # We could almost elimate this if regexp was working in persevere.\n\n # This won't work if the RegExp is nested more then 1 layer deep.\n if query.conditions.class == DataMapper::Query::Conditions::AndOperation\n regexp_conds = query.conditions.operands.select do |obj| \n obj.is_a?(DataMapper::Query::Conditions::RegexpComparison) || \n ( obj.is_a?(DataMapper::Query::Conditions::NotOperation) && obj.operand.is_a?(DataMapper::Query::Conditions::RegexpComparison) )\n end\n regexp_conds.each{|cond| resources = resources.select{|resource| cond.matches?(resource)} }\n \n end\n\n # query.match_records(resources)\n resources\n end", "def index\n @service_particulars = ServiceParticular.all\n @service_particular = ServiceParticular.new\n end", "def list_tier1_locale_services(tier_1_id, opts = {})\n data, _status_code, _headers = list_tier1_locale_services_with_http_info(tier_1_id, opts)\n data\n end", "def index\n @clientes_servicos = ClientesServico.all\n end", "def multiple_get_objects(requests, opts = {})\n @transporter.read(:POST, '/1/indexes/*/objects', { requests: requests }, opts)\n end", "def index\n @loan_servicers = LoanServicer.all\n end", "def list_instances(request_id)\n instances = []\n JSON.parse(resource[\"/requests/#{request_id}\"].get)[\"instances\"].each do |i|\n instances << Instance.new(i)\n end\n end", "def read_tier1_locale_services_0_with_http_info(tier_1_id, locale_services_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#read_tier1_locale_services_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def listserv\n listservs.first\n end", "def getVMs\n @vms = VirtualMachine.all(@ip_address)\n end", "def index\n @ordem_servicos = OrdemServico.all\n end", "def index\n @ordem_servicos = OrdemServico.all\n end", "def index\n @item_tiers = ItemTier.all\n end", "def list_tier1_byod_policy_service_instances_with_http_info(tier_1_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstanceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#list_tier1_byod_policy_service_instances\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_objects(syncer, query, status)\n\t\traise \"getObjects: Not Implemented\"\n\t\t\n\t\t# object_list = []\n\t\t# #for each object that matches the query\n\t\t# # object = an active record database object that contains the information from the store object\n\t\t# # store_object_id = the object_id of the store object\n\t\t# object.set_dbID(syncer, self, store_object_id)\n\t\t# object_list.push(object)\n\t\t# #end\n\t\t# return object_list\n\tend", "def get_all(options = {})\n custom_params = options[:dc] ? use_named_parameter('dc', options[:dc]) : nil\n ret = send_get_request(@conn, ['/v1/catalog/services'], options, custom_params)\n OpenStruct.new JSON.parse(ret.body)\n end", "def index\n @tipo_de_servicios = TipoDeServicio.all\n end", "def cached_instances\n # Puppet.debug(\"cached_instances - object id: #{PuppetX::PowerCLI::Helper.instance.object_id}\")\n # Puppet.debug(\"cached_instances - resource.type: #{resource.type}\")\n PuppetX::PowerCLI::Helper.instance.cached_instances[resource.type]\n end", "def services\n end", "def instances\n end", "def loadAll()\n # Load the configuration from global.rb\n SHAREDPOOLS.each_key do |k|\n p = Pool.new(k, SHAREDPOOLS[k][:zone],\n SHAREDPOOLS[k][:allocateable_cpus],\n SHAREDPOOLS[k][:allocateable_mem],\n SHAREDPOOLS[k][:service_class])\n\n @poolList.push(p)\n end\n SERVICES.each_key do |k|\n s = Service.new(k, SERVICES[k][:authinfo],\n SERVICES[k][:maxcpus],\n SERVICES[k][:maxmemory],\n SERVICES[k][:priority])\n @svcList.push(s)\n end\n # Load the requests from redis\n @reqList = $eventProcessor.loadRequests()\n # Compute the free/used stats from state of requests\n @reqList.each { |req|\n if req.status == \"ALLOCATED\"\n pmatches = @poolList.select {|p| p.name == req.pool}\n if pmatches == nil || pmatches[0] == nil\n $Logger.error \"Unable to find pool #{req.pool} for ALLOCATED request #{req.reqid}\"\n next\n end\n smatches = @svcList.select {|s| s.name == req.service}\n if smatches == nil || smatches[0] == nil\n $Logger.error \"Unable to find service #{req.service} for ALLOCATED request #{req.reqid}\"\n next\n end\n pool = pmatches[0]\n pool.availvcpus = pool.availvcpus.to_i - req.vcpus.to_i\n pool.availmem = pool.availmem.to_i - req.mem.to_i\n service = smatches[0]\n service.vcpusallocated = service.vcpusallocated.to_i + req.vcpus.to_i\n service.memallocated = service.memallocated.to_i + req.mem.to_i\n end\n }\n end", "def acquire_service_data\n if config[:tags] && config[:service]\n tags = config[:tags].split(',').to_set\n services = []\n Diplomat::Health.service(config[:service]).each do |s|\n if s['Service']['Tags'].to_set.superset? tags\n services.push(*s['Checks'])\n end\n end\n services\n elsif config[:nodename]\n data = []\n begin\n services = Diplomat::Node.get(config[:nodename]).Services\n rescue StandardError\n services = {}\n end\n services.each_value do |service|\n Diplomat::Health.checks(service['Service']).each do |check|\n data.push(check) if check.Node == config[:nodename]\n end\n end\n data\n elsif config[:all]\n Diplomat::Health.state('any')\n else\n Diplomat::Health.checks(config[:service])\n end\n end", "def read_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_byod_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_all(ts, class_name, uri = '[^\\s]+')\n ts.read_all([:name, class_name, nil, Regexp.new(uri + '/\\d+')])\n end", "def read_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def in_service_instances\n instances([{name: :lifecycle_state, value: \"InService\"}])\n end", "def loaded_instances(type)\n @instances[type].keys\n end", "def list_instances(an_array)\n SystemRepository.__list_instances(an_array)\n end", "def get_pvm_instances\n pvm_instances = get(\"cloud-instances/#{guid}/pvm-instances\")[\"pvmInstances\"] || []\n\n pvm_instances.map do |pvm_instance|\n get_pvm_instance(pvm_instance[\"pvmInstanceID\"])\n end\n end" ]
[ "0.58823484", "0.57199717", "0.5642335", "0.5568558", "0.5564773", "0.55645937", "0.55250674", "0.5434599", "0.54015064", "0.53887016", "0.5376201", "0.5374497", "0.5331375", "0.5279669", "0.5268225", "0.51972884", "0.51906973", "0.5148846", "0.5145432", "0.5131381", "0.51101583", "0.5108861", "0.5105749", "0.51056945", "0.51028425", "0.51015896", "0.5090501", "0.50813925", "0.5080956", "0.50773734", "0.50675976", "0.5050666", "0.5040666", "0.5035673", "0.50212765", "0.5017287", "0.5010972", "0.5004885", "0.49960408", "0.4993101", "0.49875695", "0.4982664", "0.4979861", "0.49736392", "0.49411988", "0.49355677", "0.49328685", "0.49277744", "0.49273232", "0.4922092", "0.49211013", "0.4919821", "0.4917829", "0.4917284", "0.49153945", "0.4915038", "0.49128383", "0.49054408", "0.48949242", "0.4888216", "0.48861623", "0.48701796", "0.48689106", "0.486666", "0.4862649", "0.48571438", "0.48557928", "0.4853478", "0.48480353", "0.4845449", "0.48453864", "0.48436773", "0.48415893", "0.48387867", "0.48276556", "0.4820284", "0.4815394", "0.48142824", "0.48133123", "0.48090947", "0.4806559", "0.47982794", "0.47982794", "0.47965157", "0.47935972", "0.47921264", "0.47904956", "0.47882733", "0.47880468", "0.47854295", "0.47772008", "0.47766542", "0.47764656", "0.47763482", "0.47752532", "0.47691593", "0.47686028", "0.47596037", "0.47591463", "0.47523212" ]
0.59302133
0
Read all service instance objects under a tier1 Read all service instance objects under a tier1
def read_all_policy_service_instances_for_tier1_with_http_info(tier_1_id, locale_service_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1 ...' end # verify the required parameter 'tier_1_id' is set if @api_client.config.client_side_validation && tier_1_id.nil? fail ArgumentError, "Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1" end # verify the required parameter 'locale_service_id' is set if @api_client.config.client_side_validation && locale_service_id.nil? fail ArgumentError, "Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1" end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1, must be smaller than or equal to 1000.' end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1, must be greater than or equal to 0.' end # resource path local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s) # query parameters query_params = {} query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil? query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil? query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil? query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil? query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'PolicyServiceInstanceListResult') if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_all_policy_service_instances_for_tier1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_all_policy_service_instances_for_tier1(tier_1_id, locale_service_id, opts = {})\n data, _status_code, _headers = read_all_policy_service_instances_for_tier1_with_http_info(tier_1_id, locale_service_id, opts)\n data\n end", "def all_instances\n Puppet.debug(\"all_instances - cached instances is: #{cached_instances}\")\n Puppet.debug(\"all_instances - cached instances object id: #{cached_instances.object_id}\")\n # return cache if it has been created, this means that this function will only need\n # to be loaded once, returning all instances that exist of this resource in vsphere\n # then, we can lookup our version by name/id/whatever. This saves a TON of processing\n return cached_instances unless cached_instances.nil?\n\n # Want to return an array of instances\n # each hash should have the same properties as the properties\n # of this \"type\"\n # remember the keys should be symbols, aka :ntp_servers not 'ntp_servers'\n # This is a tracking hash which will contain info about each host and NTP server relationships\n cmd = <<-EOF\n $ntp_servers_hash = @{}\n $hosts = #{powercli_get_online_hosts}\n foreach($h in $hosts) {\n $servers = Get-VMHostNtpServer -VMHost $h\n if ($servers) {\n $ntp_servers_hash[$h.Name] = @($servers)\n } else {\n $ntp_servers_hash[$h.Name] = @()\n }\n }\n $ntp_servers_hash | ConvertTo-Json\n EOF\n\n ntpservers_stdout = powercli_connect_exec(cmd)[:stdout]\n # json parse expects a json string, powershell does not stdout with quotes\n # we might be able to remove this line because powershell exits with a viable ruby array already:\n # [\n # \"time1.dev.encore.tech\",\n # \"time2.dev.encore.tech\"\n # ]\n # what happens if this returns null??\n ntpservers_hash = JSON.parse(ntpservers_stdout)\n\n # create instance hash - this contains info about ONE host at a time\n # the values should match the data \"shape\" (ie have the same fields) as our\n # type.\n # the key, should be the title/namevar so we can do a lookup in our\n # read_instance function\n cached_instances_set({})\n ntpservers_hash.each do |esx_host, ntp_servers_array|\n cached_instances[esx_host] = {\n ensure: :present,\n esx_host: esx_host,\n ntp_servers: ntp_servers_array,\n }\n end\n Puppet.debug(\"all_instances - cached instances is at end: #{cached_instances}\")\n Puppet.debug(\"all_instances - cached instances object_id at end: #{cached_instances.object_id}\")\n cached_instances\n end", "def read_all_policy_service_instances_for_tier1_0(tier_1_id, locale_service_id, opts = {})\n data, _status_code, _headers = read_all_policy_service_instances_for_tier1_0_with_http_info(tier_1_id, locale_service_id, opts)\n data\n end", "def read_all_policy_service_instances_for_tier1_0_with_http_info(tier_1_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1_0\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstanceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_all_policy_service_instances_for_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def load_records\n native_instance(true)\n native_instance.top(limit) if limit.present?\n Array(service.native_instance.execute)\n end", "def services\n related_objects_by_type(\"Service\")\n end", "def services\n\t\tService.find(:all)\n\tend", "def read_facts_xinetd_services(srvs, type = 'std')\n xinetd_services = {}\n\n srvs.each do |srv|\n srv_name = \"srv_#{srv}\"\n xinetd_services[srv_name] = check_xinetd_service(srv, type)\n end\n\n xinetd_services\nend", "def read_vms\n end", "def all\n @service.all\n end", "def instances\n Egi::Fedcloud::Vmhound::Log.info \"[#{self.class}] Retrieving active instances\"\n fetch_instances\n end", "def index\n @idti_services = IdtiService.all\n end", "def read_tier1(tier_1_id, opts = {})\n data, _status_code, _headers = read_tier1_with_http_info(tier_1_id, opts)\n data\n end", "def index\n @tb_servicios = TbServicio.all\n end", "def all(params=nil)\n instance = ConektaObject.new\n url = Util.types[self.class_name.downcase].url\n requestor = Requestor.new\n response = requestor.request(:get, url)\n instance.load_from(response)\n instance\n end", "def list_tier1_byod_policy_service_instances(tier_1_id, locale_service_id, opts = {})\n data, _status_code, _headers = list_tier1_byod_policy_service_instances_with_http_info(tier_1_id, locale_service_id, opts)\n data\n end", "def index\n @sermon_reflections = SermonReflection.all\n # @event_sermon_reflections = EventSermonReflection.all\n end", "def all_instances\n Puppet.debug(\"all_instances - cached instances is: #{cached_instances}\")\n Puppet.debug(\"all_instances - cached instances object id: #{cached_instances.object_id}\")\n # return cache if it has been created, this means that this function will only need\n # to be loaded once, returning all instances that exist of this resource in vsphere\n # then, we can lookup our version by name/id/whatever. This saves a TON of processing\n return cached_instances unless cached_instances.nil?\n\n # Fetch the current status of the portgroup\n cmd = <<-EOF\n $portgroup_hash = @{}\n $hosts = #{powercli_get_online_hosts}\n foreach($h in $hosts) {\n # We silently continue on errors otherwise PowerCLI creates an error if the\n # portgroup does not exist on the host which pollutes our $portgroup_hash return object\n $pg = Get-VirtualSwitch -Host $h -Standard -Name #{resource[:vswitch_name]} | Get-VirtualPortGroup -Name #{resource[:portgroup]} -ErrorAction SilentlyContinue\n if ($pg) {\n $obj_hash = @{}\n $obj_hash.Add('portgroup', $pg.Name)\n $obj_hash.Add('vlan', $pg.VLanId)\n $obj_hash.Add('vswitch_name', $pg.VirtualSwitchName)\n $portgroup_hash[$h.Name] = @($obj_hash)\n } else {\n # create empty hashtable\n $obj_hash = @{}\n $portgroup_hash[$h.Name] = @($obj_hash)\n }\n }\n $portgroup_hash | ConvertTo-Json\n EOF\n\n portgroups_stdout = powercli_connect_exec(cmd)[:stdout]\n\n unless portgroups_stdout.empty?\n portgroups_hash = JSON.parse(portgroups_stdout)\n cached_instances_set({})\n portgroups_hash.each do |esx_host, pg_array|\n # Extracting hash from array object\n pg_hash = pg_array[0]\n cached_instances[esx_host] = {\n ensure: :present,\n esx_host: esx_host,\n vswitch_name: pg_hash['vswitch_name'],\n vlan: pg_hash['vlan'],\n portgroup: pg_hash['portgroup'],\n }\n end\n end\n Puppet.debug(\"all_instances - cached instances is at end: #{cached_instances}\")\n Puppet.debug(\"all_instances - cached instances object_id at end: #{cached_instances.object_id}\")\n cached_instances\n end", "def index\n @invoice_services = InvoiceService.all\n end", "def read_service_types()\n types = []\n @client.services.each do |type|\n types << type.label\n end\n\n types\n end", "def list_tier1_locale_services_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServicesListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#list_tier1_locale_services\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_instances\n instances = [ ]\n get_clouds.each do |cloud|\n instances += cloud.instances.index(:filter => [], :view => 'tiny')\n end\n instances\n end", "def main_services\n main_co.services\n end", "def vault_objects(vault_id)\n request_get(\"/vault/#{vault_id}\")\n end", "def list_tier1_locale_services_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services_0\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServicesListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#list_tier1_locale_services_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_0(tier_1_id, opts = {})\n data, _status_code, _headers = read_tier1_0_with_http_info(tier_1_id, opts)\n data\n end", "def list_tier1(opts = {})\n data, _status_code, _headers = list_tier1_with_http_info(opts)\n data\n end", "def get_all(options = {})\n custom_params = options[:dc] ? use_named_parameter('dc', options[:dc]) : nil\n ret = send_get_request(@conn, ['/v1/catalog/nodes'], options, custom_params)\n JSON.parse(ret.body).map { |service| OpenStruct.new service }\n end", "def instances\n instances = []\n JSON.parse(resource['/instances'].get)[\"instances\"].each do |i|\n instances << Instance.new(i)\n end\n return instances\n end", "def index\n @service_classes = ServiceClass.all\n end", "def services\n unless @services\n rows = database.view(VIEW_NAME, reduce: false, key: [1, name])['rows'] rescue []\n ids = rows.map {|row| row['value'] }\n @services = Service.all.keys(ids).to_a\n end\n @services\n end", "def read_tier1_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#read_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def fetch_instance(shortname = :all, options = {})\n return instances if instances && !options[:force]\n\n fetch_stack\n unless instance_list\n self.instance_list = self.instances =\n aws_client.describe_instances(stack_id: stack[:stack_id])[:instances]\n end\n\n if shortname != :all\n fetch_layer(shortname, force: true)\n self.instances = []\n\n layers.each do |layer|\n instance = aws_client.describe_instances(\n layer_id: layer[:layer_id])\n self.instances << instance[:instances]\n end\n\n self.instances.flatten!\n end\n end", "def all\n containers = service.list_containers\n data = []\n containers.each do |container|\n c = parse_storage_object(container)\n c[:acl] = 'unknown'\n data << c\n end\n load(data)\n end", "def read_tier1_byod_policy_service_instance_0(tier_1_id, locale_service_id, service_instance_id, opts = {})\n data, _status_code, _headers = read_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts)\n data\n end", "def get_all_sobjects(type)\n case type\n when 'Account'\n records = @client.materialize(type).query(\"Agents__c != ''\")\n when 'ccrmbasic__Email__c'\n records = @client.materialize(type).query(\"ccrmbasic__Contact__c != ''\")\n else\n records = @client.materialize(type).all\n end\n sobjects = records.dup.to_a\n while records.next_page?\n sobjects += records.next_page\n records = records.next_page\n end\n sobjects\n end", "def load_services(svcs)\n unless @services\n @services = Gruf.services.concat(svcs)\n @services.uniq!\n end\n @services\n end", "def index\n page = params[:page]\n per_page = (params[:per_page] || 10).to_i\n if page\n entities = _all_instances_query.page(page).per(per_page)\n render json: entities, entity: _get_class,\n meta: { total_pages: entities.total_pages, total_count: entities.total_count }\n else\n entities = _all_instances_query\n respond_with entities, entity: '_get_class'\n end\n end", "def read_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#read_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_tier1_byod_policy_service_instances_0(tier_1_id, locale_service_id, opts = {})\n data, _status_code, _headers = list_tier1_byod_policy_service_instances_0_with_http_info(tier_1_id, locale_service_id, opts)\n data\n end", "def instances\n IbmCloudRest.get \"#{@uri}/instances\"\n end", "def get_records(type)\n if @action == 'initial_run'\n @logger.info \"Getting all records from SalesForce for #{type}\"\n records = get_all_sobjects(type)\n else\n @logger.info \"Getting records for yesterday from SalesForce for #{type}\"\n records = @client.materialize(type)\n \n datetime = DateTime.now\n datetime = datetime -= 1\n records.query(\"lastmodifieddate >= #{datetime}\")\n end\n end", "def resources(oneview_type = nil, oneview_name = nil)\n oneview_type = @options[:oneview_type] if oneview_type.nil?\n oneview_name = @options[:oneview_name] if oneview_name.nil?\n raise 'Oneview resource type must be specified.' if oneview_type.nil?\n\n # Determine the endpoint that needs to be called\n endpoint = format('/rest/%s', oneview_type)\n\n # Find the resources\n response = oneview_client.rest_get(endpoint)\n resources = oneview_client.response_handler(response)\n\n return resources if oneview_name.nil?\n\n # Filter the resources by the name if it has been specified\n resources['members'].select { |r| r['name'] == oneview_name }\n end", "def init_instances\n instances = []\n next_token = nil\n all_records_retrieved = false\n\n until all_records_retrieved\n response = @@client.describe_instances({\n next_token: next_token\n })\n next_token = response.next_token\n all_records_retrieved = next_token.nil? || next_token.empty?\n instances << response.reservations.map { |r| r.instances }\n end\n\n instances.flatten\n end", "def read_tier1_byod_policy_service_instance(tier_1_id, locale_service_id, service_instance_id, opts = {})\n data, _status_code, _headers = read_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts)\n data\n end", "def read_all_policy_service_instances_for_tier0(tier_0_id, locale_service_id, opts = {})\n data, _status_code, _headers = read_all_policy_service_instances_for_tier0_with_http_info(tier_0_id, locale_service_id, opts)\n data\n end", "def services\n\t\tselect {|x| x.class == Service }\n\tend", "def read_service_payments\r\n read_service_payment while peek == 'SVC'\r\n self\r\n end", "def active_instances\n Egi::Fedcloud::Vmhound::Log.info \"[#{self.class}] Retrieving running instances\"\n fetch_instances ['ACTIVE']\n end", "def index\n @servicos = Servico.all\n end", "def index\n @customer_services = CustomerService.all\n end", "def query_for_services(type = nil, pool = nil)\n\n raise \"Type must not be nil if pool is nil\" if type.nil? && !pool.nil?\n\n @discovery_urls.each do |discovery_url|\n resource = \"/v1/service\"\n resource += \"/#{type}\" if ! type.nil?\n resource += \"/#{pool}\" if ! pool.nil?\n\n service_uri = URI.parse(discovery_url).merge(resource)\n\n @logger.debug(\"Get Request: #{service_uri.to_s}\")\n\n begin\n response = @client.get(service_uri.to_s, nil, nil)\n\n if response.status >= 200 && response.status <= 299\n service_data = JSON.parse(response.body)\n\n return service_data\n end\n\n @logger.error(\"#{service_uri.to_s}: Response Status #{response.status}\")\n @logger.error(response.body)\n\n rescue\n @logger.error(\"#{service_uri.to_s}: #{$!}\")\n end\n\n end\n\n raise \"Failed to get all services from any of [ #{@discovery_urls.join(\",\")} ]\"\n\n end", "def index\n @servicemen = Serviceman.all\n end", "def list_services\n @services\n end", "def index\n @registro_servicios = Registro::Servicio.all\n end", "def object_instances\n return [] if object_definition.blank?\n \n latest_version = ::AP::VoiceExtension::Voice::Config.instance.latest_version\n klazz = \"::#{latest_version.upcase}::#{object_definition.name}\".constantize\n query_scope = object_definition.query_scope\n objects = klazz.respond_to?(query_scope.to_sym) ? klazz.send(query_scope.to_sym) : []\n if objects.blank?\n return []\n else\n return objects\n end\n end", "def instances(type)\n @instances[type]\n end", "def index\n @service_tables = ServiceTable.all\n end", "def index\n @request_services = RequestService.all\n end", "def get_services(sObjectType, oParams)\n case sObjectType\n when :services\n # oParams[sObjectType] will provide the controller object.\n # This one can be interpreted only by controller code,\n # except if controller declares how to map with this object.\n # Processes can deal only process mapped data.\n # Currently there is no services process function. No need to map.\n services = oParams[:services]\n if !oParams[:list_services].is_a?(Array)\n service_to_find = [oParams[:list_services]]\n else\n service_to_find = oParams[:list_services]\n end\n # Search for service. Ex: Can be :Networking or network. I currently do\n # not know why...\n search_services = services.rh_get(:service_catalog)\n service = nil\n service_to_find.each do |sServiceElem|\n if search_services.key?(sServiceElem)\n service = sServiceElem\n break\n end\n end\n\n controller_error 'Unable to find services %s',\n service_to_find if service.nil?\n result = services.rh_get(:service_catalog, service).keys\n result.delete('name')\n result.each_index do |iIndex|\n result[iIndex] = result[iIndex].to_s if result[iIndex].is_a?(Symbol)\n end\n return result\n else\n controller_error \"'%s' is not a valid object for 'get_services'\",\n sObjectType\n end\n end", "def read_tier1_locale_services_with_http_info(tier_1_id, locale_services_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#read_tier1_locale_services\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def fetch_databag_tenants\n db_tenants = Array.new\n chef_api_connect.search.query(:foundation, '*:*', start: 0).rows.each do |tenant|\n db_tenants << tenant['raw_data']['id']\n end\n return db_tenants\nend", "def load_objects\n instance_variable_set(\"@#{model_name.underscore.pluralize}\", (@instances = model.where(params || {}) rescue nil))\n end", "def index\n @emt_services = EmtService.all\n end", "def index\n\t@aservices = Aservice.all #@aservices variable de clase\n end", "def read_vms\n args = %w[list --all --no-header --json -o name,uuid]\n vms_arr = json { execute_prlctl(*args) }\n templates_arr = json { execute_prlctl(*args, '--template') }\n\n vms = vms_arr | templates_arr\n Hash[vms.map { |i| [i.fetch('name'), i.fetch('uuid')] }]\n end", "def read_tier1_locale_services(tier_1_id, locale_services_id, opts = {})\n data, _status_code, _headers = read_tier1_locale_services_with_http_info(tier_1_id, locale_services_id, opts)\n data\n end", "def vm_instances\n @conn.vminstances\n end", "def get_all_replicas(id, options = GetAllReplicasOptions.new) end", "def list_services(client, args, options)\n response = client.get(RESOURCE_PATH)\n\n if CloudClient::is_error?(response)\n [response.code.to_i, response.to_s]\n else\n #[0,response.body]\n if options[:json]\n [0,response.body]\n else\n array_list = JSON.parse(response.body)\n SERVICE_TABLE.show(array_list['DOCUMENT_POOL']['DOCUMENT'])\n 0\n end\n end\nend", "def get_services\n reply = @client.call(:get_services)\n\n data = reply.body.dig(:get_services_response,\n :get_services_result,\n :array_of_string)\n data = check_if_data_exists(data)\n\n data.map do |attrs|\n {\n id: Integer(attrs[:string][0], 10),\n name: attrs[:string][1]\n }\n end\n end", "def read(query)\n connect if @persevere.nil?\n query = Persevere.enhance(query)\n \n resources = Array.new\n tblname = query.model.storage_name\n \n json_query, headers = query.to_json_query\n \n path = \"/#{tblname}/#{json_query}\"\n DataMapper.logger.debug(\"--> PATH/QUERY/HEADERS: #{path} #{headers.inspect}\")\n \n response = @persevere.retrieve(path, headers)\n \n if response.code.match(/20?/)\n results = JSON.parse(response.body)\n results.each do |rsrc_hash|\n # Typecast attributes, DM expects them properly cast\n query.fields.each do |prop|\n object_reference = false\n pname = prop.field.to_s\n\n value = rsrc_hash[pname]\n # Dereference references\n unless value.nil?\n if prop.field == 'id'\n rsrc_hash[pname] = prop.typecast(value.to_s.match(/(#{tblname})?\\/?([a-zA-Z0-9_-]+$)/)[2])\n else\n rsrc_hash[pname] = prop.typecast(value)\n end\n end\n # Shift date/time objects to the correct timezone because persevere is UTC\n case prop \n when DateTime then rsrc_hash[pname] = value.new_offset(Rational(Time.now.getlocal.gmt_offset/3600, 24))\n when Time then rsrc_hash[pname] = value.getlocal\n end\n end\n end\n resources = query.model.load(results, query)\n end\n # We could almost elimate this if regexp was working in persevere.\n\n # This won't work if the RegExp is nested more then 1 layer deep.\n if query.conditions.class == DataMapper::Query::Conditions::AndOperation\n regexp_conds = query.conditions.operands.select do |obj| \n obj.is_a?(DataMapper::Query::Conditions::RegexpComparison) || \n ( obj.is_a?(DataMapper::Query::Conditions::NotOperation) && obj.operand.is_a?(DataMapper::Query::Conditions::RegexpComparison) )\n end\n regexp_conds.each{|cond| resources = resources.select{|resource| cond.matches?(resource)} }\n \n end\n\n # query.match_records(resources)\n resources\n end", "def index\n @service_particulars = ServiceParticular.all\n @service_particular = ServiceParticular.new\n end", "def list_tier1_locale_services(tier_1_id, opts = {})\n data, _status_code, _headers = list_tier1_locale_services_with_http_info(tier_1_id, opts)\n data\n end", "def index\n @clientes_servicos = ClientesServico.all\n end", "def multiple_get_objects(requests, opts = {})\n @transporter.read(:POST, '/1/indexes/*/objects', { requests: requests }, opts)\n end", "def index\n @loan_servicers = LoanServicer.all\n end", "def list_instances(request_id)\n instances = []\n JSON.parse(resource[\"/requests/#{request_id}\"].get)[\"instances\"].each do |i|\n instances << Instance.new(i)\n end\n end", "def read_tier1_locale_services_0_with_http_info(tier_1_id, locale_services_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#read_tier1_locale_services_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def listserv\n listservs.first\n end", "def getVMs\n @vms = VirtualMachine.all(@ip_address)\n end", "def index\n @ordem_servicos = OrdemServico.all\n end", "def index\n @ordem_servicos = OrdemServico.all\n end", "def index\n @item_tiers = ItemTier.all\n end", "def list_tier1_byod_policy_service_instances_with_http_info(tier_1_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstanceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#list_tier1_byod_policy_service_instances\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_objects(syncer, query, status)\n\t\traise \"getObjects: Not Implemented\"\n\t\t\n\t\t# object_list = []\n\t\t# #for each object that matches the query\n\t\t# # object = an active record database object that contains the information from the store object\n\t\t# # store_object_id = the object_id of the store object\n\t\t# object.set_dbID(syncer, self, store_object_id)\n\t\t# object_list.push(object)\n\t\t# #end\n\t\t# return object_list\n\tend", "def get_all(options = {})\n custom_params = options[:dc] ? use_named_parameter('dc', options[:dc]) : nil\n ret = send_get_request(@conn, ['/v1/catalog/services'], options, custom_params)\n OpenStruct.new JSON.parse(ret.body)\n end", "def index\n @tipo_de_servicios = TipoDeServicio.all\n end", "def cached_instances\n # Puppet.debug(\"cached_instances - object id: #{PuppetX::PowerCLI::Helper.instance.object_id}\")\n # Puppet.debug(\"cached_instances - resource.type: #{resource.type}\")\n PuppetX::PowerCLI::Helper.instance.cached_instances[resource.type]\n end", "def services\n end", "def instances\n end", "def loadAll()\n # Load the configuration from global.rb\n SHAREDPOOLS.each_key do |k|\n p = Pool.new(k, SHAREDPOOLS[k][:zone],\n SHAREDPOOLS[k][:allocateable_cpus],\n SHAREDPOOLS[k][:allocateable_mem],\n SHAREDPOOLS[k][:service_class])\n\n @poolList.push(p)\n end\n SERVICES.each_key do |k|\n s = Service.new(k, SERVICES[k][:authinfo],\n SERVICES[k][:maxcpus],\n SERVICES[k][:maxmemory],\n SERVICES[k][:priority])\n @svcList.push(s)\n end\n # Load the requests from redis\n @reqList = $eventProcessor.loadRequests()\n # Compute the free/used stats from state of requests\n @reqList.each { |req|\n if req.status == \"ALLOCATED\"\n pmatches = @poolList.select {|p| p.name == req.pool}\n if pmatches == nil || pmatches[0] == nil\n $Logger.error \"Unable to find pool #{req.pool} for ALLOCATED request #{req.reqid}\"\n next\n end\n smatches = @svcList.select {|s| s.name == req.service}\n if smatches == nil || smatches[0] == nil\n $Logger.error \"Unable to find service #{req.service} for ALLOCATED request #{req.reqid}\"\n next\n end\n pool = pmatches[0]\n pool.availvcpus = pool.availvcpus.to_i - req.vcpus.to_i\n pool.availmem = pool.availmem.to_i - req.mem.to_i\n service = smatches[0]\n service.vcpusallocated = service.vcpusallocated.to_i + req.vcpus.to_i\n service.memallocated = service.memallocated.to_i + req.mem.to_i\n end\n }\n end", "def acquire_service_data\n if config[:tags] && config[:service]\n tags = config[:tags].split(',').to_set\n services = []\n Diplomat::Health.service(config[:service]).each do |s|\n if s['Service']['Tags'].to_set.superset? tags\n services.push(*s['Checks'])\n end\n end\n services\n elsif config[:nodename]\n data = []\n begin\n services = Diplomat::Node.get(config[:nodename]).Services\n rescue StandardError\n services = {}\n end\n services.each_value do |service|\n Diplomat::Health.checks(service['Service']).each do |check|\n data.push(check) if check.Node == config[:nodename]\n end\n end\n data\n elsif config[:all]\n Diplomat::Health.state('any')\n else\n Diplomat::Health.checks(config[:service])\n end\n end", "def read_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_byod_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_all(ts, class_name, uri = '[^\\s]+')\n ts.read_all([:name, class_name, nil, Regexp.new(uri + '/\\d+')])\n end", "def read_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def in_service_instances\n instances([{name: :lifecycle_state, value: \"InService\"}])\n end", "def loaded_instances(type)\n @instances[type].keys\n end", "def list_instances(an_array)\n SystemRepository.__list_instances(an_array)\n end", "def get_pvm_instances\n pvm_instances = get(\"cloud-instances/#{guid}/pvm-instances\")[\"pvmInstances\"] || []\n\n pvm_instances.map do |pvm_instance|\n get_pvm_instance(pvm_instance[\"pvmInstanceID\"])\n end\n end" ]
[ "0.59302133", "0.58823484", "0.5642335", "0.5568558", "0.5564773", "0.55645937", "0.55250674", "0.5434599", "0.54015064", "0.53887016", "0.5376201", "0.5374497", "0.5331375", "0.5279669", "0.5268225", "0.51972884", "0.51906973", "0.5148846", "0.5145432", "0.5131381", "0.51101583", "0.5108861", "0.5105749", "0.51056945", "0.51028425", "0.51015896", "0.5090501", "0.50813925", "0.5080956", "0.50773734", "0.50675976", "0.5050666", "0.5040666", "0.5035673", "0.50212765", "0.5017287", "0.5010972", "0.5004885", "0.49960408", "0.4993101", "0.49875695", "0.4982664", "0.4979861", "0.49736392", "0.49411988", "0.49355677", "0.49328685", "0.49277744", "0.49273232", "0.4922092", "0.49211013", "0.4919821", "0.4917829", "0.4917284", "0.49153945", "0.4915038", "0.49128383", "0.49054408", "0.48949242", "0.4888216", "0.48861623", "0.48701796", "0.48689106", "0.486666", "0.4862649", "0.48571438", "0.48557928", "0.4853478", "0.48480353", "0.4845449", "0.48453864", "0.48436773", "0.48415893", "0.48387867", "0.48276556", "0.4820284", "0.4815394", "0.48142824", "0.48133123", "0.48090947", "0.4806559", "0.47982794", "0.47982794", "0.47965157", "0.47935972", "0.47921264", "0.47904956", "0.47882733", "0.47880468", "0.47854295", "0.47772008", "0.47766542", "0.47764656", "0.47763482", "0.47752532", "0.47691593", "0.47686028", "0.47596037", "0.47591463", "0.47523212" ]
0.57199717
2
Read all service instance objects under a tier1 Read all service instance objects under a tier1
def read_all_policy_service_instances_for_tier1_0(tier_1_id, locale_service_id, opts = {}) data, _status_code, _headers = read_all_policy_service_instances_for_tier1_0_with_http_info(tier_1_id, locale_service_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_all_policy_service_instances_for_tier1(tier_1_id, locale_service_id, opts = {})\n data, _status_code, _headers = read_all_policy_service_instances_for_tier1_with_http_info(tier_1_id, locale_service_id, opts)\n data\n end", "def all_instances\n Puppet.debug(\"all_instances - cached instances is: #{cached_instances}\")\n Puppet.debug(\"all_instances - cached instances object id: #{cached_instances.object_id}\")\n # return cache if it has been created, this means that this function will only need\n # to be loaded once, returning all instances that exist of this resource in vsphere\n # then, we can lookup our version by name/id/whatever. This saves a TON of processing\n return cached_instances unless cached_instances.nil?\n\n # Want to return an array of instances\n # each hash should have the same properties as the properties\n # of this \"type\"\n # remember the keys should be symbols, aka :ntp_servers not 'ntp_servers'\n # This is a tracking hash which will contain info about each host and NTP server relationships\n cmd = <<-EOF\n $ntp_servers_hash = @{}\n $hosts = #{powercli_get_online_hosts}\n foreach($h in $hosts) {\n $servers = Get-VMHostNtpServer -VMHost $h\n if ($servers) {\n $ntp_servers_hash[$h.Name] = @($servers)\n } else {\n $ntp_servers_hash[$h.Name] = @()\n }\n }\n $ntp_servers_hash | ConvertTo-Json\n EOF\n\n ntpservers_stdout = powercli_connect_exec(cmd)[:stdout]\n # json parse expects a json string, powershell does not stdout with quotes\n # we might be able to remove this line because powershell exits with a viable ruby array already:\n # [\n # \"time1.dev.encore.tech\",\n # \"time2.dev.encore.tech\"\n # ]\n # what happens if this returns null??\n ntpservers_hash = JSON.parse(ntpservers_stdout)\n\n # create instance hash - this contains info about ONE host at a time\n # the values should match the data \"shape\" (ie have the same fields) as our\n # type.\n # the key, should be the title/namevar so we can do a lookup in our\n # read_instance function\n cached_instances_set({})\n ntpservers_hash.each do |esx_host, ntp_servers_array|\n cached_instances[esx_host] = {\n ensure: :present,\n esx_host: esx_host,\n ntp_servers: ntp_servers_array,\n }\n end\n Puppet.debug(\"all_instances - cached instances is at end: #{cached_instances}\")\n Puppet.debug(\"all_instances - cached instances object_id at end: #{cached_instances.object_id}\")\n cached_instances\n end", "def read_all_policy_service_instances_for_tier1_with_http_info(tier_1_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstanceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_all_policy_service_instances_for_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_all_policy_service_instances_for_tier1_0_with_http_info(tier_1_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1_0\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstanceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_all_policy_service_instances_for_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def services\n related_objects_by_type(\"Service\")\n end", "def load_records\n native_instance(true)\n native_instance.top(limit) if limit.present?\n Array(service.native_instance.execute)\n end", "def services\n\t\tService.find(:all)\n\tend", "def read_facts_xinetd_services(srvs, type = 'std')\n xinetd_services = {}\n\n srvs.each do |srv|\n srv_name = \"srv_#{srv}\"\n xinetd_services[srv_name] = check_xinetd_service(srv, type)\n end\n\n xinetd_services\nend", "def read_vms\n end", "def all\n @service.all\n end", "def instances\n Egi::Fedcloud::Vmhound::Log.info \"[#{self.class}] Retrieving active instances\"\n fetch_instances\n end", "def index\n @idti_services = IdtiService.all\n end", "def read_tier1(tier_1_id, opts = {})\n data, _status_code, _headers = read_tier1_with_http_info(tier_1_id, opts)\n data\n end", "def index\n @tb_servicios = TbServicio.all\n end", "def all(params=nil)\n instance = ConektaObject.new\n url = Util.types[self.class_name.downcase].url\n requestor = Requestor.new\n response = requestor.request(:get, url)\n instance.load_from(response)\n instance\n end", "def list_tier1_byod_policy_service_instances(tier_1_id, locale_service_id, opts = {})\n data, _status_code, _headers = list_tier1_byod_policy_service_instances_with_http_info(tier_1_id, locale_service_id, opts)\n data\n end", "def index\n @sermon_reflections = SermonReflection.all\n # @event_sermon_reflections = EventSermonReflection.all\n end", "def all_instances\n Puppet.debug(\"all_instances - cached instances is: #{cached_instances}\")\n Puppet.debug(\"all_instances - cached instances object id: #{cached_instances.object_id}\")\n # return cache if it has been created, this means that this function will only need\n # to be loaded once, returning all instances that exist of this resource in vsphere\n # then, we can lookup our version by name/id/whatever. This saves a TON of processing\n return cached_instances unless cached_instances.nil?\n\n # Fetch the current status of the portgroup\n cmd = <<-EOF\n $portgroup_hash = @{}\n $hosts = #{powercli_get_online_hosts}\n foreach($h in $hosts) {\n # We silently continue on errors otherwise PowerCLI creates an error if the\n # portgroup does not exist on the host which pollutes our $portgroup_hash return object\n $pg = Get-VirtualSwitch -Host $h -Standard -Name #{resource[:vswitch_name]} | Get-VirtualPortGroup -Name #{resource[:portgroup]} -ErrorAction SilentlyContinue\n if ($pg) {\n $obj_hash = @{}\n $obj_hash.Add('portgroup', $pg.Name)\n $obj_hash.Add('vlan', $pg.VLanId)\n $obj_hash.Add('vswitch_name', $pg.VirtualSwitchName)\n $portgroup_hash[$h.Name] = @($obj_hash)\n } else {\n # create empty hashtable\n $obj_hash = @{}\n $portgroup_hash[$h.Name] = @($obj_hash)\n }\n }\n $portgroup_hash | ConvertTo-Json\n EOF\n\n portgroups_stdout = powercli_connect_exec(cmd)[:stdout]\n\n unless portgroups_stdout.empty?\n portgroups_hash = JSON.parse(portgroups_stdout)\n cached_instances_set({})\n portgroups_hash.each do |esx_host, pg_array|\n # Extracting hash from array object\n pg_hash = pg_array[0]\n cached_instances[esx_host] = {\n ensure: :present,\n esx_host: esx_host,\n vswitch_name: pg_hash['vswitch_name'],\n vlan: pg_hash['vlan'],\n portgroup: pg_hash['portgroup'],\n }\n end\n end\n Puppet.debug(\"all_instances - cached instances is at end: #{cached_instances}\")\n Puppet.debug(\"all_instances - cached instances object_id at end: #{cached_instances.object_id}\")\n cached_instances\n end", "def index\n @invoice_services = InvoiceService.all\n end", "def read_service_types()\n types = []\n @client.services.each do |type|\n types << type.label\n end\n\n types\n end", "def list_tier1_locale_services_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServicesListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#list_tier1_locale_services\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_instances\n instances = [ ]\n get_clouds.each do |cloud|\n instances += cloud.instances.index(:filter => [], :view => 'tiny')\n end\n instances\n end", "def vault_objects(vault_id)\n request_get(\"/vault/#{vault_id}\")\n end", "def main_services\n main_co.services\n end", "def list_tier1_locale_services_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services_0\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServicesListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#list_tier1_locale_services_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_0(tier_1_id, opts = {})\n data, _status_code, _headers = read_tier1_0_with_http_info(tier_1_id, opts)\n data\n end", "def list_tier1(opts = {})\n data, _status_code, _headers = list_tier1_with_http_info(opts)\n data\n end", "def instances\n instances = []\n JSON.parse(resource['/instances'].get)[\"instances\"].each do |i|\n instances << Instance.new(i)\n end\n return instances\n end", "def get_all(options = {})\n custom_params = options[:dc] ? use_named_parameter('dc', options[:dc]) : nil\n ret = send_get_request(@conn, ['/v1/catalog/nodes'], options, custom_params)\n JSON.parse(ret.body).map { |service| OpenStruct.new service }\n end", "def index\n @service_classes = ServiceClass.all\n end", "def services\n unless @services\n rows = database.view(VIEW_NAME, reduce: false, key: [1, name])['rows'] rescue []\n ids = rows.map {|row| row['value'] }\n @services = Service.all.keys(ids).to_a\n end\n @services\n end", "def read_tier1_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#read_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def fetch_instance(shortname = :all, options = {})\n return instances if instances && !options[:force]\n\n fetch_stack\n unless instance_list\n self.instance_list = self.instances =\n aws_client.describe_instances(stack_id: stack[:stack_id])[:instances]\n end\n\n if shortname != :all\n fetch_layer(shortname, force: true)\n self.instances = []\n\n layers.each do |layer|\n instance = aws_client.describe_instances(\n layer_id: layer[:layer_id])\n self.instances << instance[:instances]\n end\n\n self.instances.flatten!\n end\n end", "def all\n containers = service.list_containers\n data = []\n containers.each do |container|\n c = parse_storage_object(container)\n c[:acl] = 'unknown'\n data << c\n end\n load(data)\n end", "def read_tier1_byod_policy_service_instance_0(tier_1_id, locale_service_id, service_instance_id, opts = {})\n data, _status_code, _headers = read_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts)\n data\n end", "def get_all_sobjects(type)\n case type\n when 'Account'\n records = @client.materialize(type).query(\"Agents__c != ''\")\n when 'ccrmbasic__Email__c'\n records = @client.materialize(type).query(\"ccrmbasic__Contact__c != ''\")\n else\n records = @client.materialize(type).all\n end\n sobjects = records.dup.to_a\n while records.next_page?\n sobjects += records.next_page\n records = records.next_page\n end\n sobjects\n end", "def load_services(svcs)\n unless @services\n @services = Gruf.services.concat(svcs)\n @services.uniq!\n end\n @services\n end", "def index\n page = params[:page]\n per_page = (params[:per_page] || 10).to_i\n if page\n entities = _all_instances_query.page(page).per(per_page)\n render json: entities, entity: _get_class,\n meta: { total_pages: entities.total_pages, total_count: entities.total_count }\n else\n entities = _all_instances_query\n respond_with entities, entity: '_get_class'\n end\n end", "def list_tier1_byod_policy_service_instances_0(tier_1_id, locale_service_id, opts = {})\n data, _status_code, _headers = list_tier1_byod_policy_service_instances_0_with_http_info(tier_1_id, locale_service_id, opts)\n data\n end", "def read_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#read_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def instances\n IbmCloudRest.get \"#{@uri}/instances\"\n end", "def get_records(type)\n if @action == 'initial_run'\n @logger.info \"Getting all records from SalesForce for #{type}\"\n records = get_all_sobjects(type)\n else\n @logger.info \"Getting records for yesterday from SalesForce for #{type}\"\n records = @client.materialize(type)\n \n datetime = DateTime.now\n datetime = datetime -= 1\n records.query(\"lastmodifieddate >= #{datetime}\")\n end\n end", "def resources(oneview_type = nil, oneview_name = nil)\n oneview_type = @options[:oneview_type] if oneview_type.nil?\n oneview_name = @options[:oneview_name] if oneview_name.nil?\n raise 'Oneview resource type must be specified.' if oneview_type.nil?\n\n # Determine the endpoint that needs to be called\n endpoint = format('/rest/%s', oneview_type)\n\n # Find the resources\n response = oneview_client.rest_get(endpoint)\n resources = oneview_client.response_handler(response)\n\n return resources if oneview_name.nil?\n\n # Filter the resources by the name if it has been specified\n resources['members'].select { |r| r['name'] == oneview_name }\n end", "def init_instances\n instances = []\n next_token = nil\n all_records_retrieved = false\n\n until all_records_retrieved\n response = @@client.describe_instances({\n next_token: next_token\n })\n next_token = response.next_token\n all_records_retrieved = next_token.nil? || next_token.empty?\n instances << response.reservations.map { |r| r.instances }\n end\n\n instances.flatten\n end", "def read_tier1_byod_policy_service_instance(tier_1_id, locale_service_id, service_instance_id, opts = {})\n data, _status_code, _headers = read_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts)\n data\n end", "def read_all_policy_service_instances_for_tier0(tier_0_id, locale_service_id, opts = {})\n data, _status_code, _headers = read_all_policy_service_instances_for_tier0_with_http_info(tier_0_id, locale_service_id, opts)\n data\n end", "def services\n\t\tselect {|x| x.class == Service }\n\tend", "def active_instances\n Egi::Fedcloud::Vmhound::Log.info \"[#{self.class}] Retrieving running instances\"\n fetch_instances ['ACTIVE']\n end", "def read_service_payments\r\n read_service_payment while peek == 'SVC'\r\n self\r\n end", "def index\n @servicos = Servico.all\n end", "def index\n @customer_services = CustomerService.all\n end", "def query_for_services(type = nil, pool = nil)\n\n raise \"Type must not be nil if pool is nil\" if type.nil? && !pool.nil?\n\n @discovery_urls.each do |discovery_url|\n resource = \"/v1/service\"\n resource += \"/#{type}\" if ! type.nil?\n resource += \"/#{pool}\" if ! pool.nil?\n\n service_uri = URI.parse(discovery_url).merge(resource)\n\n @logger.debug(\"Get Request: #{service_uri.to_s}\")\n\n begin\n response = @client.get(service_uri.to_s, nil, nil)\n\n if response.status >= 200 && response.status <= 299\n service_data = JSON.parse(response.body)\n\n return service_data\n end\n\n @logger.error(\"#{service_uri.to_s}: Response Status #{response.status}\")\n @logger.error(response.body)\n\n rescue\n @logger.error(\"#{service_uri.to_s}: #{$!}\")\n end\n\n end\n\n raise \"Failed to get all services from any of [ #{@discovery_urls.join(\",\")} ]\"\n\n end", "def list_services\n @services\n end", "def index\n @servicemen = Serviceman.all\n end", "def index\n @registro_servicios = Registro::Servicio.all\n end", "def object_instances\n return [] if object_definition.blank?\n \n latest_version = ::AP::VoiceExtension::Voice::Config.instance.latest_version\n klazz = \"::#{latest_version.upcase}::#{object_definition.name}\".constantize\n query_scope = object_definition.query_scope\n objects = klazz.respond_to?(query_scope.to_sym) ? klazz.send(query_scope.to_sym) : []\n if objects.blank?\n return []\n else\n return objects\n end\n end", "def instances(type)\n @instances[type]\n end", "def index\n @service_tables = ServiceTable.all\n end", "def index\n @request_services = RequestService.all\n end", "def get_services(sObjectType, oParams)\n case sObjectType\n when :services\n # oParams[sObjectType] will provide the controller object.\n # This one can be interpreted only by controller code,\n # except if controller declares how to map with this object.\n # Processes can deal only process mapped data.\n # Currently there is no services process function. No need to map.\n services = oParams[:services]\n if !oParams[:list_services].is_a?(Array)\n service_to_find = [oParams[:list_services]]\n else\n service_to_find = oParams[:list_services]\n end\n # Search for service. Ex: Can be :Networking or network. I currently do\n # not know why...\n search_services = services.rh_get(:service_catalog)\n service = nil\n service_to_find.each do |sServiceElem|\n if search_services.key?(sServiceElem)\n service = sServiceElem\n break\n end\n end\n\n controller_error 'Unable to find services %s',\n service_to_find if service.nil?\n result = services.rh_get(:service_catalog, service).keys\n result.delete('name')\n result.each_index do |iIndex|\n result[iIndex] = result[iIndex].to_s if result[iIndex].is_a?(Symbol)\n end\n return result\n else\n controller_error \"'%s' is not a valid object for 'get_services'\",\n sObjectType\n end\n end", "def read_tier1_locale_services_with_http_info(tier_1_id, locale_services_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#read_tier1_locale_services\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def load_objects\n instance_variable_set(\"@#{model_name.underscore.pluralize}\", (@instances = model.where(params || {}) rescue nil))\n end", "def fetch_databag_tenants\n db_tenants = Array.new\n chef_api_connect.search.query(:foundation, '*:*', start: 0).rows.each do |tenant|\n db_tenants << tenant['raw_data']['id']\n end\n return db_tenants\nend", "def index\n @emt_services = EmtService.all\n end", "def index\n\t@aservices = Aservice.all #@aservices variable de clase\n end", "def read_vms\n args = %w[list --all --no-header --json -o name,uuid]\n vms_arr = json { execute_prlctl(*args) }\n templates_arr = json { execute_prlctl(*args, '--template') }\n\n vms = vms_arr | templates_arr\n Hash[vms.map { |i| [i.fetch('name'), i.fetch('uuid')] }]\n end", "def read_tier1_locale_services(tier_1_id, locale_services_id, opts = {})\n data, _status_code, _headers = read_tier1_locale_services_with_http_info(tier_1_id, locale_services_id, opts)\n data\n end", "def vm_instances\n @conn.vminstances\n end", "def get_all_replicas(id, options = GetAllReplicasOptions.new) end", "def get_services\n reply = @client.call(:get_services)\n\n data = reply.body.dig(:get_services_response,\n :get_services_result,\n :array_of_string)\n data = check_if_data_exists(data)\n\n data.map do |attrs|\n {\n id: Integer(attrs[:string][0], 10),\n name: attrs[:string][1]\n }\n end\n end", "def list_services(client, args, options)\n response = client.get(RESOURCE_PATH)\n\n if CloudClient::is_error?(response)\n [response.code.to_i, response.to_s]\n else\n #[0,response.body]\n if options[:json]\n [0,response.body]\n else\n array_list = JSON.parse(response.body)\n SERVICE_TABLE.show(array_list['DOCUMENT_POOL']['DOCUMENT'])\n 0\n end\n end\nend", "def index\n @service_particulars = ServiceParticular.all\n @service_particular = ServiceParticular.new\n end", "def read(query)\n connect if @persevere.nil?\n query = Persevere.enhance(query)\n \n resources = Array.new\n tblname = query.model.storage_name\n \n json_query, headers = query.to_json_query\n \n path = \"/#{tblname}/#{json_query}\"\n DataMapper.logger.debug(\"--> PATH/QUERY/HEADERS: #{path} #{headers.inspect}\")\n \n response = @persevere.retrieve(path, headers)\n \n if response.code.match(/20?/)\n results = JSON.parse(response.body)\n results.each do |rsrc_hash|\n # Typecast attributes, DM expects them properly cast\n query.fields.each do |prop|\n object_reference = false\n pname = prop.field.to_s\n\n value = rsrc_hash[pname]\n # Dereference references\n unless value.nil?\n if prop.field == 'id'\n rsrc_hash[pname] = prop.typecast(value.to_s.match(/(#{tblname})?\\/?([a-zA-Z0-9_-]+$)/)[2])\n else\n rsrc_hash[pname] = prop.typecast(value)\n end\n end\n # Shift date/time objects to the correct timezone because persevere is UTC\n case prop \n when DateTime then rsrc_hash[pname] = value.new_offset(Rational(Time.now.getlocal.gmt_offset/3600, 24))\n when Time then rsrc_hash[pname] = value.getlocal\n end\n end\n end\n resources = query.model.load(results, query)\n end\n # We could almost elimate this if regexp was working in persevere.\n\n # This won't work if the RegExp is nested more then 1 layer deep.\n if query.conditions.class == DataMapper::Query::Conditions::AndOperation\n regexp_conds = query.conditions.operands.select do |obj| \n obj.is_a?(DataMapper::Query::Conditions::RegexpComparison) || \n ( obj.is_a?(DataMapper::Query::Conditions::NotOperation) && obj.operand.is_a?(DataMapper::Query::Conditions::RegexpComparison) )\n end\n regexp_conds.each{|cond| resources = resources.select{|resource| cond.matches?(resource)} }\n \n end\n\n # query.match_records(resources)\n resources\n end", "def list_tier1_locale_services(tier_1_id, opts = {})\n data, _status_code, _headers = list_tier1_locale_services_with_http_info(tier_1_id, opts)\n data\n end", "def index\n @clientes_servicos = ClientesServico.all\n end", "def multiple_get_objects(requests, opts = {})\n @transporter.read(:POST, '/1/indexes/*/objects', { requests: requests }, opts)\n end", "def list_instances(request_id)\n instances = []\n JSON.parse(resource[\"/requests/#{request_id}\"].get)[\"instances\"].each do |i|\n instances << Instance.new(i)\n end\n end", "def index\n @loan_servicers = LoanServicer.all\n end", "def read_tier1_locale_services_0_with_http_info(tier_1_id, locale_services_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#read_tier1_locale_services_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def listserv\n listservs.first\n end", "def getVMs\n @vms = VirtualMachine.all(@ip_address)\n end", "def index\n @ordem_servicos = OrdemServico.all\n end", "def index\n @ordem_servicos = OrdemServico.all\n end", "def index\n @item_tiers = ItemTier.all\n end", "def list_tier1_byod_policy_service_instances_with_http_info(tier_1_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstanceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#list_tier1_byod_policy_service_instances\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_objects(syncer, query, status)\n\t\traise \"getObjects: Not Implemented\"\n\t\t\n\t\t# object_list = []\n\t\t# #for each object that matches the query\n\t\t# # object = an active record database object that contains the information from the store object\n\t\t# # store_object_id = the object_id of the store object\n\t\t# object.set_dbID(syncer, self, store_object_id)\n\t\t# object_list.push(object)\n\t\t# #end\n\t\t# return object_list\n\tend", "def get_all(options = {})\n custom_params = options[:dc] ? use_named_parameter('dc', options[:dc]) : nil\n ret = send_get_request(@conn, ['/v1/catalog/services'], options, custom_params)\n OpenStruct.new JSON.parse(ret.body)\n end", "def index\n @tipo_de_servicios = TipoDeServicio.all\n end", "def cached_instances\n # Puppet.debug(\"cached_instances - object id: #{PuppetX::PowerCLI::Helper.instance.object_id}\")\n # Puppet.debug(\"cached_instances - resource.type: #{resource.type}\")\n PuppetX::PowerCLI::Helper.instance.cached_instances[resource.type]\n end", "def services\n end", "def instances\n end", "def acquire_service_data\n if config[:tags] && config[:service]\n tags = config[:tags].split(',').to_set\n services = []\n Diplomat::Health.service(config[:service]).each do |s|\n if s['Service']['Tags'].to_set.superset? tags\n services.push(*s['Checks'])\n end\n end\n services\n elsif config[:nodename]\n data = []\n begin\n services = Diplomat::Node.get(config[:nodename]).Services\n rescue StandardError\n services = {}\n end\n services.each_value do |service|\n Diplomat::Health.checks(service['Service']).each do |check|\n data.push(check) if check.Node == config[:nodename]\n end\n end\n data\n elsif config[:all]\n Diplomat::Health.state('any')\n else\n Diplomat::Health.checks(config[:service])\n end\n end", "def loadAll()\n # Load the configuration from global.rb\n SHAREDPOOLS.each_key do |k|\n p = Pool.new(k, SHAREDPOOLS[k][:zone],\n SHAREDPOOLS[k][:allocateable_cpus],\n SHAREDPOOLS[k][:allocateable_mem],\n SHAREDPOOLS[k][:service_class])\n\n @poolList.push(p)\n end\n SERVICES.each_key do |k|\n s = Service.new(k, SERVICES[k][:authinfo],\n SERVICES[k][:maxcpus],\n SERVICES[k][:maxmemory],\n SERVICES[k][:priority])\n @svcList.push(s)\n end\n # Load the requests from redis\n @reqList = $eventProcessor.loadRequests()\n # Compute the free/used stats from state of requests\n @reqList.each { |req|\n if req.status == \"ALLOCATED\"\n pmatches = @poolList.select {|p| p.name == req.pool}\n if pmatches == nil || pmatches[0] == nil\n $Logger.error \"Unable to find pool #{req.pool} for ALLOCATED request #{req.reqid}\"\n next\n end\n smatches = @svcList.select {|s| s.name == req.service}\n if smatches == nil || smatches[0] == nil\n $Logger.error \"Unable to find service #{req.service} for ALLOCATED request #{req.reqid}\"\n next\n end\n pool = pmatches[0]\n pool.availvcpus = pool.availvcpus.to_i - req.vcpus.to_i\n pool.availmem = pool.availmem.to_i - req.mem.to_i\n service = smatches[0]\n service.vcpusallocated = service.vcpusallocated.to_i + req.vcpus.to_i\n service.memallocated = service.memallocated.to_i + req.mem.to_i\n end\n }\n end", "def read_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_byod_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_all(ts, class_name, uri = '[^\\s]+')\n ts.read_all([:name, class_name, nil, Regexp.new(uri + '/\\d+')])\n end", "def in_service_instances\n instances([{name: :lifecycle_state, value: \"InService\"}])\n end", "def read_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def loaded_instances(type)\n @instances[type].keys\n end", "def list_instances(an_array)\n SystemRepository.__list_instances(an_array)\n end", "def get_pvm_instances\n pvm_instances = get(\"cloud-instances/#{guid}/pvm-instances\")[\"pvmInstances\"] || []\n\n pvm_instances.map do |pvm_instance|\n get_pvm_instance(pvm_instance[\"pvmInstanceID\"])\n end\n end" ]
[ "0.59325004", "0.5883228", "0.57210666", "0.556969", "0.5566228", "0.5565332", "0.55268246", "0.54346424", "0.5401697", "0.53916717", "0.5378528", "0.5375811", "0.53308654", "0.52812237", "0.5270646", "0.5199996", "0.51920074", "0.5150534", "0.51471823", "0.51330644", "0.5111122", "0.51098627", "0.5106967", "0.51060784", "0.51037663", "0.5100804", "0.5091243", "0.5083468", "0.5082586", "0.507948", "0.5069806", "0.5049667", "0.50411034", "0.50378853", "0.5021476", "0.5019293", "0.5012595", "0.5006801", "0.49952647", "0.4995056", "0.4989453", "0.4983202", "0.49822184", "0.49762523", "0.4941458", "0.49360165", "0.49354154", "0.49295843", "0.492895", "0.49238482", "0.4923557", "0.4922028", "0.49199116", "0.49198437", "0.49175322", "0.49164173", "0.49154836", "0.4907233", "0.48973653", "0.48905647", "0.48865944", "0.48707208", "0.48703292", "0.48687848", "0.48648515", "0.48587456", "0.48571038", "0.48553035", "0.48492354", "0.48475766", "0.4846676", "0.4843271", "0.4842981", "0.48409963", "0.48291016", "0.482172", "0.4817364", "0.48169854", "0.48136103", "0.48100102", "0.4808503", "0.4800154", "0.4800154", "0.47958744", "0.47949585", "0.4793229", "0.47922134", "0.47900128", "0.47895014", "0.47870293", "0.47792658", "0.4778492", "0.47780645", "0.47762004", "0.4775552", "0.4771951", "0.4769212", "0.47619846", "0.47613084", "0.475464" ]
0.564421
3
Read all service instance objects under a tier1 Read all service instance objects under a tier1
def read_all_policy_service_instances_for_tier1_0_with_http_info(tier_1_id, locale_service_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1_0 ...' end # verify the required parameter 'tier_1_id' is set if @api_client.config.client_side_validation && tier_1_id.nil? fail ArgumentError, "Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1_0" end # verify the required parameter 'locale_service_id' is set if @api_client.config.client_side_validation && locale_service_id.nil? fail ArgumentError, "Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1_0" end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1_0, must be smaller than or equal to 1000.' end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1_0, must be greater than or equal to 0.' end # resource path local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s) # query parameters query_params = {} query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil? query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil? query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil? query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil? query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'PolicyServiceInstanceListResult') if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_all_policy_service_instances_for_tier1_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_all_policy_service_instances_for_tier1(tier_1_id, locale_service_id, opts = {})\n data, _status_code, _headers = read_all_policy_service_instances_for_tier1_with_http_info(tier_1_id, locale_service_id, opts)\n data\n end", "def all_instances\n Puppet.debug(\"all_instances - cached instances is: #{cached_instances}\")\n Puppet.debug(\"all_instances - cached instances object id: #{cached_instances.object_id}\")\n # return cache if it has been created, this means that this function will only need\n # to be loaded once, returning all instances that exist of this resource in vsphere\n # then, we can lookup our version by name/id/whatever. This saves a TON of processing\n return cached_instances unless cached_instances.nil?\n\n # Want to return an array of instances\n # each hash should have the same properties as the properties\n # of this \"type\"\n # remember the keys should be symbols, aka :ntp_servers not 'ntp_servers'\n # This is a tracking hash which will contain info about each host and NTP server relationships\n cmd = <<-EOF\n $ntp_servers_hash = @{}\n $hosts = #{powercli_get_online_hosts}\n foreach($h in $hosts) {\n $servers = Get-VMHostNtpServer -VMHost $h\n if ($servers) {\n $ntp_servers_hash[$h.Name] = @($servers)\n } else {\n $ntp_servers_hash[$h.Name] = @()\n }\n }\n $ntp_servers_hash | ConvertTo-Json\n EOF\n\n ntpservers_stdout = powercli_connect_exec(cmd)[:stdout]\n # json parse expects a json string, powershell does not stdout with quotes\n # we might be able to remove this line because powershell exits with a viable ruby array already:\n # [\n # \"time1.dev.encore.tech\",\n # \"time2.dev.encore.tech\"\n # ]\n # what happens if this returns null??\n ntpservers_hash = JSON.parse(ntpservers_stdout)\n\n # create instance hash - this contains info about ONE host at a time\n # the values should match the data \"shape\" (ie have the same fields) as our\n # type.\n # the key, should be the title/namevar so we can do a lookup in our\n # read_instance function\n cached_instances_set({})\n ntpservers_hash.each do |esx_host, ntp_servers_array|\n cached_instances[esx_host] = {\n ensure: :present,\n esx_host: esx_host,\n ntp_servers: ntp_servers_array,\n }\n end\n Puppet.debug(\"all_instances - cached instances is at end: #{cached_instances}\")\n Puppet.debug(\"all_instances - cached instances object_id at end: #{cached_instances.object_id}\")\n cached_instances\n end", "def read_all_policy_service_instances_for_tier1_with_http_info(tier_1_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_all_policy_service_instances_for_tier1, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstanceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_all_policy_service_instances_for_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_all_policy_service_instances_for_tier1_0(tier_1_id, locale_service_id, opts = {})\n data, _status_code, _headers = read_all_policy_service_instances_for_tier1_0_with_http_info(tier_1_id, locale_service_id, opts)\n data\n end", "def load_records\n native_instance(true)\n native_instance.top(limit) if limit.present?\n Array(service.native_instance.execute)\n end", "def services\n related_objects_by_type(\"Service\")\n end", "def services\n\t\tService.find(:all)\n\tend", "def read_facts_xinetd_services(srvs, type = 'std')\n xinetd_services = {}\n\n srvs.each do |srv|\n srv_name = \"srv_#{srv}\"\n xinetd_services[srv_name] = check_xinetd_service(srv, type)\n end\n\n xinetd_services\nend", "def read_vms\n end", "def all\n @service.all\n end", "def instances\n Egi::Fedcloud::Vmhound::Log.info \"[#{self.class}] Retrieving active instances\"\n fetch_instances\n end", "def index\n @idti_services = IdtiService.all\n end", "def read_tier1(tier_1_id, opts = {})\n data, _status_code, _headers = read_tier1_with_http_info(tier_1_id, opts)\n data\n end", "def index\n @tb_servicios = TbServicio.all\n end", "def all(params=nil)\n instance = ConektaObject.new\n url = Util.types[self.class_name.downcase].url\n requestor = Requestor.new\n response = requestor.request(:get, url)\n instance.load_from(response)\n instance\n end", "def list_tier1_byod_policy_service_instances(tier_1_id, locale_service_id, opts = {})\n data, _status_code, _headers = list_tier1_byod_policy_service_instances_with_http_info(tier_1_id, locale_service_id, opts)\n data\n end", "def index\n @sermon_reflections = SermonReflection.all\n # @event_sermon_reflections = EventSermonReflection.all\n end", "def all_instances\n Puppet.debug(\"all_instances - cached instances is: #{cached_instances}\")\n Puppet.debug(\"all_instances - cached instances object id: #{cached_instances.object_id}\")\n # return cache if it has been created, this means that this function will only need\n # to be loaded once, returning all instances that exist of this resource in vsphere\n # then, we can lookup our version by name/id/whatever. This saves a TON of processing\n return cached_instances unless cached_instances.nil?\n\n # Fetch the current status of the portgroup\n cmd = <<-EOF\n $portgroup_hash = @{}\n $hosts = #{powercli_get_online_hosts}\n foreach($h in $hosts) {\n # We silently continue on errors otherwise PowerCLI creates an error if the\n # portgroup does not exist on the host which pollutes our $portgroup_hash return object\n $pg = Get-VirtualSwitch -Host $h -Standard -Name #{resource[:vswitch_name]} | Get-VirtualPortGroup -Name #{resource[:portgroup]} -ErrorAction SilentlyContinue\n if ($pg) {\n $obj_hash = @{}\n $obj_hash.Add('portgroup', $pg.Name)\n $obj_hash.Add('vlan', $pg.VLanId)\n $obj_hash.Add('vswitch_name', $pg.VirtualSwitchName)\n $portgroup_hash[$h.Name] = @($obj_hash)\n } else {\n # create empty hashtable\n $obj_hash = @{}\n $portgroup_hash[$h.Name] = @($obj_hash)\n }\n }\n $portgroup_hash | ConvertTo-Json\n EOF\n\n portgroups_stdout = powercli_connect_exec(cmd)[:stdout]\n\n unless portgroups_stdout.empty?\n portgroups_hash = JSON.parse(portgroups_stdout)\n cached_instances_set({})\n portgroups_hash.each do |esx_host, pg_array|\n # Extracting hash from array object\n pg_hash = pg_array[0]\n cached_instances[esx_host] = {\n ensure: :present,\n esx_host: esx_host,\n vswitch_name: pg_hash['vswitch_name'],\n vlan: pg_hash['vlan'],\n portgroup: pg_hash['portgroup'],\n }\n end\n end\n Puppet.debug(\"all_instances - cached instances is at end: #{cached_instances}\")\n Puppet.debug(\"all_instances - cached instances object_id at end: #{cached_instances.object_id}\")\n cached_instances\n end", "def index\n @invoice_services = InvoiceService.all\n end", "def read_service_types()\n types = []\n @client.services.each do |type|\n types << type.label\n end\n\n types\n end", "def list_tier1_locale_services_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServicesListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#list_tier1_locale_services\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_instances\n instances = [ ]\n get_clouds.each do |cloud|\n instances += cloud.instances.index(:filter => [], :view => 'tiny')\n end\n instances\n end", "def main_services\n main_co.services\n end", "def vault_objects(vault_id)\n request_get(\"/vault/#{vault_id}\")\n end", "def list_tier1_locale_services_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services_0\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.list_tier1_locale_services_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServicesListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#list_tier1_locale_services_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_0(tier_1_id, opts = {})\n data, _status_code, _headers = read_tier1_0_with_http_info(tier_1_id, opts)\n data\n end", "def list_tier1(opts = {})\n data, _status_code, _headers = list_tier1_with_http_info(opts)\n data\n end", "def get_all(options = {})\n custom_params = options[:dc] ? use_named_parameter('dc', options[:dc]) : nil\n ret = send_get_request(@conn, ['/v1/catalog/nodes'], options, custom_params)\n JSON.parse(ret.body).map { |service| OpenStruct.new service }\n end", "def instances\n instances = []\n JSON.parse(resource['/instances'].get)[\"instances\"].each do |i|\n instances << Instance.new(i)\n end\n return instances\n end", "def index\n @service_classes = ServiceClass.all\n end", "def services\n unless @services\n rows = database.view(VIEW_NAME, reduce: false, key: [1, name])['rows'] rescue []\n ids = rows.map {|row| row['value'] }\n @services = Service.all.keys(ids).to_a\n end\n @services\n end", "def read_tier1_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#read_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def fetch_instance(shortname = :all, options = {})\n return instances if instances && !options[:force]\n\n fetch_stack\n unless instance_list\n self.instance_list = self.instances =\n aws_client.describe_instances(stack_id: stack[:stack_id])[:instances]\n end\n\n if shortname != :all\n fetch_layer(shortname, force: true)\n self.instances = []\n\n layers.each do |layer|\n instance = aws_client.describe_instances(\n layer_id: layer[:layer_id])\n self.instances << instance[:instances]\n end\n\n self.instances.flatten!\n end\n end", "def all\n containers = service.list_containers\n data = []\n containers.each do |container|\n c = parse_storage_object(container)\n c[:acl] = 'unknown'\n data << c\n end\n load(data)\n end", "def read_tier1_byod_policy_service_instance_0(tier_1_id, locale_service_id, service_instance_id, opts = {})\n data, _status_code, _headers = read_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts)\n data\n end", "def get_all_sobjects(type)\n case type\n when 'Account'\n records = @client.materialize(type).query(\"Agents__c != ''\")\n when 'ccrmbasic__Email__c'\n records = @client.materialize(type).query(\"ccrmbasic__Contact__c != ''\")\n else\n records = @client.materialize(type).all\n end\n sobjects = records.dup.to_a\n while records.next_page?\n sobjects += records.next_page\n records = records.next_page\n end\n sobjects\n end", "def load_services(svcs)\n unless @services\n @services = Gruf.services.concat(svcs)\n @services.uniq!\n end\n @services\n end", "def index\n page = params[:page]\n per_page = (params[:per_page] || 10).to_i\n if page\n entities = _all_instances_query.page(page).per(per_page)\n render json: entities, entity: _get_class,\n meta: { total_pages: entities.total_pages, total_count: entities.total_count }\n else\n entities = _all_instances_query\n respond_with entities, entity: '_get_class'\n end\n end", "def read_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#read_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_tier1_byod_policy_service_instances_0(tier_1_id, locale_service_id, opts = {})\n data, _status_code, _headers = list_tier1_byod_policy_service_instances_0_with_http_info(tier_1_id, locale_service_id, opts)\n data\n end", "def instances\n IbmCloudRest.get \"#{@uri}/instances\"\n end", "def get_records(type)\n if @action == 'initial_run'\n @logger.info \"Getting all records from SalesForce for #{type}\"\n records = get_all_sobjects(type)\n else\n @logger.info \"Getting records for yesterday from SalesForce for #{type}\"\n records = @client.materialize(type)\n \n datetime = DateTime.now\n datetime = datetime -= 1\n records.query(\"lastmodifieddate >= #{datetime}\")\n end\n end", "def resources(oneview_type = nil, oneview_name = nil)\n oneview_type = @options[:oneview_type] if oneview_type.nil?\n oneview_name = @options[:oneview_name] if oneview_name.nil?\n raise 'Oneview resource type must be specified.' if oneview_type.nil?\n\n # Determine the endpoint that needs to be called\n endpoint = format('/rest/%s', oneview_type)\n\n # Find the resources\n response = oneview_client.rest_get(endpoint)\n resources = oneview_client.response_handler(response)\n\n return resources if oneview_name.nil?\n\n # Filter the resources by the name if it has been specified\n resources['members'].select { |r| r['name'] == oneview_name }\n end", "def init_instances\n instances = []\n next_token = nil\n all_records_retrieved = false\n\n until all_records_retrieved\n response = @@client.describe_instances({\n next_token: next_token\n })\n next_token = response.next_token\n all_records_retrieved = next_token.nil? || next_token.empty?\n instances << response.reservations.map { |r| r.instances }\n end\n\n instances.flatten\n end", "def read_tier1_byod_policy_service_instance(tier_1_id, locale_service_id, service_instance_id, opts = {})\n data, _status_code, _headers = read_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts)\n data\n end", "def read_all_policy_service_instances_for_tier0(tier_0_id, locale_service_id, opts = {})\n data, _status_code, _headers = read_all_policy_service_instances_for_tier0_with_http_info(tier_0_id, locale_service_id, opts)\n data\n end", "def services\n\t\tselect {|x| x.class == Service }\n\tend", "def read_service_payments\r\n read_service_payment while peek == 'SVC'\r\n self\r\n end", "def active_instances\n Egi::Fedcloud::Vmhound::Log.info \"[#{self.class}] Retrieving running instances\"\n fetch_instances ['ACTIVE']\n end", "def index\n @servicos = Servico.all\n end", "def index\n @customer_services = CustomerService.all\n end", "def query_for_services(type = nil, pool = nil)\n\n raise \"Type must not be nil if pool is nil\" if type.nil? && !pool.nil?\n\n @discovery_urls.each do |discovery_url|\n resource = \"/v1/service\"\n resource += \"/#{type}\" if ! type.nil?\n resource += \"/#{pool}\" if ! pool.nil?\n\n service_uri = URI.parse(discovery_url).merge(resource)\n\n @logger.debug(\"Get Request: #{service_uri.to_s}\")\n\n begin\n response = @client.get(service_uri.to_s, nil, nil)\n\n if response.status >= 200 && response.status <= 299\n service_data = JSON.parse(response.body)\n\n return service_data\n end\n\n @logger.error(\"#{service_uri.to_s}: Response Status #{response.status}\")\n @logger.error(response.body)\n\n rescue\n @logger.error(\"#{service_uri.to_s}: #{$!}\")\n end\n\n end\n\n raise \"Failed to get all services from any of [ #{@discovery_urls.join(\",\")} ]\"\n\n end", "def index\n @servicemen = Serviceman.all\n end", "def list_services\n @services\n end", "def index\n @registro_servicios = Registro::Servicio.all\n end", "def object_instances\n return [] if object_definition.blank?\n \n latest_version = ::AP::VoiceExtension::Voice::Config.instance.latest_version\n klazz = \"::#{latest_version.upcase}::#{object_definition.name}\".constantize\n query_scope = object_definition.query_scope\n objects = klazz.respond_to?(query_scope.to_sym) ? klazz.send(query_scope.to_sym) : []\n if objects.blank?\n return []\n else\n return objects\n end\n end", "def instances(type)\n @instances[type]\n end", "def index\n @service_tables = ServiceTable.all\n end", "def index\n @request_services = RequestService.all\n end", "def get_services(sObjectType, oParams)\n case sObjectType\n when :services\n # oParams[sObjectType] will provide the controller object.\n # This one can be interpreted only by controller code,\n # except if controller declares how to map with this object.\n # Processes can deal only process mapped data.\n # Currently there is no services process function. No need to map.\n services = oParams[:services]\n if !oParams[:list_services].is_a?(Array)\n service_to_find = [oParams[:list_services]]\n else\n service_to_find = oParams[:list_services]\n end\n # Search for service. Ex: Can be :Networking or network. I currently do\n # not know why...\n search_services = services.rh_get(:service_catalog)\n service = nil\n service_to_find.each do |sServiceElem|\n if search_services.key?(sServiceElem)\n service = sServiceElem\n break\n end\n end\n\n controller_error 'Unable to find services %s',\n service_to_find if service.nil?\n result = services.rh_get(:service_catalog, service).keys\n result.delete('name')\n result.each_index do |iIndex|\n result[iIndex] = result[iIndex].to_s if result[iIndex].is_a?(Symbol)\n end\n return result\n else\n controller_error \"'%s' is not a valid object for 'get_services'\",\n sObjectType\n end\n end", "def read_tier1_locale_services_with_http_info(tier_1_id, locale_services_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#read_tier1_locale_services\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def fetch_databag_tenants\n db_tenants = Array.new\n chef_api_connect.search.query(:foundation, '*:*', start: 0).rows.each do |tenant|\n db_tenants << tenant['raw_data']['id']\n end\n return db_tenants\nend", "def load_objects\n instance_variable_set(\"@#{model_name.underscore.pluralize}\", (@instances = model.where(params || {}) rescue nil))\n end", "def index\n @emt_services = EmtService.all\n end", "def index\n\t@aservices = Aservice.all #@aservices variable de clase\n end", "def read_vms\n args = %w[list --all --no-header --json -o name,uuid]\n vms_arr = json { execute_prlctl(*args) }\n templates_arr = json { execute_prlctl(*args, '--template') }\n\n vms = vms_arr | templates_arr\n Hash[vms.map { |i| [i.fetch('name'), i.fetch('uuid')] }]\n end", "def read_tier1_locale_services(tier_1_id, locale_services_id, opts = {})\n data, _status_code, _headers = read_tier1_locale_services_with_http_info(tier_1_id, locale_services_id, opts)\n data\n end", "def vm_instances\n @conn.vminstances\n end", "def get_all_replicas(id, options = GetAllReplicasOptions.new) end", "def list_services(client, args, options)\n response = client.get(RESOURCE_PATH)\n\n if CloudClient::is_error?(response)\n [response.code.to_i, response.to_s]\n else\n #[0,response.body]\n if options[:json]\n [0,response.body]\n else\n array_list = JSON.parse(response.body)\n SERVICE_TABLE.show(array_list['DOCUMENT_POOL']['DOCUMENT'])\n 0\n end\n end\nend", "def get_services\n reply = @client.call(:get_services)\n\n data = reply.body.dig(:get_services_response,\n :get_services_result,\n :array_of_string)\n data = check_if_data_exists(data)\n\n data.map do |attrs|\n {\n id: Integer(attrs[:string][0], 10),\n name: attrs[:string][1]\n }\n end\n end", "def read(query)\n connect if @persevere.nil?\n query = Persevere.enhance(query)\n \n resources = Array.new\n tblname = query.model.storage_name\n \n json_query, headers = query.to_json_query\n \n path = \"/#{tblname}/#{json_query}\"\n DataMapper.logger.debug(\"--> PATH/QUERY/HEADERS: #{path} #{headers.inspect}\")\n \n response = @persevere.retrieve(path, headers)\n \n if response.code.match(/20?/)\n results = JSON.parse(response.body)\n results.each do |rsrc_hash|\n # Typecast attributes, DM expects them properly cast\n query.fields.each do |prop|\n object_reference = false\n pname = prop.field.to_s\n\n value = rsrc_hash[pname]\n # Dereference references\n unless value.nil?\n if prop.field == 'id'\n rsrc_hash[pname] = prop.typecast(value.to_s.match(/(#{tblname})?\\/?([a-zA-Z0-9_-]+$)/)[2])\n else\n rsrc_hash[pname] = prop.typecast(value)\n end\n end\n # Shift date/time objects to the correct timezone because persevere is UTC\n case prop \n when DateTime then rsrc_hash[pname] = value.new_offset(Rational(Time.now.getlocal.gmt_offset/3600, 24))\n when Time then rsrc_hash[pname] = value.getlocal\n end\n end\n end\n resources = query.model.load(results, query)\n end\n # We could almost elimate this if regexp was working in persevere.\n\n # This won't work if the RegExp is nested more then 1 layer deep.\n if query.conditions.class == DataMapper::Query::Conditions::AndOperation\n regexp_conds = query.conditions.operands.select do |obj| \n obj.is_a?(DataMapper::Query::Conditions::RegexpComparison) || \n ( obj.is_a?(DataMapper::Query::Conditions::NotOperation) && obj.operand.is_a?(DataMapper::Query::Conditions::RegexpComparison) )\n end\n regexp_conds.each{|cond| resources = resources.select{|resource| cond.matches?(resource)} }\n \n end\n\n # query.match_records(resources)\n resources\n end", "def index\n @service_particulars = ServiceParticular.all\n @service_particular = ServiceParticular.new\n end", "def list_tier1_locale_services(tier_1_id, opts = {})\n data, _status_code, _headers = list_tier1_locale_services_with_http_info(tier_1_id, opts)\n data\n end", "def index\n @clientes_servicos = ClientesServico.all\n end", "def multiple_get_objects(requests, opts = {})\n @transporter.read(:POST, '/1/indexes/*/objects', { requests: requests }, opts)\n end", "def index\n @loan_servicers = LoanServicer.all\n end", "def list_instances(request_id)\n instances = []\n JSON.parse(resource[\"/requests/#{request_id}\"].get)[\"instances\"].each do |i|\n instances << Instance.new(i)\n end\n end", "def read_tier1_locale_services_0_with_http_info(tier_1_id, locale_services_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#read_tier1_locale_services_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def listserv\n listservs.first\n end", "def getVMs\n @vms = VirtualMachine.all(@ip_address)\n end", "def index\n @ordem_servicos = OrdemServico.all\n end", "def index\n @ordem_servicos = OrdemServico.all\n end", "def index\n @item_tiers = ItemTier.all\n end", "def list_tier1_byod_policy_service_instances_with_http_info(tier_1_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.list_tier1_byod_policy_service_instances, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstanceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#list_tier1_byod_policy_service_instances\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_objects(syncer, query, status)\n\t\traise \"getObjects: Not Implemented\"\n\t\t\n\t\t# object_list = []\n\t\t# #for each object that matches the query\n\t\t# # object = an active record database object that contains the information from the store object\n\t\t# # store_object_id = the object_id of the store object\n\t\t# object.set_dbID(syncer, self, store_object_id)\n\t\t# object_list.push(object)\n\t\t# #end\n\t\t# return object_list\n\tend", "def get_all(options = {})\n custom_params = options[:dc] ? use_named_parameter('dc', options[:dc]) : nil\n ret = send_get_request(@conn, ['/v1/catalog/services'], options, custom_params)\n OpenStruct.new JSON.parse(ret.body)\n end", "def index\n @tipo_de_servicios = TipoDeServicio.all\n end", "def cached_instances\n # Puppet.debug(\"cached_instances - object id: #{PuppetX::PowerCLI::Helper.instance.object_id}\")\n # Puppet.debug(\"cached_instances - resource.type: #{resource.type}\")\n PuppetX::PowerCLI::Helper.instance.cached_instances[resource.type]\n end", "def services\n end", "def instances\n end", "def loadAll()\n # Load the configuration from global.rb\n SHAREDPOOLS.each_key do |k|\n p = Pool.new(k, SHAREDPOOLS[k][:zone],\n SHAREDPOOLS[k][:allocateable_cpus],\n SHAREDPOOLS[k][:allocateable_mem],\n SHAREDPOOLS[k][:service_class])\n\n @poolList.push(p)\n end\n SERVICES.each_key do |k|\n s = Service.new(k, SERVICES[k][:authinfo],\n SERVICES[k][:maxcpus],\n SERVICES[k][:maxmemory],\n SERVICES[k][:priority])\n @svcList.push(s)\n end\n # Load the requests from redis\n @reqList = $eventProcessor.loadRequests()\n # Compute the free/used stats from state of requests\n @reqList.each { |req|\n if req.status == \"ALLOCATED\"\n pmatches = @poolList.select {|p| p.name == req.pool}\n if pmatches == nil || pmatches[0] == nil\n $Logger.error \"Unable to find pool #{req.pool} for ALLOCATED request #{req.reqid}\"\n next\n end\n smatches = @svcList.select {|s| s.name == req.service}\n if smatches == nil || smatches[0] == nil\n $Logger.error \"Unable to find service #{req.service} for ALLOCATED request #{req.reqid}\"\n next\n end\n pool = pmatches[0]\n pool.availvcpus = pool.availvcpus.to_i - req.vcpus.to_i\n pool.availmem = pool.availmem.to_i - req.mem.to_i\n service = smatches[0]\n service.vcpusallocated = service.vcpusallocated.to_i + req.vcpus.to_i\n service.memallocated = service.memallocated.to_i + req.mem.to_i\n end\n }\n end", "def acquire_service_data\n if config[:tags] && config[:service]\n tags = config[:tags].split(',').to_set\n services = []\n Diplomat::Health.service(config[:service]).each do |s|\n if s['Service']['Tags'].to_set.superset? tags\n services.push(*s['Checks'])\n end\n end\n services\n elsif config[:nodename]\n data = []\n begin\n services = Diplomat::Node.get(config[:nodename]).Services\n rescue StandardError\n services = {}\n end\n services.each_value do |service|\n Diplomat::Health.checks(service['Service']).each do |check|\n data.push(check) if check.Node == config[:nodename]\n end\n end\n data\n elsif config[:all]\n Diplomat::Health.state('any')\n else\n Diplomat::Health.checks(config[:service])\n end\n end", "def read_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_byod_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_all(ts, class_name, uri = '[^\\s]+')\n ts.read_all([:name, class_name, nil, Regexp.new(uri + '/\\d+')])\n end", "def read_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def in_service_instances\n instances([{name: :lifecycle_state, value: \"InService\"}])\n end", "def loaded_instances(type)\n @instances[type].keys\n end", "def list_instances(an_array)\n SystemRepository.__list_instances(an_array)\n end", "def get_pvm_instances\n pvm_instances = get(\"cloud-instances/#{guid}/pvm-instances\")[\"pvmInstances\"] || []\n\n pvm_instances.map do |pvm_instance|\n get_pvm_instance(pvm_instance[\"pvmInstanceID\"])\n end\n end" ]
[ "0.59302133", "0.58823484", "0.57199717", "0.5642335", "0.5564773", "0.55645937", "0.55250674", "0.5434599", "0.54015064", "0.53887016", "0.5376201", "0.5374497", "0.5331375", "0.5279669", "0.5268225", "0.51972884", "0.51906973", "0.5148846", "0.5145432", "0.5131381", "0.51101583", "0.5108861", "0.5105749", "0.51056945", "0.51028425", "0.51015896", "0.5090501", "0.50813925", "0.5080956", "0.50773734", "0.50675976", "0.5050666", "0.5040666", "0.5035673", "0.50212765", "0.5017287", "0.5010972", "0.5004885", "0.49960408", "0.4993101", "0.49875695", "0.4982664", "0.4979861", "0.49736392", "0.49411988", "0.49355677", "0.49328685", "0.49277744", "0.49273232", "0.4922092", "0.49211013", "0.4919821", "0.4917829", "0.4917284", "0.49153945", "0.4915038", "0.49128383", "0.49054408", "0.48949242", "0.4888216", "0.48861623", "0.48701796", "0.48689106", "0.486666", "0.4862649", "0.48571438", "0.48557928", "0.4853478", "0.48480353", "0.4845449", "0.48453864", "0.48436773", "0.48415893", "0.48387867", "0.48276556", "0.4820284", "0.4815394", "0.48142824", "0.48133123", "0.48090947", "0.4806559", "0.47982794", "0.47982794", "0.47965157", "0.47935972", "0.47921264", "0.47904956", "0.47882733", "0.47880468", "0.47854295", "0.47772008", "0.47766542", "0.47764656", "0.47763482", "0.47752532", "0.47691593", "0.47686028", "0.47596037", "0.47591463", "0.47523212" ]
0.5568558
4
Read Tier1 BYOD service instance Read Tier1 BYOD service instance
def read_tier1_byod_policy_service_instance(tier_1_id, locale_service_id, service_instance_id, opts = {}) data, _status_code, _headers = read_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def service\n @service ||= bus.service('com.dubstepdish.i3dstatus')\n end", "def read_tier1_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#read_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#read_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1(tier_1_id, opts = {})\n data, _status_code, _headers = read_tier1_with_http_info(tier_1_id, opts)\n data\n end", "def read_service_payments\r\n read_service_payment while peek == 'SVC'\r\n self\r\n end", "def read_tier1_0(tier_1_id, opts = {})\n data, _status_code, _headers = read_tier1_0_with_http_info(tier_1_id, opts)\n data\n end", "def service; end", "def read_instance\n raise NotImplementedError, 'read_instance needs to be implemented by child providers'\n end", "def service\n @service\n end", "def service; services.first; end", "def bi_service\n end", "def client\n Piloto::Paws.new.dynamo\nend", "def read\n iface = Qt::DBusInterface.new(SERVICE_NAME, READ_PATH, \"\", Qt::DBusConnection.sessionBus)\n raise \"D-BUS Interface Error : #{Qt::DBusConnection.sessionBus.lastError.message}\" unless iface.valid?\n msg = iface.call(Qt::DBus::BlockWithGui, \"read\", url)\n reply = Qt::DBusReply.new(msg)\n raise \"D-BUS Reply Error : #{reply.error.message}\" unless reply.valid?\n reply.value\n end", "def read\n end", "def read\n end", "def read\n end", "def read\n end", "def read\n end", "def obtain_description\n\t\t#it's only pulling traffic train status for now, but we will get it to pull out the description instead.\n\t\tService.find_by(name: self.service_name).traffic\n\tend", "def obtain_description\n\t\t#it's only pulling traffic train status for now, but we will get it to pull out the description instead.\n\t\tService.find_by(name: self.service_name).traffic\n\tend", "def tires_read(tire, opts = {})\n data, _status_code, _headers = tires_read_with_http_info(tire, opts)\n data\n end", "def read_tier0_with_http_info(tier_0_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi.read_tier0 ...'\n end\n # verify the required parameter 'tier_0_id' is set\n if @api_client.config.client_side_validation && tier_0_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_0_id' when calling PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi.read_tier0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-0s/{tier-0-id}'.sub('{' + 'tier-0-id' + '}', tier_0_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier0')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi#read_tier0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def service\n return softlayer_client[:Ticket].object_with_id(self.id)\n end", "def read\n \n end", "def instance\n perform_request_with_object(:get, '/api/v1/instance', {}, Mastodon::Instance)\n end", "def service\n @service ||= fetcher.get(Service, service_id)\n end", "def read\nend", "def _read type, name\n result = @elasticsupport.client.search index: _index_for(type), type: type.to_s, q: \"name:#{name}\"\n result[\"hits\"][\"hits\"][0] rescue nil\n end", "def service\n StockManagementService.new\n end", "def servicio # :doc\n id = params[:service_id]\n if id.present?\n \t\tService.find(params[:service_id]) \n \tend \n end", "def read_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_byod_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def retrieve(service:, resource:, qos: {} )\n port = AnyPort::Port.new.port_for_message_exchange_pattern(qos)\n # result = Try {\n result = with_circuit do |circuit|\n circuit.service_name = resource\n end.call { get(port, service, resource, ENVIRONMENT) }\n # }\n\n # result.get_or_else {raise self.class::RequestFailure}\n # begin\n # result = with_circuit do |circuit|\n # circuit.service_name = resource\n # end.call {MockClient.new.call(service, resource, :development)}\n # rescue AnyPort::CircuitBreaker::CircuitOpen => e\n # puts \"===>CircuitBreaker Open Exception\"\n # rescue AnyPort::PortException => e\n # puts \"===>General Port Exception, #{e}\"\n # end\n end", "def instance\n perform_request_with_object(:get, '/api/v1/instance', {},\n Mastodon::Instance)\n end", "def service\n return @service\n end", "def service(nickname, reserved, distribution, type)\n end", "def fetch_dataone(vin)\n config = Lynr.config('app').vin.dataone\n url = config.url\n data = {\n authorization_code: config.auth_code,\n client_id: config.client_id,\n decoder_query: dataone_xml_query(vin),\n }\n Lynr.metrics.time('time.service:dataone.fetch') do\n RestClient.post url, data\n end\n end", "def read(_request)\n raise NotImplementedError, 'Implement this method in your strategy'\n end", "def get_instance(payload)\n ServiceInstance.new(@version, payload)\n end", "def get_instance(payload)\n ServiceInstance.new(@version, payload)\n end", "def read_tier0_0_with_http_info(tier_0_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi.read_tier0_0 ...'\n end\n # verify the required parameter 'tier_0_id' is set\n if @api_client.config.client_side_validation && tier_0_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_0_id' when calling PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi.read_tier0_0\"\n end\n # resource path\n local_var_path = '/infra/tier-0s/{tier-0-id}'.sub('{' + 'tier-0-id' + '}', tier_0_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier0')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi#read_tier0_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def services\n end", "def set_idti_service\n @idti_service = IdtiService.find(params[:id])\n end", "def read_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_byod_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def service\n softlayer_client[:Software_Component].object_with_id(self.id)\n end", "def get( name, *args )\n point = find_definition( name )\n raise ServiceNotFound, \"#{fullname}.#{name}\" unless point\n\n point.instance( self, *args )\n end", "def show\n @service = Service.find(params[:id])\n end", "def read_tier0(tier_0_id, opts = {})\n data, _status_code, _headers = read_tier0_with_http_info(tier_0_id, opts)\n data\n end", "def services\n\n end", "def get_usage(args= {})\n args = {:day=>\"today\", :type=>\"heat\"}.merge(args)\n result = HTTParty.get( @tstat_ip + '/tstat/datalog', :headers => @headers) \n \n day = result[args[:day]]\n runtime = day[args[:type] + '_runtime']\n\n return runtime\n end", "def read(*args)\n #This is a stub, used for indexing\n end", "def service(id)\n request :get, \"/services/#{id}\"\n end", "def get_by_id(id)\n self.class.get(\"/aldebaran-instances/instances/#{id}\", :basic_auth => @auth)\n end", "def read(name=@name)\n begin\n a = self.class.new\n res = self.class.get(\"#{self.class.noah_base_path}/#{name}\").parsed_response\n res.each do |key, value|\n a.instance_variable_set(\"@#{key}\", value)\n end\n a\n rescue Errno::ECONNREFUSED\n \"Noah server is unreachable\"\n end\n end", "def driver\n Fc3Service\n end", "def read_tier1_byod_policy_service_instance_0(tier_1_id, locale_service_id, service_instance_id, opts = {})\n data, _status_code, _headers = read_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts)\n data\n end", "def services\n\tend", "def read\n raise NotImplementedError\n end", "def get_reading\n\t\turi = URI.parse('http://localhost:5000/thermometers.json')\n\t\tthermo_response = Net::HTTP.get_response(uri)\n\t\tcheck = thermo_response.body\n\t\tj = JSON.parse(check)\n\tend", "def service\n return softlayer_client[\"Virtual_Guest\"].object_with_id(self.id)\n end", "def connect\n service\n end", "def tei druid\n url = \"#{config.stacks}/file/druid:#{druid}/#{druid}.xml\"\n open(url)\n# File.open(\"/home/lyberadmin/frda/ap_tei/#{druid}.xml\")\n rescue Exception => e\n logger.error(\"error while retrieving tei at #{url} -- #{e.message}\")\n# logger.error(\"error while retrieving tei #{druid} -- #{e.message}\")\n \"<TEI.2/>\"\n end", "def service\n softlayer_client[:Network_Storage].object_with_id(self.id)\n end", "def vread(klass, id, version_id, format=@default_format)\n options = { resource: klass, id: id, format: format, history: {id: version_id} }\n reply = get resource_url(options), fhir_headers(options)\n reply.resource = parse_reply(klass, format, reply)\n reply.resource_class = klass\n reply\n end", "def read_tier1_locale_services_0_with_http_info(tier_1_id, locale_services_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#read_tier1_locale_services_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def listserv\n listservs.first\n end", "def read; end", "def read; end", "def read; end", "def read; end", "def read; end", "def read; end", "def read; end", "def index\n @service_particulars = ServiceParticular.all\n @service_particular = ServiceParticular.new\n end", "def vread(klass, id, version_id, format = nil)\n headers = { accept: \"#{format}\" } if format\n format ||= @default_format\n options = { resource: klass, id: id, format: format, history: { id: version_id } }\n reply = get resource_url(options), fhir_headers(headers)\n reply.resource = parse_reply(klass, format, reply)\n reply.resource_class = klass\n reply\n end", "def read_tier1_service_interface_0_with_http_info(tier_1_id, locale_service_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_service_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def service_name; end", "def read(id)\n # do not respond with anything\n end", "def service\n return softlayer_client[:Virtual_Guest].object_with_id(self.id)\n end", "def get\n appid = ENV['TRIMET_APP_ID']\n response = Unirest.get( \"http://developer.trimet.org/ws/v2/vehicles?appid=#{appid}\" )\n response.body\nend", "def read_io io\n handle_client io\n end", "def read_tier1_service_interface_with_http_info(tier_1_id, locale_service_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_service_interface\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def service\n self.original_service or Service.find_by_name(\"FieldStatus\")\n end", "def read_one(query)\n adapter.read_one(query)\n end", "def read_one(query)\n adapter.read_one(query)\n end", "def read_vms\n end", "def get_datastream( pid, dsID )\n pid.include?(\"druid\") ? pid = pid : pid = \"druid:#{pid}\"\n uri = URI.parse(@fedora + '/objects/' + pid + '/datastreams/' + dsID + '/content') \n RestClient.get(uri.to_s)\n rescue => e\n e.response \n end", "def meta\n data,stat = @zk.get(:path => ZK::Config::ServicePath + \"/#{@service_name}/#{@name}\")\n stat\n end", "def deserialize_service_instance(data)\n log.debug \"synapse: deserializing process data\"\n decoded = JSON.parse(data)\n\n host = decoded['host'] || (raise ValueError, 'instance json data does not have host key')\n port = decoded['port'] || (raise ValueError, 'instance json data does not have port key')\n name = decoded['name'] || nil\n weight = decoded['weight'] || nil\n\n return host, port, name, weight\n end", "def get(id)\n client.read(dstu2_model, id)\n end", "def show_service(client, args, options)\n response = client.get(\"#{RESOURCE_PATH}/#{args[0]}\")\n\n if CloudClient::is_error?(response)\n [response.code.to_i, response.to_s]\n else\n #[0,response.body]\n if options[:json]\n [0,response.body]\n else\n str=\"%-20s: %-20s\"\n str_h1=\"%-80s\"\n\n document_hash = JSON.parse(response.body)\n template = document_hash['DOCUMENT']['TEMPLATE']['BODY']\n\n CLIHelper.print_header(str_h1 % \"SERVICE #{document_hash['DOCUMENT']['ID']} INFORMATION\")\n\n puts str % [\"ID\", document_hash['DOCUMENT']['ID']]\n puts str % [\"NAME\", document_hash['DOCUMENT']['NAME']]\n puts str % [\"USER\", document_hash['DOCUMENT']['UNAME']]\n puts str % [\"GROUP\",document_hash['DOCUMENT']['GNAME']]\n\n puts str % [\"STRATEGY\", template['deployment']]\n puts str % [\"SERVICE STATE\", Service.state_str(template['state'])]\n puts str % [\"SHUTDOWN\", template['shutdown_action']] if template['shutdown_action']\n\n puts\n\n CLIHelper.print_header(str_h1 % \"PERMISSIONS\",false)\n\n [\"OWNER\", \"GROUP\", \"OTHER\"].each { |e|\n mask = \"---\"\n mask[0] = \"u\" if document_hash['DOCUMENT']['PERMISSIONS'][\"#{e}_U\"] == \"1\"\n mask[1] = \"m\" if document_hash['DOCUMENT']['PERMISSIONS'][\"#{e}_M\"] == \"1\"\n mask[2] = \"a\" if document_hash['DOCUMENT']['PERMISSIONS'][\"#{e}_A\"] == \"1\"\n\n puts str % [e, mask]\n }\n\n puts\n\n template['roles'].each {|role|\n CLIHelper.print_header(\"ROLE #{role['name']}\", false)\n\n puts str % [\"ROLE STATE\", Role.state_str(role['state'])]\n puts str % [\"PARENTS\", role['parents'].join(', ')] if role['parents']\n puts str % [\"VM TEMPLATE\", role['vm_template']]\n puts str % [\"CARDINALITY\", role['cardinality']]\n puts str % [\"MIN VMS\", role['min_vms']] if role['min_vms']\n puts str % [\"MAX VMS\", role['max_vms']] if role['max_vms']\n puts str % [\"COOLDOWN\", \"#{role['cooldown']}s\"] if role['cooldown']\n puts str % [\"SHUTDOWN\", role['shutdown_action']] if role['shutdown_action']\n\n puts \"NODES INFORMATION\"\n NODE_TABLE.show(role['nodes'])\n\n if !role['elasticity_policies'].nil? && role['elasticity_policies'].size > 0 || !role['scheduled_policies'].nil? && role['scheduled_policies'].size > 0\n puts\n puts \"ELASTICITY RULES\"\n\n if role['elasticity_policies'] && role['elasticity_policies'].size > 0\n puts\n# puts \"ELASTICITY POLICIES\"\n CLIHelper::ShowTable.new(nil, self) do\n column :ADJUST, \"\", :left, :size=>12 do |d|\n adjust_str(d)\n end\n\n column :EXPRESSION, \"\", :left, :size=>48 do |d|\n if !d['expression_evaluated'].nil?\n d['expression_evaluated']\n else\n d['expression']\n end\n end\n\n column :'EVALS', \"\", :right, :size=>5 do |d|\n if d['period_number']\n \"#{d['true_evals'].to_i}/#{d['period_number']}\"\n else\n \"-\"\n end\n end\n\n column :PERIOD, \"\", :size=>6 do |d|\n d['period'] ? \"#{d['period']}s\" : '-'\n end\n\n column :COOL, \"\", :size=>5 do |d|\n d['cooldown'] ? \"#{d['cooldown']}s\" : '-'\n end\n\n default :ADJUST, :EXPRESSION, :EVALS, :PERIOD, :COOL\n end.show([role['elasticity_policies']].flatten, {})\n end\n\n if role['scheduled_policies'] && role['scheduled_policies'].size > 0\n puts\n# puts \"SCHEDULED POLICIES\"\n CLIHelper::ShowTable.new(nil, self) do\n column :ADJUST, \"\", :left, :size=>12 do |d|\n adjust_str(d)\n end\n\n column :TIME, \"\", :left, :size=>67 do |d|\n if d['start_time']\n Time.parse(d['start_time']).to_s\n else\n d['recurrence']\n end\n end\n\n default :ADJUST, :TIME\n end.show([role['scheduled_policies']].flatten, {})\n end\n end\n\n puts\n }\n\n puts\n\n CLIHelper.print_header(str_h1 % \"LOG MESSAGES\",false)\n\n if template['log']\n template['log'].each { |log|\n t = Time.at(log['timestamp']).strftime(\"%m/%d/%y %H:%M\")\n puts \"#{t} [#{log['severity']}] #{log['message']}\"\n }\n end\n\n 0\n end\n end\nend", "def show\n @service = Service.find(params[:id])\n end", "def start_service\n object = DBusObject.new(@main, self)\n service = @bus.request_service(SERVICE)\n service.export object\n end", "def read_tier0_0(tier_0_id, opts = {})\n data, _status_code, _headers = read_tier0_0_with_http_info(tier_0_id, opts)\n data\n end", "def client_3\n reading = READING\n base_charge(reading)\n end", "def get_instance(payload)\n NewFactorInstance.new(\n @version,\n payload,\n service_sid: @solution[:service_sid],\n identity: @solution[:identity],\n )\n end", "def read_ntp_service_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: NsxComponentAdministrationApi.read_ntp_service ...\"\n end\n # resource path\n local_var_path = \"/node/services/ntp\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'NodeNtpServiceProperties')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: NsxComponentAdministrationApi#read_ntp_service\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def cycle\n TflApi::Client::Cycle.new(self)\n end", "def read_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_instance(name)\n name = name[0, 2].upcase\n cls = case name\n when 'ET'\n 'Rbeapi::Api::EthernetInterface'\n when 'PO'\n 'Rbeapi::Api::PortchannelInterface'\n when 'VX'\n 'Rbeapi::Api::VxlanInterface'\n when 'VL'\n 'Rbeapi::Api::VlanInterface'\n else\n 'Rbeapi::Api::BaseInterface'\n end\n\n return @instances[name] if @instances.include?(cls)\n instance = Rbeapi::Utils.class_from_string(cls).new(@node)\n @instances[name] = instance\n instance\n end", "def read_policy_dns_forwarder_on_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/dns-forwarder'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyDnsForwarder')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi#read_policy_dns_forwarder_on_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end" ]
[ "0.5574296", "0.5488678", "0.54819524", "0.54297084", "0.5396788", "0.53639716", "0.535077", "0.530471", "0.52592874", "0.52423716", "0.5169323", "0.5124693", "0.50960845", "0.5072182", "0.5030228", "0.5030228", "0.5030228", "0.5030228", "0.502663", "0.5024412", "0.49934784", "0.49516293", "0.49432898", "0.49331135", "0.49318206", "0.4925339", "0.49132454", "0.49067616", "0.490437", "0.4898804", "0.48848996", "0.48842806", "0.48696542", "0.48691413", "0.48669907", "0.48628306", "0.48590076", "0.48548448", "0.48548448", "0.48431903", "0.48420075", "0.48406562", "0.48394275", "0.483588", "0.4832456", "0.48308584", "0.48302987", "0.48301002", "0.48296708", "0.48291892", "0.4824112", "0.48208097", "0.48194975", "0.48143893", "0.48136574", "0.4812813", "0.48082045", "0.4792199", "0.4788416", "0.47708762", "0.47691223", "0.47655746", "0.47475022", "0.47422647", "0.47413787", "0.4740554", "0.4740554", "0.4740554", "0.4740554", "0.4740554", "0.4740554", "0.4740554", "0.47400954", "0.47346988", "0.47276604", "0.4720405", "0.47094646", "0.47054067", "0.4701749", "0.46986067", "0.46962234", "0.4684204", "0.46827483", "0.46827483", "0.46744716", "0.46721032", "0.46705088", "0.46672758", "0.46667784", "0.4666119", "0.46601313", "0.46543157", "0.46500933", "0.46470016", "0.46452016", "0.4644763", "0.46438378", "0.46411282", "0.46389169", "0.46376476" ]
0.47879317
59
Read Tier1 BYOD service instance Read Tier1 BYOD service instance
def read_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance ...' end # verify the required parameter 'tier_1_id' is set if @api_client.config.client_side_validation && tier_1_id.nil? fail ArgumentError, "Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance" end # verify the required parameter 'locale_service_id' is set if @api_client.config.client_side_validation && locale_service_id.nil? fail ArgumentError, "Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance" end # verify the required parameter 'service_instance_id' is set if @api_client.config.client_side_validation && service_instance_id.nil? fail ArgumentError, "Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance" end # resource path local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ByodPolicyServiceInstance') if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_byod_policy_service_instance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def service\n @service ||= bus.service('com.dubstepdish.i3dstatus')\n end", "def read_tier1_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#read_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#read_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1(tier_1_id, opts = {})\n data, _status_code, _headers = read_tier1_with_http_info(tier_1_id, opts)\n data\n end", "def read_service_payments\r\n read_service_payment while peek == 'SVC'\r\n self\r\n end", "def read_tier1_0(tier_1_id, opts = {})\n data, _status_code, _headers = read_tier1_0_with_http_info(tier_1_id, opts)\n data\n end", "def service; end", "def read_instance\n raise NotImplementedError, 'read_instance needs to be implemented by child providers'\n end", "def service\n @service\n end", "def service; services.first; end", "def bi_service\n end", "def client\n Piloto::Paws.new.dynamo\nend", "def read\n iface = Qt::DBusInterface.new(SERVICE_NAME, READ_PATH, \"\", Qt::DBusConnection.sessionBus)\n raise \"D-BUS Interface Error : #{Qt::DBusConnection.sessionBus.lastError.message}\" unless iface.valid?\n msg = iface.call(Qt::DBus::BlockWithGui, \"read\", url)\n reply = Qt::DBusReply.new(msg)\n raise \"D-BUS Reply Error : #{reply.error.message}\" unless reply.valid?\n reply.value\n end", "def read\n end", "def read\n end", "def read\n end", "def read\n end", "def read\n end", "def obtain_description\n\t\t#it's only pulling traffic train status for now, but we will get it to pull out the description instead.\n\t\tService.find_by(name: self.service_name).traffic\n\tend", "def obtain_description\n\t\t#it's only pulling traffic train status for now, but we will get it to pull out the description instead.\n\t\tService.find_by(name: self.service_name).traffic\n\tend", "def tires_read(tire, opts = {})\n data, _status_code, _headers = tires_read_with_http_info(tire, opts)\n data\n end", "def read_tier0_with_http_info(tier_0_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi.read_tier0 ...'\n end\n # verify the required parameter 'tier_0_id' is set\n if @api_client.config.client_side_validation && tier_0_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_0_id' when calling PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi.read_tier0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-0s/{tier-0-id}'.sub('{' + 'tier-0-id' + '}', tier_0_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier0')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi#read_tier0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def service\n return softlayer_client[:Ticket].object_with_id(self.id)\n end", "def read\n \n end", "def instance\n perform_request_with_object(:get, '/api/v1/instance', {}, Mastodon::Instance)\n end", "def service\n @service ||= fetcher.get(Service, service_id)\n end", "def read\nend", "def _read type, name\n result = @elasticsupport.client.search index: _index_for(type), type: type.to_s, q: \"name:#{name}\"\n result[\"hits\"][\"hits\"][0] rescue nil\n end", "def service\n StockManagementService.new\n end", "def servicio # :doc\n id = params[:service_id]\n if id.present?\n \t\tService.find(params[:service_id]) \n \tend \n end", "def read_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_byod_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def retrieve(service:, resource:, qos: {} )\n port = AnyPort::Port.new.port_for_message_exchange_pattern(qos)\n # result = Try {\n result = with_circuit do |circuit|\n circuit.service_name = resource\n end.call { get(port, service, resource, ENVIRONMENT) }\n # }\n\n # result.get_or_else {raise self.class::RequestFailure}\n # begin\n # result = with_circuit do |circuit|\n # circuit.service_name = resource\n # end.call {MockClient.new.call(service, resource, :development)}\n # rescue AnyPort::CircuitBreaker::CircuitOpen => e\n # puts \"===>CircuitBreaker Open Exception\"\n # rescue AnyPort::PortException => e\n # puts \"===>General Port Exception, #{e}\"\n # end\n end", "def instance\n perform_request_with_object(:get, '/api/v1/instance', {},\n Mastodon::Instance)\n end", "def service\n return @service\n end", "def service(nickname, reserved, distribution, type)\n end", "def fetch_dataone(vin)\n config = Lynr.config('app').vin.dataone\n url = config.url\n data = {\n authorization_code: config.auth_code,\n client_id: config.client_id,\n decoder_query: dataone_xml_query(vin),\n }\n Lynr.metrics.time('time.service:dataone.fetch') do\n RestClient.post url, data\n end\n end", "def read(_request)\n raise NotImplementedError, 'Implement this method in your strategy'\n end", "def get_instance(payload)\n ServiceInstance.new(@version, payload)\n end", "def get_instance(payload)\n ServiceInstance.new(@version, payload)\n end", "def read_tier0_0_with_http_info(tier_0_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi.read_tier0_0 ...'\n end\n # verify the required parameter 'tier_0_id' is set\n if @api_client.config.client_side_validation && tier_0_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_0_id' when calling PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi.read_tier0_0\"\n end\n # resource path\n local_var_path = '/infra/tier-0s/{tier-0-id}'.sub('{' + 'tier-0-id' + '}', tier_0_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier0')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi#read_tier0_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def services\n end", "def set_idti_service\n @idti_service = IdtiService.find(params[:id])\n end", "def service\n softlayer_client[:Software_Component].object_with_id(self.id)\n end", "def get( name, *args )\n point = find_definition( name )\n raise ServiceNotFound, \"#{fullname}.#{name}\" unless point\n\n point.instance( self, *args )\n end", "def show\n @service = Service.find(params[:id])\n end", "def read_tier0(tier_0_id, opts = {})\n data, _status_code, _headers = read_tier0_with_http_info(tier_0_id, opts)\n data\n end", "def services\n\n end", "def get_usage(args= {})\n args = {:day=>\"today\", :type=>\"heat\"}.merge(args)\n result = HTTParty.get( @tstat_ip + '/tstat/datalog', :headers => @headers) \n \n day = result[args[:day]]\n runtime = day[args[:type] + '_runtime']\n\n return runtime\n end", "def read(*args)\n #This is a stub, used for indexing\n end", "def service(id)\n request :get, \"/services/#{id}\"\n end", "def get_by_id(id)\n self.class.get(\"/aldebaran-instances/instances/#{id}\", :basic_auth => @auth)\n end", "def read(name=@name)\n begin\n a = self.class.new\n res = self.class.get(\"#{self.class.noah_base_path}/#{name}\").parsed_response\n res.each do |key, value|\n a.instance_variable_set(\"@#{key}\", value)\n end\n a\n rescue Errno::ECONNREFUSED\n \"Noah server is unreachable\"\n end\n end", "def driver\n Fc3Service\n end", "def read_tier1_byod_policy_service_instance_0(tier_1_id, locale_service_id, service_instance_id, opts = {})\n data, _status_code, _headers = read_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts)\n data\n end", "def services\n\tend", "def read\n raise NotImplementedError\n end", "def get_reading\n\t\turi = URI.parse('http://localhost:5000/thermometers.json')\n\t\tthermo_response = Net::HTTP.get_response(uri)\n\t\tcheck = thermo_response.body\n\t\tj = JSON.parse(check)\n\tend", "def service\n return softlayer_client[\"Virtual_Guest\"].object_with_id(self.id)\n end", "def read_tier1_byod_policy_service_instance(tier_1_id, locale_service_id, service_instance_id, opts = {})\n data, _status_code, _headers = read_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts)\n data\n end", "def connect\n service\n end", "def tei druid\n url = \"#{config.stacks}/file/druid:#{druid}/#{druid}.xml\"\n open(url)\n# File.open(\"/home/lyberadmin/frda/ap_tei/#{druid}.xml\")\n rescue Exception => e\n logger.error(\"error while retrieving tei at #{url} -- #{e.message}\")\n# logger.error(\"error while retrieving tei #{druid} -- #{e.message}\")\n \"<TEI.2/>\"\n end", "def service\n softlayer_client[:Network_Storage].object_with_id(self.id)\n end", "def vread(klass, id, version_id, format=@default_format)\n options = { resource: klass, id: id, format: format, history: {id: version_id} }\n reply = get resource_url(options), fhir_headers(options)\n reply.resource = parse_reply(klass, format, reply)\n reply.resource_class = klass\n reply\n end", "def read_tier1_locale_services_0_with_http_info(tier_1_id, locale_services_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#read_tier1_locale_services_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def listserv\n listservs.first\n end", "def read; end", "def read; end", "def read; end", "def read; end", "def read; end", "def read; end", "def read; end", "def index\n @service_particulars = ServiceParticular.all\n @service_particular = ServiceParticular.new\n end", "def vread(klass, id, version_id, format = nil)\n headers = { accept: \"#{format}\" } if format\n format ||= @default_format\n options = { resource: klass, id: id, format: format, history: { id: version_id } }\n reply = get resource_url(options), fhir_headers(headers)\n reply.resource = parse_reply(klass, format, reply)\n reply.resource_class = klass\n reply\n end", "def read_tier1_service_interface_0_with_http_info(tier_1_id, locale_service_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_service_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def service_name; end", "def read(id)\n # do not respond with anything\n end", "def service\n return softlayer_client[:Virtual_Guest].object_with_id(self.id)\n end", "def get\n appid = ENV['TRIMET_APP_ID']\n response = Unirest.get( \"http://developer.trimet.org/ws/v2/vehicles?appid=#{appid}\" )\n response.body\nend", "def read_io io\n handle_client io\n end", "def read_tier1_service_interface_with_http_info(tier_1_id, locale_service_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_service_interface\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def service\n self.original_service or Service.find_by_name(\"FieldStatus\")\n end", "def read_one(query)\n adapter.read_one(query)\n end", "def read_one(query)\n adapter.read_one(query)\n end", "def read_vms\n end", "def get_datastream( pid, dsID )\n pid.include?(\"druid\") ? pid = pid : pid = \"druid:#{pid}\"\n uri = URI.parse(@fedora + '/objects/' + pid + '/datastreams/' + dsID + '/content') \n RestClient.get(uri.to_s)\n rescue => e\n e.response \n end", "def meta\n data,stat = @zk.get(:path => ZK::Config::ServicePath + \"/#{@service_name}/#{@name}\")\n stat\n end", "def deserialize_service_instance(data)\n log.debug \"synapse: deserializing process data\"\n decoded = JSON.parse(data)\n\n host = decoded['host'] || (raise ValueError, 'instance json data does not have host key')\n port = decoded['port'] || (raise ValueError, 'instance json data does not have port key')\n name = decoded['name'] || nil\n weight = decoded['weight'] || nil\n\n return host, port, name, weight\n end", "def get(id)\n client.read(dstu2_model, id)\n end", "def show_service(client, args, options)\n response = client.get(\"#{RESOURCE_PATH}/#{args[0]}\")\n\n if CloudClient::is_error?(response)\n [response.code.to_i, response.to_s]\n else\n #[0,response.body]\n if options[:json]\n [0,response.body]\n else\n str=\"%-20s: %-20s\"\n str_h1=\"%-80s\"\n\n document_hash = JSON.parse(response.body)\n template = document_hash['DOCUMENT']['TEMPLATE']['BODY']\n\n CLIHelper.print_header(str_h1 % \"SERVICE #{document_hash['DOCUMENT']['ID']} INFORMATION\")\n\n puts str % [\"ID\", document_hash['DOCUMENT']['ID']]\n puts str % [\"NAME\", document_hash['DOCUMENT']['NAME']]\n puts str % [\"USER\", document_hash['DOCUMENT']['UNAME']]\n puts str % [\"GROUP\",document_hash['DOCUMENT']['GNAME']]\n\n puts str % [\"STRATEGY\", template['deployment']]\n puts str % [\"SERVICE STATE\", Service.state_str(template['state'])]\n puts str % [\"SHUTDOWN\", template['shutdown_action']] if template['shutdown_action']\n\n puts\n\n CLIHelper.print_header(str_h1 % \"PERMISSIONS\",false)\n\n [\"OWNER\", \"GROUP\", \"OTHER\"].each { |e|\n mask = \"---\"\n mask[0] = \"u\" if document_hash['DOCUMENT']['PERMISSIONS'][\"#{e}_U\"] == \"1\"\n mask[1] = \"m\" if document_hash['DOCUMENT']['PERMISSIONS'][\"#{e}_M\"] == \"1\"\n mask[2] = \"a\" if document_hash['DOCUMENT']['PERMISSIONS'][\"#{e}_A\"] == \"1\"\n\n puts str % [e, mask]\n }\n\n puts\n\n template['roles'].each {|role|\n CLIHelper.print_header(\"ROLE #{role['name']}\", false)\n\n puts str % [\"ROLE STATE\", Role.state_str(role['state'])]\n puts str % [\"PARENTS\", role['parents'].join(', ')] if role['parents']\n puts str % [\"VM TEMPLATE\", role['vm_template']]\n puts str % [\"CARDINALITY\", role['cardinality']]\n puts str % [\"MIN VMS\", role['min_vms']] if role['min_vms']\n puts str % [\"MAX VMS\", role['max_vms']] if role['max_vms']\n puts str % [\"COOLDOWN\", \"#{role['cooldown']}s\"] if role['cooldown']\n puts str % [\"SHUTDOWN\", role['shutdown_action']] if role['shutdown_action']\n\n puts \"NODES INFORMATION\"\n NODE_TABLE.show(role['nodes'])\n\n if !role['elasticity_policies'].nil? && role['elasticity_policies'].size > 0 || !role['scheduled_policies'].nil? && role['scheduled_policies'].size > 0\n puts\n puts \"ELASTICITY RULES\"\n\n if role['elasticity_policies'] && role['elasticity_policies'].size > 0\n puts\n# puts \"ELASTICITY POLICIES\"\n CLIHelper::ShowTable.new(nil, self) do\n column :ADJUST, \"\", :left, :size=>12 do |d|\n adjust_str(d)\n end\n\n column :EXPRESSION, \"\", :left, :size=>48 do |d|\n if !d['expression_evaluated'].nil?\n d['expression_evaluated']\n else\n d['expression']\n end\n end\n\n column :'EVALS', \"\", :right, :size=>5 do |d|\n if d['period_number']\n \"#{d['true_evals'].to_i}/#{d['period_number']}\"\n else\n \"-\"\n end\n end\n\n column :PERIOD, \"\", :size=>6 do |d|\n d['period'] ? \"#{d['period']}s\" : '-'\n end\n\n column :COOL, \"\", :size=>5 do |d|\n d['cooldown'] ? \"#{d['cooldown']}s\" : '-'\n end\n\n default :ADJUST, :EXPRESSION, :EVALS, :PERIOD, :COOL\n end.show([role['elasticity_policies']].flatten, {})\n end\n\n if role['scheduled_policies'] && role['scheduled_policies'].size > 0\n puts\n# puts \"SCHEDULED POLICIES\"\n CLIHelper::ShowTable.new(nil, self) do\n column :ADJUST, \"\", :left, :size=>12 do |d|\n adjust_str(d)\n end\n\n column :TIME, \"\", :left, :size=>67 do |d|\n if d['start_time']\n Time.parse(d['start_time']).to_s\n else\n d['recurrence']\n end\n end\n\n default :ADJUST, :TIME\n end.show([role['scheduled_policies']].flatten, {})\n end\n end\n\n puts\n }\n\n puts\n\n CLIHelper.print_header(str_h1 % \"LOG MESSAGES\",false)\n\n if template['log']\n template['log'].each { |log|\n t = Time.at(log['timestamp']).strftime(\"%m/%d/%y %H:%M\")\n puts \"#{t} [#{log['severity']}] #{log['message']}\"\n }\n end\n\n 0\n end\n end\nend", "def show\n @service = Service.find(params[:id])\n end", "def start_service\n object = DBusObject.new(@main, self)\n service = @bus.request_service(SERVICE)\n service.export object\n end", "def read_tier0_0(tier_0_id, opts = {})\n data, _status_code, _headers = read_tier0_0_with_http_info(tier_0_id, opts)\n data\n end", "def client_3\n reading = READING\n base_charge(reading)\n end", "def get_instance(payload)\n NewFactorInstance.new(\n @version,\n payload,\n service_sid: @solution[:service_sid],\n identity: @solution[:identity],\n )\n end", "def read_ntp_service_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: NsxComponentAdministrationApi.read_ntp_service ...\"\n end\n # resource path\n local_var_path = \"/node/services/ntp\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'NodeNtpServiceProperties')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: NsxComponentAdministrationApi#read_ntp_service\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def cycle\n TflApi::Client::Cycle.new(self)\n end", "def read_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_instance(name)\n name = name[0, 2].upcase\n cls = case name\n when 'ET'\n 'Rbeapi::Api::EthernetInterface'\n when 'PO'\n 'Rbeapi::Api::PortchannelInterface'\n when 'VX'\n 'Rbeapi::Api::VxlanInterface'\n when 'VL'\n 'Rbeapi::Api::VlanInterface'\n else\n 'Rbeapi::Api::BaseInterface'\n end\n\n return @instances[name] if @instances.include?(cls)\n instance = Rbeapi::Utils.class_from_string(cls).new(@node)\n @instances[name] = instance\n instance\n end", "def read_policy_dns_forwarder_on_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/dns-forwarder'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyDnsForwarder')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi#read_policy_dns_forwarder_on_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end" ]
[ "0.5574296", "0.5488678", "0.54819524", "0.54297084", "0.5396788", "0.53639716", "0.535077", "0.530471", "0.52592874", "0.52423716", "0.5169323", "0.5124693", "0.50960845", "0.5072182", "0.5030228", "0.5030228", "0.5030228", "0.5030228", "0.502663", "0.5024412", "0.49934784", "0.49516293", "0.49432898", "0.49331135", "0.49318206", "0.4925339", "0.49132454", "0.49067616", "0.490437", "0.4898804", "0.48848996", "0.48842806", "0.48696542", "0.48691413", "0.48669907", "0.48628306", "0.48590076", "0.48548448", "0.48548448", "0.48431903", "0.48420075", "0.48406562", "0.483588", "0.4832456", "0.48308584", "0.48302987", "0.48301002", "0.48296708", "0.48291892", "0.4824112", "0.48208097", "0.48194975", "0.48143893", "0.48136574", "0.4812813", "0.48082045", "0.4792199", "0.4788416", "0.47879317", "0.47708762", "0.47691223", "0.47655746", "0.47475022", "0.47422647", "0.47413787", "0.4740554", "0.4740554", "0.4740554", "0.4740554", "0.4740554", "0.4740554", "0.4740554", "0.47400954", "0.47346988", "0.47276604", "0.4720405", "0.47094646", "0.47054067", "0.4701749", "0.46986067", "0.46962234", "0.4684204", "0.46827483", "0.46827483", "0.46744716", "0.46721032", "0.46705088", "0.46672758", "0.46667784", "0.4666119", "0.46601313", "0.46543157", "0.46500933", "0.46470016", "0.46452016", "0.4644763", "0.46438378", "0.46411282", "0.46389169", "0.46376476" ]
0.48394275
42
Read Tier1 BYOD service instance Read Tier1 BYOD service instance
def read_tier1_byod_policy_service_instance_0(tier_1_id, locale_service_id, service_instance_id, opts = {}) data, _status_code, _headers = read_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def service\n @service ||= bus.service('com.dubstepdish.i3dstatus')\n end", "def read_tier1_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#read_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#read_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1(tier_1_id, opts = {})\n data, _status_code, _headers = read_tier1_with_http_info(tier_1_id, opts)\n data\n end", "def read_service_payments\r\n read_service_payment while peek == 'SVC'\r\n self\r\n end", "def read_tier1_0(tier_1_id, opts = {})\n data, _status_code, _headers = read_tier1_0_with_http_info(tier_1_id, opts)\n data\n end", "def service; end", "def read_instance\n raise NotImplementedError, 'read_instance needs to be implemented by child providers'\n end", "def service\n @service\n end", "def service; services.first; end", "def bi_service\n end", "def client\n Piloto::Paws.new.dynamo\nend", "def read\n iface = Qt::DBusInterface.new(SERVICE_NAME, READ_PATH, \"\", Qt::DBusConnection.sessionBus)\n raise \"D-BUS Interface Error : #{Qt::DBusConnection.sessionBus.lastError.message}\" unless iface.valid?\n msg = iface.call(Qt::DBus::BlockWithGui, \"read\", url)\n reply = Qt::DBusReply.new(msg)\n raise \"D-BUS Reply Error : #{reply.error.message}\" unless reply.valid?\n reply.value\n end", "def read\n end", "def read\n end", "def read\n end", "def read\n end", "def read\n end", "def obtain_description\n\t\t#it's only pulling traffic train status for now, but we will get it to pull out the description instead.\n\t\tService.find_by(name: self.service_name).traffic\n\tend", "def obtain_description\n\t\t#it's only pulling traffic train status for now, but we will get it to pull out the description instead.\n\t\tService.find_by(name: self.service_name).traffic\n\tend", "def tires_read(tire, opts = {})\n data, _status_code, _headers = tires_read_with_http_info(tire, opts)\n data\n end", "def read_tier0_with_http_info(tier_0_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi.read_tier0 ...'\n end\n # verify the required parameter 'tier_0_id' is set\n if @api_client.config.client_side_validation && tier_0_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_0_id' when calling PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi.read_tier0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-0s/{tier-0-id}'.sub('{' + 'tier-0-id' + '}', tier_0_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier0')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi#read_tier0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def service\n return softlayer_client[:Ticket].object_with_id(self.id)\n end", "def instance\n perform_request_with_object(:get, '/api/v1/instance', {}, Mastodon::Instance)\n end", "def read\n \n end", "def service\n @service ||= fetcher.get(Service, service_id)\n end", "def read\nend", "def _read type, name\n result = @elasticsupport.client.search index: _index_for(type), type: type.to_s, q: \"name:#{name}\"\n result[\"hits\"][\"hits\"][0] rescue nil\n end", "def service\n StockManagementService.new\n end", "def servicio # :doc\n id = params[:service_id]\n if id.present?\n \t\tService.find(params[:service_id]) \n \tend \n end", "def read_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_byod_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def retrieve(service:, resource:, qos: {} )\n port = AnyPort::Port.new.port_for_message_exchange_pattern(qos)\n # result = Try {\n result = with_circuit do |circuit|\n circuit.service_name = resource\n end.call { get(port, service, resource, ENVIRONMENT) }\n # }\n\n # result.get_or_else {raise self.class::RequestFailure}\n # begin\n # result = with_circuit do |circuit|\n # circuit.service_name = resource\n # end.call {MockClient.new.call(service, resource, :development)}\n # rescue AnyPort::CircuitBreaker::CircuitOpen => e\n # puts \"===>CircuitBreaker Open Exception\"\n # rescue AnyPort::PortException => e\n # puts \"===>General Port Exception, #{e}\"\n # end\n end", "def instance\n perform_request_with_object(:get, '/api/v1/instance', {},\n Mastodon::Instance)\n end", "def service\n return @service\n end", "def service(nickname, reserved, distribution, type)\n end", "def fetch_dataone(vin)\n config = Lynr.config('app').vin.dataone\n url = config.url\n data = {\n authorization_code: config.auth_code,\n client_id: config.client_id,\n decoder_query: dataone_xml_query(vin),\n }\n Lynr.metrics.time('time.service:dataone.fetch') do\n RestClient.post url, data\n end\n end", "def read(_request)\n raise NotImplementedError, 'Implement this method in your strategy'\n end", "def get_instance(payload)\n ServiceInstance.new(@version, payload)\n end", "def get_instance(payload)\n ServiceInstance.new(@version, payload)\n end", "def read_tier0_0_with_http_info(tier_0_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi.read_tier0_0 ...'\n end\n # verify the required parameter 'tier_0_id' is set\n if @api_client.config.client_side_validation && tier_0_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_0_id' when calling PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi.read_tier0_0\"\n end\n # resource path\n local_var_path = '/infra/tier-0s/{tier-0-id}'.sub('{' + 'tier-0-id' + '}', tier_0_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier0')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi#read_tier0_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def services\n end", "def set_idti_service\n @idti_service = IdtiService.find(params[:id])\n end", "def read_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_byod_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def service\n softlayer_client[:Software_Component].object_with_id(self.id)\n end", "def get( name, *args )\n point = find_definition( name )\n raise ServiceNotFound, \"#{fullname}.#{name}\" unless point\n\n point.instance( self, *args )\n end", "def show\n @service = Service.find(params[:id])\n end", "def services\n\n end", "def get_usage(args= {})\n args = {:day=>\"today\", :type=>\"heat\"}.merge(args)\n result = HTTParty.get( @tstat_ip + '/tstat/datalog', :headers => @headers) \n \n day = result[args[:day]]\n runtime = day[args[:type] + '_runtime']\n\n return runtime\n end", "def read_tier0(tier_0_id, opts = {})\n data, _status_code, _headers = read_tier0_with_http_info(tier_0_id, opts)\n data\n end", "def read(*args)\n #This is a stub, used for indexing\n end", "def service(id)\n request :get, \"/services/#{id}\"\n end", "def get_by_id(id)\n self.class.get(\"/aldebaran-instances/instances/#{id}\", :basic_auth => @auth)\n end", "def read(name=@name)\n begin\n a = self.class.new\n res = self.class.get(\"#{self.class.noah_base_path}/#{name}\").parsed_response\n res.each do |key, value|\n a.instance_variable_set(\"@#{key}\", value)\n end\n a\n rescue Errno::ECONNREFUSED\n \"Noah server is unreachable\"\n end\n end", "def driver\n Fc3Service\n end", "def services\n\tend", "def read\n raise NotImplementedError\n end", "def get_reading\n\t\turi = URI.parse('http://localhost:5000/thermometers.json')\n\t\tthermo_response = Net::HTTP.get_response(uri)\n\t\tcheck = thermo_response.body\n\t\tj = JSON.parse(check)\n\tend", "def service\n return softlayer_client[\"Virtual_Guest\"].object_with_id(self.id)\n end", "def read_tier1_byod_policy_service_instance(tier_1_id, locale_service_id, service_instance_id, opts = {})\n data, _status_code, _headers = read_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts)\n data\n end", "def connect\n service\n end", "def tei druid\n url = \"#{config.stacks}/file/druid:#{druid}/#{druid}.xml\"\n open(url)\n# File.open(\"/home/lyberadmin/frda/ap_tei/#{druid}.xml\")\n rescue Exception => e\n logger.error(\"error while retrieving tei at #{url} -- #{e.message}\")\n# logger.error(\"error while retrieving tei #{druid} -- #{e.message}\")\n \"<TEI.2/>\"\n end", "def service\n softlayer_client[:Network_Storage].object_with_id(self.id)\n end", "def vread(klass, id, version_id, format=@default_format)\n options = { resource: klass, id: id, format: format, history: {id: version_id} }\n reply = get resource_url(options), fhir_headers(options)\n reply.resource = parse_reply(klass, format, reply)\n reply.resource_class = klass\n reply\n end", "def read_tier1_locale_services_0_with_http_info(tier_1_id, locale_services_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#read_tier1_locale_services_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def listserv\n listservs.first\n end", "def index\n @service_particulars = ServiceParticular.all\n @service_particular = ServiceParticular.new\n end", "def read; end", "def read; end", "def read; end", "def read; end", "def read; end", "def read; end", "def read; end", "def vread(klass, id, version_id, format = nil)\n headers = { accept: \"#{format}\" } if format\n format ||= @default_format\n options = { resource: klass, id: id, format: format, history: { id: version_id } }\n reply = get resource_url(options), fhir_headers(headers)\n reply.resource = parse_reply(klass, format, reply)\n reply.resource_class = klass\n reply\n end", "def read_tier1_service_interface_0_with_http_info(tier_1_id, locale_service_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_service_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def service_name; end", "def read(id)\n # do not respond with anything\n end", "def service\n return softlayer_client[:Virtual_Guest].object_with_id(self.id)\n end", "def get\n appid = ENV['TRIMET_APP_ID']\n response = Unirest.get( \"http://developer.trimet.org/ws/v2/vehicles?appid=#{appid}\" )\n response.body\nend", "def read_tier1_service_interface_with_http_info(tier_1_id, locale_service_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_service_interface\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_io io\n handle_client io\n end", "def service\n self.original_service or Service.find_by_name(\"FieldStatus\")\n end", "def read_one(query)\n adapter.read_one(query)\n end", "def read_one(query)\n adapter.read_one(query)\n end", "def read_vms\n end", "def meta\n data,stat = @zk.get(:path => ZK::Config::ServicePath + \"/#{@service_name}/#{@name}\")\n stat\n end", "def get_datastream( pid, dsID )\n pid.include?(\"druid\") ? pid = pid : pid = \"druid:#{pid}\"\n uri = URI.parse(@fedora + '/objects/' + pid + '/datastreams/' + dsID + '/content') \n RestClient.get(uri.to_s)\n rescue => e\n e.response \n end", "def show_service(client, args, options)\n response = client.get(\"#{RESOURCE_PATH}/#{args[0]}\")\n\n if CloudClient::is_error?(response)\n [response.code.to_i, response.to_s]\n else\n #[0,response.body]\n if options[:json]\n [0,response.body]\n else\n str=\"%-20s: %-20s\"\n str_h1=\"%-80s\"\n\n document_hash = JSON.parse(response.body)\n template = document_hash['DOCUMENT']['TEMPLATE']['BODY']\n\n CLIHelper.print_header(str_h1 % \"SERVICE #{document_hash['DOCUMENT']['ID']} INFORMATION\")\n\n puts str % [\"ID\", document_hash['DOCUMENT']['ID']]\n puts str % [\"NAME\", document_hash['DOCUMENT']['NAME']]\n puts str % [\"USER\", document_hash['DOCUMENT']['UNAME']]\n puts str % [\"GROUP\",document_hash['DOCUMENT']['GNAME']]\n\n puts str % [\"STRATEGY\", template['deployment']]\n puts str % [\"SERVICE STATE\", Service.state_str(template['state'])]\n puts str % [\"SHUTDOWN\", template['shutdown_action']] if template['shutdown_action']\n\n puts\n\n CLIHelper.print_header(str_h1 % \"PERMISSIONS\",false)\n\n [\"OWNER\", \"GROUP\", \"OTHER\"].each { |e|\n mask = \"---\"\n mask[0] = \"u\" if document_hash['DOCUMENT']['PERMISSIONS'][\"#{e}_U\"] == \"1\"\n mask[1] = \"m\" if document_hash['DOCUMENT']['PERMISSIONS'][\"#{e}_M\"] == \"1\"\n mask[2] = \"a\" if document_hash['DOCUMENT']['PERMISSIONS'][\"#{e}_A\"] == \"1\"\n\n puts str % [e, mask]\n }\n\n puts\n\n template['roles'].each {|role|\n CLIHelper.print_header(\"ROLE #{role['name']}\", false)\n\n puts str % [\"ROLE STATE\", Role.state_str(role['state'])]\n puts str % [\"PARENTS\", role['parents'].join(', ')] if role['parents']\n puts str % [\"VM TEMPLATE\", role['vm_template']]\n puts str % [\"CARDINALITY\", role['cardinality']]\n puts str % [\"MIN VMS\", role['min_vms']] if role['min_vms']\n puts str % [\"MAX VMS\", role['max_vms']] if role['max_vms']\n puts str % [\"COOLDOWN\", \"#{role['cooldown']}s\"] if role['cooldown']\n puts str % [\"SHUTDOWN\", role['shutdown_action']] if role['shutdown_action']\n\n puts \"NODES INFORMATION\"\n NODE_TABLE.show(role['nodes'])\n\n if !role['elasticity_policies'].nil? && role['elasticity_policies'].size > 0 || !role['scheduled_policies'].nil? && role['scheduled_policies'].size > 0\n puts\n puts \"ELASTICITY RULES\"\n\n if role['elasticity_policies'] && role['elasticity_policies'].size > 0\n puts\n# puts \"ELASTICITY POLICIES\"\n CLIHelper::ShowTable.new(nil, self) do\n column :ADJUST, \"\", :left, :size=>12 do |d|\n adjust_str(d)\n end\n\n column :EXPRESSION, \"\", :left, :size=>48 do |d|\n if !d['expression_evaluated'].nil?\n d['expression_evaluated']\n else\n d['expression']\n end\n end\n\n column :'EVALS', \"\", :right, :size=>5 do |d|\n if d['period_number']\n \"#{d['true_evals'].to_i}/#{d['period_number']}\"\n else\n \"-\"\n end\n end\n\n column :PERIOD, \"\", :size=>6 do |d|\n d['period'] ? \"#{d['period']}s\" : '-'\n end\n\n column :COOL, \"\", :size=>5 do |d|\n d['cooldown'] ? \"#{d['cooldown']}s\" : '-'\n end\n\n default :ADJUST, :EXPRESSION, :EVALS, :PERIOD, :COOL\n end.show([role['elasticity_policies']].flatten, {})\n end\n\n if role['scheduled_policies'] && role['scheduled_policies'].size > 0\n puts\n# puts \"SCHEDULED POLICIES\"\n CLIHelper::ShowTable.new(nil, self) do\n column :ADJUST, \"\", :left, :size=>12 do |d|\n adjust_str(d)\n end\n\n column :TIME, \"\", :left, :size=>67 do |d|\n if d['start_time']\n Time.parse(d['start_time']).to_s\n else\n d['recurrence']\n end\n end\n\n default :ADJUST, :TIME\n end.show([role['scheduled_policies']].flatten, {})\n end\n end\n\n puts\n }\n\n puts\n\n CLIHelper.print_header(str_h1 % \"LOG MESSAGES\",false)\n\n if template['log']\n template['log'].each { |log|\n t = Time.at(log['timestamp']).strftime(\"%m/%d/%y %H:%M\")\n puts \"#{t} [#{log['severity']}] #{log['message']}\"\n }\n end\n\n 0\n end\n end\nend", "def deserialize_service_instance(data)\n log.debug \"synapse: deserializing process data\"\n decoded = JSON.parse(data)\n\n host = decoded['host'] || (raise ValueError, 'instance json data does not have host key')\n port = decoded['port'] || (raise ValueError, 'instance json data does not have port key')\n name = decoded['name'] || nil\n weight = decoded['weight'] || nil\n\n return host, port, name, weight\n end", "def get(id)\n client.read(dstu2_model, id)\n end", "def show\n @service = Service.find(params[:id])\n end", "def start_service\n object = DBusObject.new(@main, self)\n service = @bus.request_service(SERVICE)\n service.export object\n end", "def read_tier0_0(tier_0_id, opts = {})\n data, _status_code, _headers = read_tier0_0_with_http_info(tier_0_id, opts)\n data\n end", "def client_3\n reading = READING\n base_charge(reading)\n end", "def get_instance(payload)\n NewFactorInstance.new(\n @version,\n payload,\n service_sid: @solution[:service_sid],\n identity: @solution[:identity],\n )\n end", "def read_ntp_service_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: NsxComponentAdministrationApi.read_ntp_service ...\"\n end\n # resource path\n local_var_path = \"/node/services/ntp\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'NodeNtpServiceProperties')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: NsxComponentAdministrationApi#read_ntp_service\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def cycle\n TflApi::Client::Cycle.new(self)\n end", "def read_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_policy_dns_forwarder_on_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/dns-forwarder'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyDnsForwarder')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi#read_policy_dns_forwarder_on_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_instance(name)\n name = name[0, 2].upcase\n cls = case name\n when 'ET'\n 'Rbeapi::Api::EthernetInterface'\n when 'PO'\n 'Rbeapi::Api::PortchannelInterface'\n when 'VX'\n 'Rbeapi::Api::VxlanInterface'\n when 'VL'\n 'Rbeapi::Api::VlanInterface'\n else\n 'Rbeapi::Api::BaseInterface'\n end\n\n return @instances[name] if @instances.include?(cls)\n instance = Rbeapi::Utils.class_from_string(cls).new(@node)\n @instances[name] = instance\n instance\n end" ]
[ "0.557516", "0.5490156", "0.54833305", "0.5430092", "0.5395923", "0.5364202", "0.535165", "0.53031456", "0.5260253", "0.52424943", "0.51703316", "0.51255286", "0.5094189", "0.5069521", "0.50275904", "0.50275904", "0.50275904", "0.50275904", "0.50266063", "0.5024382", "0.49922764", "0.4952712", "0.4944391", "0.49322766", "0.4930665", "0.49253157", "0.4910795", "0.49053177", "0.49051148", "0.48995593", "0.48860908", "0.48837146", "0.48700848", "0.4869947", "0.48675615", "0.4862523", "0.48576868", "0.48555204", "0.48555204", "0.48442033", "0.48427945", "0.4841728", "0.48407677", "0.48370573", "0.48328096", "0.483172", "0.48310217", "0.48309883", "0.4830271", "0.48264298", "0.48249605", "0.4821277", "0.48171845", "0.48156115", "0.4813857", "0.48055527", "0.47910434", "0.47900432", "0.47883466", "0.47703034", "0.47697213", "0.47657713", "0.47468653", "0.47435206", "0.47413704", "0.47399104", "0.4737775", "0.4737775", "0.4737775", "0.4737775", "0.4737775", "0.4737775", "0.4737775", "0.47339663", "0.4728836", "0.47220105", "0.4707303", "0.47069845", "0.47024846", "0.46975055", "0.46958676", "0.46849692", "0.46797988", "0.46797988", "0.46732256", "0.46715036", "0.46700087", "0.46671772", "0.46662655", "0.4666122", "0.46608782", "0.46546805", "0.46498662", "0.46467188", "0.46456656", "0.4644711", "0.46438128", "0.46422118", "0.46393782", "0.46389315" ]
0.48138833
54
Read Tier1 BYOD service instance Read Tier1 BYOD service instance
def read_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0 ...' end # verify the required parameter 'tier_1_id' is set if @api_client.config.client_side_validation && tier_1_id.nil? fail ArgumentError, "Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0" end # verify the required parameter 'locale_service_id' is set if @api_client.config.client_side_validation && locale_service_id.nil? fail ArgumentError, "Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0" end # verify the required parameter 'service_instance_id' is set if @api_client.config.client_side_validation && service_instance_id.nil? fail ArgumentError, "Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0" end # resource path local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ByodPolicyServiceInstance') if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_byod_policy_service_instance_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def service\n @service ||= bus.service('com.dubstepdish.i3dstatus')\n end", "def read_tier1_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#read_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#read_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1(tier_1_id, opts = {})\n data, _status_code, _headers = read_tier1_with_http_info(tier_1_id, opts)\n data\n end", "def read_service_payments\r\n read_service_payment while peek == 'SVC'\r\n self\r\n end", "def read_tier1_0(tier_1_id, opts = {})\n data, _status_code, _headers = read_tier1_0_with_http_info(tier_1_id, opts)\n data\n end", "def service; end", "def read_instance\n raise NotImplementedError, 'read_instance needs to be implemented by child providers'\n end", "def service\n @service\n end", "def service; services.first; end", "def bi_service\n end", "def client\n Piloto::Paws.new.dynamo\nend", "def read\n iface = Qt::DBusInterface.new(SERVICE_NAME, READ_PATH, \"\", Qt::DBusConnection.sessionBus)\n raise \"D-BUS Interface Error : #{Qt::DBusConnection.sessionBus.lastError.message}\" unless iface.valid?\n msg = iface.call(Qt::DBus::BlockWithGui, \"read\", url)\n reply = Qt::DBusReply.new(msg)\n raise \"D-BUS Reply Error : #{reply.error.message}\" unless reply.valid?\n reply.value\n end", "def read\n end", "def read\n end", "def read\n end", "def read\n end", "def read\n end", "def obtain_description\n\t\t#it's only pulling traffic train status for now, but we will get it to pull out the description instead.\n\t\tService.find_by(name: self.service_name).traffic\n\tend", "def obtain_description\n\t\t#it's only pulling traffic train status for now, but we will get it to pull out the description instead.\n\t\tService.find_by(name: self.service_name).traffic\n\tend", "def tires_read(tire, opts = {})\n data, _status_code, _headers = tires_read_with_http_info(tire, opts)\n data\n end", "def read_tier0_with_http_info(tier_0_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi.read_tier0 ...'\n end\n # verify the required parameter 'tier_0_id' is set\n if @api_client.config.client_side_validation && tier_0_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_0_id' when calling PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi.read_tier0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-0s/{tier-0-id}'.sub('{' + 'tier-0-id' + '}', tier_0_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier0')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi#read_tier0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def service\n return softlayer_client[:Ticket].object_with_id(self.id)\n end", "def read\n \n end", "def instance\n perform_request_with_object(:get, '/api/v1/instance', {}, Mastodon::Instance)\n end", "def service\n @service ||= fetcher.get(Service, service_id)\n end", "def read\nend", "def _read type, name\n result = @elasticsupport.client.search index: _index_for(type), type: type.to_s, q: \"name:#{name}\"\n result[\"hits\"][\"hits\"][0] rescue nil\n end", "def service\n StockManagementService.new\n end", "def servicio # :doc\n id = params[:service_id]\n if id.present?\n \t\tService.find(params[:service_id]) \n \tend \n end", "def retrieve(service:, resource:, qos: {} )\n port = AnyPort::Port.new.port_for_message_exchange_pattern(qos)\n # result = Try {\n result = with_circuit do |circuit|\n circuit.service_name = resource\n end.call { get(port, service, resource, ENVIRONMENT) }\n # }\n\n # result.get_or_else {raise self.class::RequestFailure}\n # begin\n # result = with_circuit do |circuit|\n # circuit.service_name = resource\n # end.call {MockClient.new.call(service, resource, :development)}\n # rescue AnyPort::CircuitBreaker::CircuitOpen => e\n # puts \"===>CircuitBreaker Open Exception\"\n # rescue AnyPort::PortException => e\n # puts \"===>General Port Exception, #{e}\"\n # end\n end", "def instance\n perform_request_with_object(:get, '/api/v1/instance', {},\n Mastodon::Instance)\n end", "def service\n return @service\n end", "def service(nickname, reserved, distribution, type)\n end", "def fetch_dataone(vin)\n config = Lynr.config('app').vin.dataone\n url = config.url\n data = {\n authorization_code: config.auth_code,\n client_id: config.client_id,\n decoder_query: dataone_xml_query(vin),\n }\n Lynr.metrics.time('time.service:dataone.fetch') do\n RestClient.post url, data\n end\n end", "def read(_request)\n raise NotImplementedError, 'Implement this method in your strategy'\n end", "def get_instance(payload)\n ServiceInstance.new(@version, payload)\n end", "def get_instance(payload)\n ServiceInstance.new(@version, payload)\n end", "def read_tier0_0_with_http_info(tier_0_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi.read_tier0_0 ...'\n end\n # verify the required parameter 'tier_0_id' is set\n if @api_client.config.client_side_validation && tier_0_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_0_id' when calling PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi.read_tier0_0\"\n end\n # resource path\n local_var_path = '/infra/tier-0s/{tier-0-id}'.sub('{' + 'tier-0-id' + '}', tier_0_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier0')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi#read_tier0_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def services\n end", "def set_idti_service\n @idti_service = IdtiService.find(params[:id])\n end", "def read_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_byod_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def service\n softlayer_client[:Software_Component].object_with_id(self.id)\n end", "def get( name, *args )\n point = find_definition( name )\n raise ServiceNotFound, \"#{fullname}.#{name}\" unless point\n\n point.instance( self, *args )\n end", "def show\n @service = Service.find(params[:id])\n end", "def read_tier0(tier_0_id, opts = {})\n data, _status_code, _headers = read_tier0_with_http_info(tier_0_id, opts)\n data\n end", "def services\n\n end", "def get_usage(args= {})\n args = {:day=>\"today\", :type=>\"heat\"}.merge(args)\n result = HTTParty.get( @tstat_ip + '/tstat/datalog', :headers => @headers) \n \n day = result[args[:day]]\n runtime = day[args[:type] + '_runtime']\n\n return runtime\n end", "def read(*args)\n #This is a stub, used for indexing\n end", "def service(id)\n request :get, \"/services/#{id}\"\n end", "def get_by_id(id)\n self.class.get(\"/aldebaran-instances/instances/#{id}\", :basic_auth => @auth)\n end", "def read(name=@name)\n begin\n a = self.class.new\n res = self.class.get(\"#{self.class.noah_base_path}/#{name}\").parsed_response\n res.each do |key, value|\n a.instance_variable_set(\"@#{key}\", value)\n end\n a\n rescue Errno::ECONNREFUSED\n \"Noah server is unreachable\"\n end\n end", "def driver\n Fc3Service\n end", "def read_tier1_byod_policy_service_instance_0(tier_1_id, locale_service_id, service_instance_id, opts = {})\n data, _status_code, _headers = read_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts)\n data\n end", "def services\n\tend", "def read\n raise NotImplementedError\n end", "def get_reading\n\t\turi = URI.parse('http://localhost:5000/thermometers.json')\n\t\tthermo_response = Net::HTTP.get_response(uri)\n\t\tcheck = thermo_response.body\n\t\tj = JSON.parse(check)\n\tend", "def service\n return softlayer_client[\"Virtual_Guest\"].object_with_id(self.id)\n end", "def read_tier1_byod_policy_service_instance(tier_1_id, locale_service_id, service_instance_id, opts = {})\n data, _status_code, _headers = read_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts)\n data\n end", "def connect\n service\n end", "def tei druid\n url = \"#{config.stacks}/file/druid:#{druid}/#{druid}.xml\"\n open(url)\n# File.open(\"/home/lyberadmin/frda/ap_tei/#{druid}.xml\")\n rescue Exception => e\n logger.error(\"error while retrieving tei at #{url} -- #{e.message}\")\n# logger.error(\"error while retrieving tei #{druid} -- #{e.message}\")\n \"<TEI.2/>\"\n end", "def service\n softlayer_client[:Network_Storage].object_with_id(self.id)\n end", "def vread(klass, id, version_id, format=@default_format)\n options = { resource: klass, id: id, format: format, history: {id: version_id} }\n reply = get resource_url(options), fhir_headers(options)\n reply.resource = parse_reply(klass, format, reply)\n reply.resource_class = klass\n reply\n end", "def read_tier1_locale_services_0_with_http_info(tier_1_id, locale_services_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#read_tier1_locale_services_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def listserv\n listservs.first\n end", "def read; end", "def read; end", "def read; end", "def read; end", "def read; end", "def read; end", "def read; end", "def index\n @service_particulars = ServiceParticular.all\n @service_particular = ServiceParticular.new\n end", "def vread(klass, id, version_id, format = nil)\n headers = { accept: \"#{format}\" } if format\n format ||= @default_format\n options = { resource: klass, id: id, format: format, history: { id: version_id } }\n reply = get resource_url(options), fhir_headers(headers)\n reply.resource = parse_reply(klass, format, reply)\n reply.resource_class = klass\n reply\n end", "def read_tier1_service_interface_0_with_http_info(tier_1_id, locale_service_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_service_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def service_name; end", "def read(id)\n # do not respond with anything\n end", "def service\n return softlayer_client[:Virtual_Guest].object_with_id(self.id)\n end", "def get\n appid = ENV['TRIMET_APP_ID']\n response = Unirest.get( \"http://developer.trimet.org/ws/v2/vehicles?appid=#{appid}\" )\n response.body\nend", "def read_io io\n handle_client io\n end", "def read_tier1_service_interface_with_http_info(tier_1_id, locale_service_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_service_interface\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def service\n self.original_service or Service.find_by_name(\"FieldStatus\")\n end", "def read_one(query)\n adapter.read_one(query)\n end", "def read_one(query)\n adapter.read_one(query)\n end", "def read_vms\n end", "def get_datastream( pid, dsID )\n pid.include?(\"druid\") ? pid = pid : pid = \"druid:#{pid}\"\n uri = URI.parse(@fedora + '/objects/' + pid + '/datastreams/' + dsID + '/content') \n RestClient.get(uri.to_s)\n rescue => e\n e.response \n end", "def meta\n data,stat = @zk.get(:path => ZK::Config::ServicePath + \"/#{@service_name}/#{@name}\")\n stat\n end", "def deserialize_service_instance(data)\n log.debug \"synapse: deserializing process data\"\n decoded = JSON.parse(data)\n\n host = decoded['host'] || (raise ValueError, 'instance json data does not have host key')\n port = decoded['port'] || (raise ValueError, 'instance json data does not have port key')\n name = decoded['name'] || nil\n weight = decoded['weight'] || nil\n\n return host, port, name, weight\n end", "def get(id)\n client.read(dstu2_model, id)\n end", "def show_service(client, args, options)\n response = client.get(\"#{RESOURCE_PATH}/#{args[0]}\")\n\n if CloudClient::is_error?(response)\n [response.code.to_i, response.to_s]\n else\n #[0,response.body]\n if options[:json]\n [0,response.body]\n else\n str=\"%-20s: %-20s\"\n str_h1=\"%-80s\"\n\n document_hash = JSON.parse(response.body)\n template = document_hash['DOCUMENT']['TEMPLATE']['BODY']\n\n CLIHelper.print_header(str_h1 % \"SERVICE #{document_hash['DOCUMENT']['ID']} INFORMATION\")\n\n puts str % [\"ID\", document_hash['DOCUMENT']['ID']]\n puts str % [\"NAME\", document_hash['DOCUMENT']['NAME']]\n puts str % [\"USER\", document_hash['DOCUMENT']['UNAME']]\n puts str % [\"GROUP\",document_hash['DOCUMENT']['GNAME']]\n\n puts str % [\"STRATEGY\", template['deployment']]\n puts str % [\"SERVICE STATE\", Service.state_str(template['state'])]\n puts str % [\"SHUTDOWN\", template['shutdown_action']] if template['shutdown_action']\n\n puts\n\n CLIHelper.print_header(str_h1 % \"PERMISSIONS\",false)\n\n [\"OWNER\", \"GROUP\", \"OTHER\"].each { |e|\n mask = \"---\"\n mask[0] = \"u\" if document_hash['DOCUMENT']['PERMISSIONS'][\"#{e}_U\"] == \"1\"\n mask[1] = \"m\" if document_hash['DOCUMENT']['PERMISSIONS'][\"#{e}_M\"] == \"1\"\n mask[2] = \"a\" if document_hash['DOCUMENT']['PERMISSIONS'][\"#{e}_A\"] == \"1\"\n\n puts str % [e, mask]\n }\n\n puts\n\n template['roles'].each {|role|\n CLIHelper.print_header(\"ROLE #{role['name']}\", false)\n\n puts str % [\"ROLE STATE\", Role.state_str(role['state'])]\n puts str % [\"PARENTS\", role['parents'].join(', ')] if role['parents']\n puts str % [\"VM TEMPLATE\", role['vm_template']]\n puts str % [\"CARDINALITY\", role['cardinality']]\n puts str % [\"MIN VMS\", role['min_vms']] if role['min_vms']\n puts str % [\"MAX VMS\", role['max_vms']] if role['max_vms']\n puts str % [\"COOLDOWN\", \"#{role['cooldown']}s\"] if role['cooldown']\n puts str % [\"SHUTDOWN\", role['shutdown_action']] if role['shutdown_action']\n\n puts \"NODES INFORMATION\"\n NODE_TABLE.show(role['nodes'])\n\n if !role['elasticity_policies'].nil? && role['elasticity_policies'].size > 0 || !role['scheduled_policies'].nil? && role['scheduled_policies'].size > 0\n puts\n puts \"ELASTICITY RULES\"\n\n if role['elasticity_policies'] && role['elasticity_policies'].size > 0\n puts\n# puts \"ELASTICITY POLICIES\"\n CLIHelper::ShowTable.new(nil, self) do\n column :ADJUST, \"\", :left, :size=>12 do |d|\n adjust_str(d)\n end\n\n column :EXPRESSION, \"\", :left, :size=>48 do |d|\n if !d['expression_evaluated'].nil?\n d['expression_evaluated']\n else\n d['expression']\n end\n end\n\n column :'EVALS', \"\", :right, :size=>5 do |d|\n if d['period_number']\n \"#{d['true_evals'].to_i}/#{d['period_number']}\"\n else\n \"-\"\n end\n end\n\n column :PERIOD, \"\", :size=>6 do |d|\n d['period'] ? \"#{d['period']}s\" : '-'\n end\n\n column :COOL, \"\", :size=>5 do |d|\n d['cooldown'] ? \"#{d['cooldown']}s\" : '-'\n end\n\n default :ADJUST, :EXPRESSION, :EVALS, :PERIOD, :COOL\n end.show([role['elasticity_policies']].flatten, {})\n end\n\n if role['scheduled_policies'] && role['scheduled_policies'].size > 0\n puts\n# puts \"SCHEDULED POLICIES\"\n CLIHelper::ShowTable.new(nil, self) do\n column :ADJUST, \"\", :left, :size=>12 do |d|\n adjust_str(d)\n end\n\n column :TIME, \"\", :left, :size=>67 do |d|\n if d['start_time']\n Time.parse(d['start_time']).to_s\n else\n d['recurrence']\n end\n end\n\n default :ADJUST, :TIME\n end.show([role['scheduled_policies']].flatten, {})\n end\n end\n\n puts\n }\n\n puts\n\n CLIHelper.print_header(str_h1 % \"LOG MESSAGES\",false)\n\n if template['log']\n template['log'].each { |log|\n t = Time.at(log['timestamp']).strftime(\"%m/%d/%y %H:%M\")\n puts \"#{t} [#{log['severity']}] #{log['message']}\"\n }\n end\n\n 0\n end\n end\nend", "def show\n @service = Service.find(params[:id])\n end", "def start_service\n object = DBusObject.new(@main, self)\n service = @bus.request_service(SERVICE)\n service.export object\n end", "def read_tier0_0(tier_0_id, opts = {})\n data, _status_code, _headers = read_tier0_0_with_http_info(tier_0_id, opts)\n data\n end", "def client_3\n reading = READING\n base_charge(reading)\n end", "def get_instance(payload)\n NewFactorInstance.new(\n @version,\n payload,\n service_sid: @solution[:service_sid],\n identity: @solution[:identity],\n )\n end", "def read_ntp_service_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: NsxComponentAdministrationApi.read_ntp_service ...\"\n end\n # resource path\n local_var_path = \"/node/services/ntp\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'NodeNtpServiceProperties')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: NsxComponentAdministrationApi#read_ntp_service\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def cycle\n TflApi::Client::Cycle.new(self)\n end", "def read_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_instance(name)\n name = name[0, 2].upcase\n cls = case name\n when 'ET'\n 'Rbeapi::Api::EthernetInterface'\n when 'PO'\n 'Rbeapi::Api::PortchannelInterface'\n when 'VX'\n 'Rbeapi::Api::VxlanInterface'\n when 'VL'\n 'Rbeapi::Api::VlanInterface'\n else\n 'Rbeapi::Api::BaseInterface'\n end\n\n return @instances[name] if @instances.include?(cls)\n instance = Rbeapi::Utils.class_from_string(cls).new(@node)\n @instances[name] = instance\n instance\n end", "def read_policy_dns_forwarder_on_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/dns-forwarder'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyDnsForwarder')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi#read_policy_dns_forwarder_on_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end" ]
[ "0.5574296", "0.5488678", "0.54819524", "0.54297084", "0.5396788", "0.53639716", "0.535077", "0.530471", "0.52592874", "0.52423716", "0.5169323", "0.5124693", "0.50960845", "0.5072182", "0.5030228", "0.5030228", "0.5030228", "0.5030228", "0.502663", "0.5024412", "0.49934784", "0.49516293", "0.49432898", "0.49331135", "0.49318206", "0.4925339", "0.49132454", "0.49067616", "0.490437", "0.4898804", "0.48842806", "0.48696542", "0.48691413", "0.48669907", "0.48628306", "0.48590076", "0.48548448", "0.48548448", "0.48431903", "0.48420075", "0.48406562", "0.48394275", "0.483588", "0.4832456", "0.48308584", "0.48302987", "0.48301002", "0.48296708", "0.48291892", "0.4824112", "0.48208097", "0.48194975", "0.48143893", "0.48136574", "0.4812813", "0.48082045", "0.4792199", "0.4788416", "0.47879317", "0.47708762", "0.47691223", "0.47655746", "0.47475022", "0.47422647", "0.47413787", "0.4740554", "0.4740554", "0.4740554", "0.4740554", "0.4740554", "0.4740554", "0.4740554", "0.47400954", "0.47346988", "0.47276604", "0.4720405", "0.47094646", "0.47054067", "0.4701749", "0.46986067", "0.46962234", "0.4684204", "0.46827483", "0.46827483", "0.46744716", "0.46721032", "0.46705088", "0.46672758", "0.46667784", "0.4666119", "0.46601313", "0.46543157", "0.46500933", "0.46470016", "0.46452016", "0.4644763", "0.46438378", "0.46411282", "0.46389169", "0.46376476" ]
0.48848996
30
Read Tier1 service instance Read Tier1 service instance
def read_tier1_policy_service_instance(tier_1_id, locale_service_id, service_instance_id, opts = {}) data, _status_code, _headers = read_tier1_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_tier1(tier_1_id, opts = {})\n data, _status_code, _headers = read_tier1_with_http_info(tier_1_id, opts)\n data\n end", "def read_tier1_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#read_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#read_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_0(tier_1_id, opts = {})\n data, _status_code, _headers = read_tier1_0_with_http_info(tier_1_id, opts)\n data\n end", "def service; services.first; end", "def service\n @service\n end", "def service; end", "def read_instance\n raise NotImplementedError, 'read_instance needs to be implemented by child providers'\n end", "def service\n @service ||= bus.service('com.dubstepdish.i3dstatus')\n end", "def read_service_payments\r\n read_service_payment while peek == 'SVC'\r\n self\r\n end", "def service\n return @service\n end", "def bi_service\n end", "def tier\n @tier_cache || self.tiers[0]\n end", "def load_tier\n if id = params[:tier_id]\n @tier = Tier.find_by_permalink_and_region_and_active(id)\n end\n end", "def read_tier1_locale_services_0_with_http_info(tier_1_id, locale_services_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#read_tier1_locale_services_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def listserv\n listservs.first\n end", "def service\n return softlayer_client[:Ticket].object_with_id(self.id)\n end", "def service\n StockManagementService.new\n end", "def service\n @service ||= fetcher.get(Service, service_id)\n end", "def read_tier1_locale_services_with_http_info(tier_1_id, locale_services_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#read_tier1_locale_services\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def load_tier\n if id = tier_param_id\n @tier = Tier.find_by_permalink_and_region_and_active(id)\n @tier_class = @tier.class if @tier\n end\n end", "def load_tier\n if id = tier_param_id\n @tier = Tier.find_by_permalink_and_region_and_active(id)\n @tier_class = @tier.class if @tier\n end\n end", "def read_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read\n iface = Qt::DBusInterface.new(SERVICE_NAME, READ_PATH, \"\", Qt::DBusConnection.sessionBus)\n raise \"D-BUS Interface Error : #{Qt::DBusConnection.sessionBus.lastError.message}\" unless iface.valid?\n msg = iface.call(Qt::DBus::BlockWithGui, \"read\", url)\n reply = Qt::DBusReply.new(msg)\n raise \"D-BUS Reply Error : #{reply.error.message}\" unless reply.valid?\n reply.value\n end", "def services\n end", "def read_tier1_service_interface_with_http_info(tier_1_id, locale_service_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_service_interface\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_service_interface_0_with_http_info(tier_1_id, locale_service_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_service_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def service(id)\n request :get, \"/services/#{id}\"\n end", "def srv\n @service_finder\n end", "def services\n\n end", "def service\n return softlayer_client[\"Virtual_Guest\"].object_with_id(self.id)\n end", "def read_tier0_with_http_info(tier_0_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi.read_tier0 ...'\n end\n # verify the required parameter 'tier_0_id' is set\n if @api_client.config.client_side_validation && tier_0_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_0_id' when calling PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi.read_tier0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-0s/{tier-0-id}'.sub('{' + 'tier-0-id' + '}', tier_0_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier0')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi#read_tier0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def retrieve(service:, resource:, qos: {} )\n port = AnyPort::Port.new.port_for_message_exchange_pattern(qos)\n # result = Try {\n result = with_circuit do |circuit|\n circuit.service_name = resource\n end.call { get(port, service, resource, ENVIRONMENT) }\n # }\n\n # result.get_or_else {raise self.class::RequestFailure}\n # begin\n # result = with_circuit do |circuit|\n # circuit.service_name = resource\n # end.call {MockClient.new.call(service, resource, :development)}\n # rescue AnyPort::CircuitBreaker::CircuitOpen => e\n # puts \"===>CircuitBreaker Open Exception\"\n # rescue AnyPort::PortException => e\n # puts \"===>General Port Exception, #{e}\"\n # end\n end", "def services\n\tend", "def get( name, *args )\n point = find_definition( name )\n raise ServiceNotFound, \"#{fullname}.#{name}\" unless point\n\n point.instance( self, *args )\n end", "def read_tier1_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_instance(payload)\n ServiceInstance.new(@version, payload)\n end", "def get_instance(payload)\n ServiceInstance.new(@version, payload)\n end", "def read_policy_dns_forwarder_on_tier1_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/dns-forwarder'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyDnsForwarder')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi#read_policy_dns_forwarder_on_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def set_idti_service\n @idti_service = IdtiService.find(params[:id])\n end", "def connect\n service\n end", "def sensors\r\n SensorsController.instance\r\n end", "def service_name; end", "def read_policy_dns_forwarder_on_tier1_0(tier_1_id, opts = {})\n data, _status_code, _headers = read_policy_dns_forwarder_on_tier1_0_with_http_info(tier_1_id, opts)\n data\n end", "def read_tier1_interface_with_http_info(tier_1_id, locale_services_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}/interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1Interface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_interface\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_policy_dns_forwarder_on_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/dns-forwarder'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyDnsForwarder')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi#read_policy_dns_forwarder_on_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_policy_dns_forwarder_on_tier1(tier_1_id, opts = {})\n data, _status_code, _headers = read_policy_dns_forwarder_on_tier1_with_http_info(tier_1_id, opts)\n data\n end", "def show\n @service = Service.find(params[:id])\n end", "def tires_read(tire, opts = {})\n data, _status_code, _headers = tires_read_with_http_info(tire, opts)\n data\n end", "def service\n return softlayer_client[:Virtual_Guest].object_with_id(self.id)\n end", "def service\n context[:target]\n end", "def get_by_id(id)\n self.class.get(\"/aldebaran-instances/instances/#{id}\", :basic_auth => @auth)\n end", "def read(_request)\n raise NotImplementedError, 'Implement this method in your strategy'\n end", "def read_tier1_interface_0_with_http_info(tier_1_id, locale_services_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}/interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1Interface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_resource(id, type)\n\t\[email protected](type).call.get(id)\n\tend", "def read_tier1_service_interface_0(tier_1_id, locale_service_id, interface_id, opts = {})\n data, _status_code, _headers = read_tier1_service_interface_0_with_http_info(tier_1_id, locale_service_id, interface_id, opts)\n data\n end", "def read_tier0(tier_0_id, opts = {})\n data, _status_code, _headers = read_tier0_with_http_info(tier_0_id, opts)\n data\n end", "def get()\n \n end", "def instance\n perform_request_with_object(:get, '/api/v1/instance', {}, Mastodon::Instance)\n end", "def servicio # :doc\n id = params[:service_id]\n if id.present?\n \t\tService.find(params[:service_id]) \n \tend \n end", "def get_transfer_by_path(path)\n obj = @service.object(path)\n .tap(&:introspect)\n Transfer.new(obj.Get(Transfer::INTERFACE, 'Id').first, self)\n end", "def set_tier_setting\n @tier_setting = TierSetting.find(params[:id])\n end", "def resource_class_factory\n ActiveTriples::Resource\n end", "def read_tier0_0_with_http_info(tier_0_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi.read_tier0_0 ...'\n end\n # verify the required parameter 'tier_0_id' is set\n if @api_client.config.client_side_validation && tier_0_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_0_id' when calling PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi.read_tier0_0\"\n end\n # resource path\n local_var_path = '/infra/tier-0s/{tier-0-id}'.sub('{' + 'tier-0-id' + '}', tier_0_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier0')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi#read_tier0_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_byod_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def quick_start_method\n main_service.quick_start_method&.rest\n end", "def tier\n raw_tier || Tier.default\n end", "def read_tier1_byod_policy_service_instance_0(tier_1_id, locale_service_id, service_instance_id, opts = {})\n data, _status_code, _headers = read_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts)\n data\n end", "def set_service_particular\n @service_particular = ServiceParticular.find(params[:id])\n end", "def read_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_byod_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def _service_type\n self.class.service_type\n end", "def instance\n perform_request_with_object(:get, '/api/v1/instance', {},\n Mastodon::Instance)\n end", "def get_instance(payload)\n NewFactorInstance.new(\n @version,\n payload,\n service_sid: @solution[:service_sid],\n identity: @solution[:identity],\n )\n end", "def get\n appid = ENV['TRIMET_APP_ID']\n response = Unirest.get( \"http://developer.trimet.org/ws/v2/vehicles?appid=#{appid}\" )\n response.body\nend", "def read_tier1_service_interface(tier_1_id, locale_service_id, interface_id, opts = {})\n data, _status_code, _headers = read_tier1_service_interface_with_http_info(tier_1_id, locale_service_id, interface_id, opts)\n data\n end", "def tradevalue_svc\n tradevalue = @svc.find_value_by_name(\"tradevalue\")\n tradevalue_svc = TradeValueService.new(tradevalue)\n return tradevalue_svc, get_version(tradevalue)\n end", "def read_one\n synchronize {\n read_many.slice!(0)\n }\n end", "def service\n softlayer_client[:Software_Component].object_with_id(self.id)\n end", "def service\n self.original_service or Service.find_by_name(\"FieldStatus\")\n end", "def read\n end", "def get_instance instance_id\n instances.get_instance name: instance_path(instance_id)\n end", "def show\n @service = Service.find(params[:id])\n end", "def index\n @service_particulars = ServiceParticular.all\n @service_particular = ServiceParticular.new\n end", "def read_tier1_byod_policy_service_instance(tier_1_id, locale_service_id, service_instance_id, opts = {})\n data, _status_code, _headers = read_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts)\n data\n end", "def get_reading\n\t\turi = URI.parse('http://localhost:5000/thermometers.json')\n\t\tthermo_response = Net::HTTP.get_response(uri)\n\t\tcheck = thermo_response.body\n\t\tj = JSON.parse(check)\n\tend", "def index\n @therm_resources = ThermResource.all\n end", "def show\n @tier = Tier.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @tier }\n end\n end", "def read_tier1_interface(tier_1_id, locale_services_id, interface_id, opts = {})\n data, _status_code, _headers = read_tier1_interface_with_http_info(tier_1_id, locale_services_id, interface_id, opts)\n data\n end", "def industrial\r\n IndustrialController.instance\r\n end", "def retrieve!\n raise Error::NotImplementedError, \"There is no current end point to get sensor data by id\"\n end", "def find_service(id)\n self.class.get(\"/services/#{id}.json?apikey=#{apikey}\")\n end", "def tei druid\n url = \"#{config.stacks}/file/druid:#{druid}/#{druid}.xml\"\n open(url)\n# File.open(\"/home/lyberadmin/frda/ap_tei/#{druid}.xml\")\n rescue Exception => e\n logger.error(\"error while retrieving tei at #{url} -- #{e.message}\")\n# logger.error(\"error while retrieving tei #{druid} -- #{e.message}\")\n \"<TEI.2/>\"\n end", "def driver\n Fc3Service\n end", "def _read type, name\n result = @elasticsupport.client.search index: _index_for(type), type: type.to_s, q: \"name:#{name}\"\n result[\"hits\"][\"hits\"][0] rescue nil\n end", "def context\n unless @instance_context\n @instance_context = ServiceContext.new(@version , @params['sid'])\n end\n @instance_context\n end", "def context\n unless @instance_context\n @instance_context = ServiceContext.new(@version , @params['sid'])\n end\n @instance_context\n end", "def service_type_name\n \"REST\"\n end", "def set_service\n @service = Service.where(\"id = ?\", params[:id]).first\n end", "def getHttpService()\r\n @currentlyDisplayedItem.getHttpService\r\n end", "def first_service_with_rest\n services.find(&:methods_rest_bindings?)\n end", "def read(id)\n perform(:get, \"#{@resource_type}/#{id}\")\n end" ]
[ "0.59622973", "0.5933636", "0.58663744", "0.5777507", "0.568712", "0.5613026", "0.5460806", "0.5455378", "0.53422296", "0.5321433", "0.52945006", "0.52197695", "0.5170293", "0.51636386", "0.51562506", "0.5117856", "0.5110099", "0.51057935", "0.5105114", "0.510106", "0.50352794", "0.50352794", "0.50291663", "0.5019281", "0.5004525", "0.5003932", "0.49978146", "0.49918073", "0.49874315", "0.49635303", "0.49584138", "0.49560732", "0.4947357", "0.49444965", "0.49429572", "0.4937659", "0.4937153", "0.4937153", "0.49280673", "0.4926707", "0.49266273", "0.4921862", "0.49208182", "0.49107745", "0.49101204", "0.49086404", "0.49051726", "0.48992947", "0.48969933", "0.48944315", "0.48912808", "0.48893288", "0.4883932", "0.4882866", "0.4879613", "0.48786902", "0.486183", "0.48594812", "0.4843902", "0.4841907", "0.48355386", "0.48216343", "0.48202193", "0.48196727", "0.48144892", "0.4800882", "0.47972912", "0.47963408", "0.4793876", "0.47906446", "0.47903126", "0.4787018", "0.47739822", "0.47704408", "0.47678047", "0.47613123", "0.47599015", "0.47591197", "0.47503525", "0.47483695", "0.47395945", "0.47353598", "0.4733782", "0.47308233", "0.47301036", "0.47269723", "0.47255227", "0.47235352", "0.4718245", "0.47117996", "0.470575", "0.47046405", "0.46954936", "0.46929422", "0.46907133", "0.46907133", "0.46890643", "0.46877754", "0.4686056", "0.46857613", "0.46850544" ]
0.0
-1
Read Tier1 service instance Read Tier1 service instance
def read_tier1_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance ...' end # verify the required parameter 'tier_1_id' is set if @api_client.config.client_side_validation && tier_1_id.nil? fail ArgumentError, "Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance" end # verify the required parameter 'locale_service_id' is set if @api_client.config.client_side_validation && locale_service_id.nil? fail ArgumentError, "Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance" end # verify the required parameter 'service_instance_id' is set if @api_client.config.client_side_validation && service_instance_id.nil? fail ArgumentError, "Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance" end # resource path local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'PolicyServiceInstance') if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_tier1(tier_1_id, opts = {})\n data, _status_code, _headers = read_tier1_with_http_info(tier_1_id, opts)\n data\n end", "def read_tier1_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#read_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#read_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_0(tier_1_id, opts = {})\n data, _status_code, _headers = read_tier1_0_with_http_info(tier_1_id, opts)\n data\n end", "def service; services.first; end", "def service\n @service\n end", "def service; end", "def read_instance\n raise NotImplementedError, 'read_instance needs to be implemented by child providers'\n end", "def service\n @service ||= bus.service('com.dubstepdish.i3dstatus')\n end", "def read_service_payments\r\n read_service_payment while peek == 'SVC'\r\n self\r\n end", "def service\n return @service\n end", "def bi_service\n end", "def tier\n @tier_cache || self.tiers[0]\n end", "def load_tier\n if id = params[:tier_id]\n @tier = Tier.find_by_permalink_and_region_and_active(id)\n end\n end", "def read_tier1_locale_services_0_with_http_info(tier_1_id, locale_services_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#read_tier1_locale_services_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def listserv\n listservs.first\n end", "def service\n return softlayer_client[:Ticket].object_with_id(self.id)\n end", "def service\n StockManagementService.new\n end", "def service\n @service ||= fetcher.get(Service, service_id)\n end", "def read_tier1_locale_services_with_http_info(tier_1_id, locale_services_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#read_tier1_locale_services\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def load_tier\n if id = tier_param_id\n @tier = Tier.find_by_permalink_and_region_and_active(id)\n @tier_class = @tier.class if @tier\n end\n end", "def load_tier\n if id = tier_param_id\n @tier = Tier.find_by_permalink_and_region_and_active(id)\n @tier_class = @tier.class if @tier\n end\n end", "def read_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read\n iface = Qt::DBusInterface.new(SERVICE_NAME, READ_PATH, \"\", Qt::DBusConnection.sessionBus)\n raise \"D-BUS Interface Error : #{Qt::DBusConnection.sessionBus.lastError.message}\" unless iface.valid?\n msg = iface.call(Qt::DBus::BlockWithGui, \"read\", url)\n reply = Qt::DBusReply.new(msg)\n raise \"D-BUS Reply Error : #{reply.error.message}\" unless reply.valid?\n reply.value\n end", "def services\n end", "def read_tier1_service_interface_with_http_info(tier_1_id, locale_service_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_service_interface\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_service_interface_0_with_http_info(tier_1_id, locale_service_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_service_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def service(id)\n request :get, \"/services/#{id}\"\n end", "def srv\n @service_finder\n end", "def services\n\n end", "def service\n return softlayer_client[\"Virtual_Guest\"].object_with_id(self.id)\n end", "def read_tier0_with_http_info(tier_0_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi.read_tier0 ...'\n end\n # verify the required parameter 'tier_0_id' is set\n if @api_client.config.client_side_validation && tier_0_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_0_id' when calling PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi.read_tier0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-0s/{tier-0-id}'.sub('{' + 'tier-0-id' + '}', tier_0_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier0')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi#read_tier0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def retrieve(service:, resource:, qos: {} )\n port = AnyPort::Port.new.port_for_message_exchange_pattern(qos)\n # result = Try {\n result = with_circuit do |circuit|\n circuit.service_name = resource\n end.call { get(port, service, resource, ENVIRONMENT) }\n # }\n\n # result.get_or_else {raise self.class::RequestFailure}\n # begin\n # result = with_circuit do |circuit|\n # circuit.service_name = resource\n # end.call {MockClient.new.call(service, resource, :development)}\n # rescue AnyPort::CircuitBreaker::CircuitOpen => e\n # puts \"===>CircuitBreaker Open Exception\"\n # rescue AnyPort::PortException => e\n # puts \"===>General Port Exception, #{e}\"\n # end\n end", "def services\n\tend", "def get( name, *args )\n point = find_definition( name )\n raise ServiceNotFound, \"#{fullname}.#{name}\" unless point\n\n point.instance( self, *args )\n end", "def get_instance(payload)\n ServiceInstance.new(@version, payload)\n end", "def get_instance(payload)\n ServiceInstance.new(@version, payload)\n end", "def read_policy_dns_forwarder_on_tier1_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/dns-forwarder'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyDnsForwarder')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi#read_policy_dns_forwarder_on_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def set_idti_service\n @idti_service = IdtiService.find(params[:id])\n end", "def connect\n service\n end", "def sensors\r\n SensorsController.instance\r\n end", "def service_name; end", "def read_policy_dns_forwarder_on_tier1_0(tier_1_id, opts = {})\n data, _status_code, _headers = read_policy_dns_forwarder_on_tier1_0_with_http_info(tier_1_id, opts)\n data\n end", "def read_tier1_interface_with_http_info(tier_1_id, locale_services_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}/interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1Interface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_interface\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_policy_dns_forwarder_on_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/dns-forwarder'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyDnsForwarder')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi#read_policy_dns_forwarder_on_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_policy_dns_forwarder_on_tier1(tier_1_id, opts = {})\n data, _status_code, _headers = read_policy_dns_forwarder_on_tier1_with_http_info(tier_1_id, opts)\n data\n end", "def show\n @service = Service.find(params[:id])\n end", "def tires_read(tire, opts = {})\n data, _status_code, _headers = tires_read_with_http_info(tire, opts)\n data\n end", "def service\n return softlayer_client[:Virtual_Guest].object_with_id(self.id)\n end", "def service\n context[:target]\n end", "def get_by_id(id)\n self.class.get(\"/aldebaran-instances/instances/#{id}\", :basic_auth => @auth)\n end", "def read(_request)\n raise NotImplementedError, 'Implement this method in your strategy'\n end", "def read_tier1_interface_0_with_http_info(tier_1_id, locale_services_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}/interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1Interface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_resource(id, type)\n\t\[email protected](type).call.get(id)\n\tend", "def read_tier1_service_interface_0(tier_1_id, locale_service_id, interface_id, opts = {})\n data, _status_code, _headers = read_tier1_service_interface_0_with_http_info(tier_1_id, locale_service_id, interface_id, opts)\n data\n end", "def read_tier0(tier_0_id, opts = {})\n data, _status_code, _headers = read_tier0_with_http_info(tier_0_id, opts)\n data\n end", "def get()\n \n end", "def instance\n perform_request_with_object(:get, '/api/v1/instance', {}, Mastodon::Instance)\n end", "def servicio # :doc\n id = params[:service_id]\n if id.present?\n \t\tService.find(params[:service_id]) \n \tend \n end", "def get_transfer_by_path(path)\n obj = @service.object(path)\n .tap(&:introspect)\n Transfer.new(obj.Get(Transfer::INTERFACE, 'Id').first, self)\n end", "def set_tier_setting\n @tier_setting = TierSetting.find(params[:id])\n end", "def resource_class_factory\n ActiveTriples::Resource\n end", "def read_tier0_0_with_http_info(tier_0_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi.read_tier0_0 ...'\n end\n # verify the required parameter 'tier_0_id' is set\n if @api_client.config.client_side_validation && tier_0_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_0_id' when calling PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi.read_tier0_0\"\n end\n # resource path\n local_var_path = '/infra/tier-0s/{tier-0-id}'.sub('{' + 'tier-0-id' + '}', tier_0_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier0')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi#read_tier0_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_byod_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def quick_start_method\n main_service.quick_start_method&.rest\n end", "def tier\n raw_tier || Tier.default\n end", "def read_tier1_byod_policy_service_instance_0(tier_1_id, locale_service_id, service_instance_id, opts = {})\n data, _status_code, _headers = read_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts)\n data\n end", "def set_service_particular\n @service_particular = ServiceParticular.find(params[:id])\n end", "def read_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_byod_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def _service_type\n self.class.service_type\n end", "def instance\n perform_request_with_object(:get, '/api/v1/instance', {},\n Mastodon::Instance)\n end", "def get_instance(payload)\n NewFactorInstance.new(\n @version,\n payload,\n service_sid: @solution[:service_sid],\n identity: @solution[:identity],\n )\n end", "def get\n appid = ENV['TRIMET_APP_ID']\n response = Unirest.get( \"http://developer.trimet.org/ws/v2/vehicles?appid=#{appid}\" )\n response.body\nend", "def read_tier1_service_interface(tier_1_id, locale_service_id, interface_id, opts = {})\n data, _status_code, _headers = read_tier1_service_interface_with_http_info(tier_1_id, locale_service_id, interface_id, opts)\n data\n end", "def tradevalue_svc\n tradevalue = @svc.find_value_by_name(\"tradevalue\")\n tradevalue_svc = TradeValueService.new(tradevalue)\n return tradevalue_svc, get_version(tradevalue)\n end", "def read_one\n synchronize {\n read_many.slice!(0)\n }\n end", "def service\n softlayer_client[:Software_Component].object_with_id(self.id)\n end", "def service\n self.original_service or Service.find_by_name(\"FieldStatus\")\n end", "def read\n end", "def get_instance instance_id\n instances.get_instance name: instance_path(instance_id)\n end", "def show\n @service = Service.find(params[:id])\n end", "def index\n @service_particulars = ServiceParticular.all\n @service_particular = ServiceParticular.new\n end", "def read_tier1_byod_policy_service_instance(tier_1_id, locale_service_id, service_instance_id, opts = {})\n data, _status_code, _headers = read_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts)\n data\n end", "def get_reading\n\t\turi = URI.parse('http://localhost:5000/thermometers.json')\n\t\tthermo_response = Net::HTTP.get_response(uri)\n\t\tcheck = thermo_response.body\n\t\tj = JSON.parse(check)\n\tend", "def index\n @therm_resources = ThermResource.all\n end", "def show\n @tier = Tier.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @tier }\n end\n end", "def read_tier1_interface(tier_1_id, locale_services_id, interface_id, opts = {})\n data, _status_code, _headers = read_tier1_interface_with_http_info(tier_1_id, locale_services_id, interface_id, opts)\n data\n end", "def industrial\r\n IndustrialController.instance\r\n end", "def retrieve!\n raise Error::NotImplementedError, \"There is no current end point to get sensor data by id\"\n end", "def find_service(id)\n self.class.get(\"/services/#{id}.json?apikey=#{apikey}\")\n end", "def tei druid\n url = \"#{config.stacks}/file/druid:#{druid}/#{druid}.xml\"\n open(url)\n# File.open(\"/home/lyberadmin/frda/ap_tei/#{druid}.xml\")\n rescue Exception => e\n logger.error(\"error while retrieving tei at #{url} -- #{e.message}\")\n# logger.error(\"error while retrieving tei #{druid} -- #{e.message}\")\n \"<TEI.2/>\"\n end", "def driver\n Fc3Service\n end", "def _read type, name\n result = @elasticsupport.client.search index: _index_for(type), type: type.to_s, q: \"name:#{name}\"\n result[\"hits\"][\"hits\"][0] rescue nil\n end", "def context\n unless @instance_context\n @instance_context = ServiceContext.new(@version , @params['sid'])\n end\n @instance_context\n end", "def context\n unless @instance_context\n @instance_context = ServiceContext.new(@version , @params['sid'])\n end\n @instance_context\n end", "def service_type_name\n \"REST\"\n end", "def set_service\n @service = Service.where(\"id = ?\", params[:id]).first\n end", "def getHttpService()\r\n @currentlyDisplayedItem.getHttpService\r\n end", "def first_service_with_rest\n services.find(&:methods_rest_bindings?)\n end", "def read(id)\n perform(:get, \"#{@resource_type}/#{id}\")\n end" ]
[ "0.59622973", "0.5933636", "0.58663744", "0.5777507", "0.568712", "0.5613026", "0.5460806", "0.5455378", "0.53422296", "0.5321433", "0.52945006", "0.52197695", "0.5170293", "0.51636386", "0.51562506", "0.5117856", "0.5110099", "0.51057935", "0.5105114", "0.510106", "0.50352794", "0.50352794", "0.50291663", "0.5019281", "0.5004525", "0.5003932", "0.49978146", "0.49918073", "0.49874315", "0.49635303", "0.49584138", "0.49560732", "0.4947357", "0.49444965", "0.49429572", "0.4937153", "0.4937153", "0.49280673", "0.4926707", "0.49266273", "0.4921862", "0.49208182", "0.49107745", "0.49101204", "0.49086404", "0.49051726", "0.48992947", "0.48969933", "0.48944315", "0.48912808", "0.48893288", "0.4883932", "0.4882866", "0.4879613", "0.48786902", "0.486183", "0.48594812", "0.4843902", "0.4841907", "0.48355386", "0.48216343", "0.48202193", "0.48196727", "0.48144892", "0.4800882", "0.47972912", "0.47963408", "0.4793876", "0.47906446", "0.47903126", "0.4787018", "0.47739822", "0.47704408", "0.47678047", "0.47613123", "0.47599015", "0.47591197", "0.47503525", "0.47483695", "0.47395945", "0.47353598", "0.4733782", "0.47308233", "0.47301036", "0.47269723", "0.47255227", "0.47235352", "0.4718245", "0.47117996", "0.470575", "0.47046405", "0.46954936", "0.46929422", "0.46907133", "0.46907133", "0.46890643", "0.46877754", "0.4686056", "0.46857613", "0.46850544" ]
0.4937659
35
Read Tier1 service instance Read Tier1 service instance
def read_tier1_policy_service_instance_0(tier_1_id, locale_service_id, service_instance_id, opts = {}) data, _status_code, _headers = read_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_tier1(tier_1_id, opts = {})\n data, _status_code, _headers = read_tier1_with_http_info(tier_1_id, opts)\n data\n end", "def read_tier1_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#read_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#read_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_0(tier_1_id, opts = {})\n data, _status_code, _headers = read_tier1_0_with_http_info(tier_1_id, opts)\n data\n end", "def service; services.first; end", "def service\n @service\n end", "def service; end", "def read_instance\n raise NotImplementedError, 'read_instance needs to be implemented by child providers'\n end", "def service\n @service ||= bus.service('com.dubstepdish.i3dstatus')\n end", "def read_service_payments\r\n read_service_payment while peek == 'SVC'\r\n self\r\n end", "def service\n return @service\n end", "def bi_service\n end", "def tier\n @tier_cache || self.tiers[0]\n end", "def load_tier\n if id = params[:tier_id]\n @tier = Tier.find_by_permalink_and_region_and_active(id)\n end\n end", "def read_tier1_locale_services_0_with_http_info(tier_1_id, locale_services_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#read_tier1_locale_services_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def listserv\n listservs.first\n end", "def service\n return softlayer_client[:Ticket].object_with_id(self.id)\n end", "def service\n StockManagementService.new\n end", "def service\n @service ||= fetcher.get(Service, service_id)\n end", "def read_tier1_locale_services_with_http_info(tier_1_id, locale_services_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#read_tier1_locale_services\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def load_tier\n if id = tier_param_id\n @tier = Tier.find_by_permalink_and_region_and_active(id)\n @tier_class = @tier.class if @tier\n end\n end", "def load_tier\n if id = tier_param_id\n @tier = Tier.find_by_permalink_and_region_and_active(id)\n @tier_class = @tier.class if @tier\n end\n end", "def read_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read\n iface = Qt::DBusInterface.new(SERVICE_NAME, READ_PATH, \"\", Qt::DBusConnection.sessionBus)\n raise \"D-BUS Interface Error : #{Qt::DBusConnection.sessionBus.lastError.message}\" unless iface.valid?\n msg = iface.call(Qt::DBus::BlockWithGui, \"read\", url)\n reply = Qt::DBusReply.new(msg)\n raise \"D-BUS Reply Error : #{reply.error.message}\" unless reply.valid?\n reply.value\n end", "def read_tier1_service_interface_with_http_info(tier_1_id, locale_service_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_service_interface\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def services\n end", "def read_tier1_service_interface_0_with_http_info(tier_1_id, locale_service_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_service_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def service(id)\n request :get, \"/services/#{id}\"\n end", "def srv\n @service_finder\n end", "def services\n\n end", "def service\n return softlayer_client[\"Virtual_Guest\"].object_with_id(self.id)\n end", "def read_tier0_with_http_info(tier_0_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi.read_tier0 ...'\n end\n # verify the required parameter 'tier_0_id' is set\n if @api_client.config.client_side_validation && tier_0_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_0_id' when calling PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi.read_tier0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-0s/{tier-0-id}'.sub('{' + 'tier-0-id' + '}', tier_0_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier0')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi#read_tier0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def retrieve(service:, resource:, qos: {} )\n port = AnyPort::Port.new.port_for_message_exchange_pattern(qos)\n # result = Try {\n result = with_circuit do |circuit|\n circuit.service_name = resource\n end.call { get(port, service, resource, ENVIRONMENT) }\n # }\n\n # result.get_or_else {raise self.class::RequestFailure}\n # begin\n # result = with_circuit do |circuit|\n # circuit.service_name = resource\n # end.call {MockClient.new.call(service, resource, :development)}\n # rescue AnyPort::CircuitBreaker::CircuitOpen => e\n # puts \"===>CircuitBreaker Open Exception\"\n # rescue AnyPort::PortException => e\n # puts \"===>General Port Exception, #{e}\"\n # end\n end", "def services\n\tend", "def get( name, *args )\n point = find_definition( name )\n raise ServiceNotFound, \"#{fullname}.#{name}\" unless point\n\n point.instance( self, *args )\n end", "def read_tier1_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_instance(payload)\n ServiceInstance.new(@version, payload)\n end", "def get_instance(payload)\n ServiceInstance.new(@version, payload)\n end", "def read_policy_dns_forwarder_on_tier1_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/dns-forwarder'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyDnsForwarder')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi#read_policy_dns_forwarder_on_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def connect\n service\n end", "def set_idti_service\n @idti_service = IdtiService.find(params[:id])\n end", "def service_name; end", "def sensors\r\n SensorsController.instance\r\n end", "def read_tier1_interface_with_http_info(tier_1_id, locale_services_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}/interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1Interface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_interface\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_policy_dns_forwarder_on_tier1_0(tier_1_id, opts = {})\n data, _status_code, _headers = read_policy_dns_forwarder_on_tier1_0_with_http_info(tier_1_id, opts)\n data\n end", "def read_policy_dns_forwarder_on_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/dns-forwarder'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyDnsForwarder')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi#read_policy_dns_forwarder_on_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_policy_dns_forwarder_on_tier1(tier_1_id, opts = {})\n data, _status_code, _headers = read_policy_dns_forwarder_on_tier1_with_http_info(tier_1_id, opts)\n data\n end", "def show\n @service = Service.find(params[:id])\n end", "def tires_read(tire, opts = {})\n data, _status_code, _headers = tires_read_with_http_info(tire, opts)\n data\n end", "def service\n return softlayer_client[:Virtual_Guest].object_with_id(self.id)\n end", "def service\n context[:target]\n end", "def get_by_id(id)\n self.class.get(\"/aldebaran-instances/instances/#{id}\", :basic_auth => @auth)\n end", "def read_tier1_interface_0_with_http_info(tier_1_id, locale_services_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}/interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1Interface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read(_request)\n raise NotImplementedError, 'Implement this method in your strategy'\n end", "def read_tier1_service_interface_0(tier_1_id, locale_service_id, interface_id, opts = {})\n data, _status_code, _headers = read_tier1_service_interface_0_with_http_info(tier_1_id, locale_service_id, interface_id, opts)\n data\n end", "def get_resource(id, type)\n\t\[email protected](type).call.get(id)\n\tend", "def read_tier0(tier_0_id, opts = {})\n data, _status_code, _headers = read_tier0_with_http_info(tier_0_id, opts)\n data\n end", "def get()\n \n end", "def instance\n perform_request_with_object(:get, '/api/v1/instance', {}, Mastodon::Instance)\n end", "def servicio # :doc\n id = params[:service_id]\n if id.present?\n \t\tService.find(params[:service_id]) \n \tend \n end", "def get_transfer_by_path(path)\n obj = @service.object(path)\n .tap(&:introspect)\n Transfer.new(obj.Get(Transfer::INTERFACE, 'Id').first, self)\n end", "def resource_class_factory\n ActiveTriples::Resource\n end", "def set_tier_setting\n @tier_setting = TierSetting.find(params[:id])\n end", "def read_tier0_0_with_http_info(tier_0_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi.read_tier0_0 ...'\n end\n # verify the required parameter 'tier_0_id' is set\n if @api_client.config.client_side_validation && tier_0_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_0_id' when calling PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi.read_tier0_0\"\n end\n # resource path\n local_var_path = '/infra/tier-0s/{tier-0-id}'.sub('{' + 'tier-0-id' + '}', tier_0_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier0')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi#read_tier0_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_byod_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def quick_start_method\n main_service.quick_start_method&.rest\n end", "def read_tier1_byod_policy_service_instance_0(tier_1_id, locale_service_id, service_instance_id, opts = {})\n data, _status_code, _headers = read_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts)\n data\n end", "def tier\n raw_tier || Tier.default\n end", "def set_service_particular\n @service_particular = ServiceParticular.find(params[:id])\n end", "def read_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_byod_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def _service_type\n self.class.service_type\n end", "def instance\n perform_request_with_object(:get, '/api/v1/instance', {},\n Mastodon::Instance)\n end", "def get_instance(payload)\n NewFactorInstance.new(\n @version,\n payload,\n service_sid: @solution[:service_sid],\n identity: @solution[:identity],\n )\n end", "def get\n appid = ENV['TRIMET_APP_ID']\n response = Unirest.get( \"http://developer.trimet.org/ws/v2/vehicles?appid=#{appid}\" )\n response.body\nend", "def read_tier1_service_interface(tier_1_id, locale_service_id, interface_id, opts = {})\n data, _status_code, _headers = read_tier1_service_interface_with_http_info(tier_1_id, locale_service_id, interface_id, opts)\n data\n end", "def tradevalue_svc\n tradevalue = @svc.find_value_by_name(\"tradevalue\")\n tradevalue_svc = TradeValueService.new(tradevalue)\n return tradevalue_svc, get_version(tradevalue)\n end", "def read_one\n synchronize {\n read_many.slice!(0)\n }\n end", "def service\n softlayer_client[:Software_Component].object_with_id(self.id)\n end", "def service\n self.original_service or Service.find_by_name(\"FieldStatus\")\n end", "def read\n end", "def get_instance instance_id\n instances.get_instance name: instance_path(instance_id)\n end", "def show\n @service = Service.find(params[:id])\n end", "def index\n @service_particulars = ServiceParticular.all\n @service_particular = ServiceParticular.new\n end", "def read_tier1_byod_policy_service_instance(tier_1_id, locale_service_id, service_instance_id, opts = {})\n data, _status_code, _headers = read_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts)\n data\n end", "def get_reading\n\t\turi = URI.parse('http://localhost:5000/thermometers.json')\n\t\tthermo_response = Net::HTTP.get_response(uri)\n\t\tcheck = thermo_response.body\n\t\tj = JSON.parse(check)\n\tend", "def index\n @therm_resources = ThermResource.all\n end", "def read_tier1_interface(tier_1_id, locale_services_id, interface_id, opts = {})\n data, _status_code, _headers = read_tier1_interface_with_http_info(tier_1_id, locale_services_id, interface_id, opts)\n data\n end", "def show\n @tier = Tier.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @tier }\n end\n end", "def industrial\r\n IndustrialController.instance\r\n end", "def retrieve!\n raise Error::NotImplementedError, \"There is no current end point to get sensor data by id\"\n end", "def find_service(id)\n self.class.get(\"/services/#{id}.json?apikey=#{apikey}\")\n end", "def tei druid\n url = \"#{config.stacks}/file/druid:#{druid}/#{druid}.xml\"\n open(url)\n# File.open(\"/home/lyberadmin/frda/ap_tei/#{druid}.xml\")\n rescue Exception => e\n logger.error(\"error while retrieving tei at #{url} -- #{e.message}\")\n# logger.error(\"error while retrieving tei #{druid} -- #{e.message}\")\n \"<TEI.2/>\"\n end", "def driver\n Fc3Service\n end", "def _read type, name\n result = @elasticsupport.client.search index: _index_for(type), type: type.to_s, q: \"name:#{name}\"\n result[\"hits\"][\"hits\"][0] rescue nil\n end", "def context\n unless @instance_context\n @instance_context = ServiceContext.new(@version , @params['sid'])\n end\n @instance_context\n end", "def context\n unless @instance_context\n @instance_context = ServiceContext.new(@version , @params['sid'])\n end\n @instance_context\n end", "def service_type_name\n \"REST\"\n end", "def set_service\n @service = Service.where(\"id = ?\", params[:id]).first\n end", "def read(id)\n perform(:get, \"#{@resource_type}/#{id}\")\n end", "def getHttpService()\r\n @currentlyDisplayedItem.getHttpService\r\n end", "def first_service_with_rest\n services.find(&:methods_rest_bindings?)\n end" ]
[ "0.596298", "0.5934883", "0.5867492", "0.57776564", "0.56867754", "0.56125337", "0.54608375", "0.5456013", "0.53423405", "0.53216696", "0.529398", "0.5219874", "0.5168643", "0.51626885", "0.5158154", "0.51167804", "0.5109747", "0.51051366", "0.510492", "0.5103115", "0.5034319", "0.5034319", "0.5031084", "0.50194913", "0.50056255", "0.50047094", "0.49994007", "0.49917948", "0.49865887", "0.49637318", "0.49577844", "0.49560905", "0.49472052", "0.49445084", "0.49438375", "0.49397817", "0.4937447", "0.4937447", "0.49296084", "0.49260274", "0.4925747", "0.49212727", "0.49210998", "0.4911776", "0.49113345", "0.4910066", "0.4906086", "0.48991057", "0.4897258", "0.48938456", "0.48904595", "0.48894686", "0.4884406", "0.48842028", "0.48798725", "0.48795098", "0.48611", "0.48594213", "0.48436004", "0.48413324", "0.4835328", "0.4820261", "0.48199913", "0.48197427", "0.4815957", "0.48007292", "0.47967714", "0.4796359", "0.47930276", "0.4792304", "0.479031", "0.47867045", "0.47735098", "0.47707462", "0.47693595", "0.47621578", "0.47600952", "0.47579116", "0.4750271", "0.47486532", "0.47396025", "0.47351304", "0.47335124", "0.47315845", "0.47304255", "0.47270644", "0.47248638", "0.4724483", "0.47177872", "0.47116", "0.47059208", "0.47041598", "0.46952307", "0.46938673", "0.46904302", "0.46904302", "0.46896985", "0.46868107", "0.46856743", "0.46853918", "0.46853894" ]
0.0
-1
Read Tier1 service instance Read Tier1 service instance
def read_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0 ...' end # verify the required parameter 'tier_1_id' is set if @api_client.config.client_side_validation && tier_1_id.nil? fail ArgumentError, "Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0" end # verify the required parameter 'locale_service_id' is set if @api_client.config.client_side_validation && locale_service_id.nil? fail ArgumentError, "Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0" end # verify the required parameter 'service_instance_id' is set if @api_client.config.client_side_validation && service_instance_id.nil? fail ArgumentError, "Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0" end # resource path local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'PolicyServiceInstance') if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_tier1(tier_1_id, opts = {})\n data, _status_code, _headers = read_tier1_with_http_info(tier_1_id, opts)\n data\n end", "def read_tier1_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#read_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#read_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_0(tier_1_id, opts = {})\n data, _status_code, _headers = read_tier1_0_with_http_info(tier_1_id, opts)\n data\n end", "def service; services.first; end", "def service\n @service\n end", "def service; end", "def read_instance\n raise NotImplementedError, 'read_instance needs to be implemented by child providers'\n end", "def service\n @service ||= bus.service('com.dubstepdish.i3dstatus')\n end", "def read_service_payments\r\n read_service_payment while peek == 'SVC'\r\n self\r\n end", "def service\n return @service\n end", "def bi_service\n end", "def tier\n @tier_cache || self.tiers[0]\n end", "def load_tier\n if id = params[:tier_id]\n @tier = Tier.find_by_permalink_and_region_and_active(id)\n end\n end", "def read_tier1_locale_services_0_with_http_info(tier_1_id, locale_services_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#read_tier1_locale_services_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def listserv\n listservs.first\n end", "def service\n return softlayer_client[:Ticket].object_with_id(self.id)\n end", "def service\n StockManagementService.new\n end", "def service\n @service ||= fetcher.get(Service, service_id)\n end", "def read_tier1_locale_services_with_http_info(tier_1_id, locale_services_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#read_tier1_locale_services\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def load_tier\n if id = tier_param_id\n @tier = Tier.find_by_permalink_and_region_and_active(id)\n @tier_class = @tier.class if @tier\n end\n end", "def load_tier\n if id = tier_param_id\n @tier = Tier.find_by_permalink_and_region_and_active(id)\n @tier_class = @tier.class if @tier\n end\n end", "def read\n iface = Qt::DBusInterface.new(SERVICE_NAME, READ_PATH, \"\", Qt::DBusConnection.sessionBus)\n raise \"D-BUS Interface Error : #{Qt::DBusConnection.sessionBus.lastError.message}\" unless iface.valid?\n msg = iface.call(Qt::DBus::BlockWithGui, \"read\", url)\n reply = Qt::DBusReply.new(msg)\n raise \"D-BUS Reply Error : #{reply.error.message}\" unless reply.valid?\n reply.value\n end", "def services\n end", "def read_tier1_service_interface_with_http_info(tier_1_id, locale_service_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_service_interface\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_service_interface_0_with_http_info(tier_1_id, locale_service_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_service_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def service(id)\n request :get, \"/services/#{id}\"\n end", "def srv\n @service_finder\n end", "def services\n\n end", "def service\n return softlayer_client[\"Virtual_Guest\"].object_with_id(self.id)\n end", "def read_tier0_with_http_info(tier_0_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi.read_tier0 ...'\n end\n # verify the required parameter 'tier_0_id' is set\n if @api_client.config.client_side_validation && tier_0_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_0_id' when calling PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi.read_tier0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-0s/{tier-0-id}'.sub('{' + 'tier-0-id' + '}', tier_0_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier0')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi#read_tier0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def retrieve(service:, resource:, qos: {} )\n port = AnyPort::Port.new.port_for_message_exchange_pattern(qos)\n # result = Try {\n result = with_circuit do |circuit|\n circuit.service_name = resource\n end.call { get(port, service, resource, ENVIRONMENT) }\n # }\n\n # result.get_or_else {raise self.class::RequestFailure}\n # begin\n # result = with_circuit do |circuit|\n # circuit.service_name = resource\n # end.call {MockClient.new.call(service, resource, :development)}\n # rescue AnyPort::CircuitBreaker::CircuitOpen => e\n # puts \"===>CircuitBreaker Open Exception\"\n # rescue AnyPort::PortException => e\n # puts \"===>General Port Exception, #{e}\"\n # end\n end", "def services\n\tend", "def get( name, *args )\n point = find_definition( name )\n raise ServiceNotFound, \"#{fullname}.#{name}\" unless point\n\n point.instance( self, *args )\n end", "def read_tier1_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_instance(payload)\n ServiceInstance.new(@version, payload)\n end", "def get_instance(payload)\n ServiceInstance.new(@version, payload)\n end", "def read_policy_dns_forwarder_on_tier1_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/dns-forwarder'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyDnsForwarder')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi#read_policy_dns_forwarder_on_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def set_idti_service\n @idti_service = IdtiService.find(params[:id])\n end", "def connect\n service\n end", "def sensors\r\n SensorsController.instance\r\n end", "def service_name; end", "def read_policy_dns_forwarder_on_tier1_0(tier_1_id, opts = {})\n data, _status_code, _headers = read_policy_dns_forwarder_on_tier1_0_with_http_info(tier_1_id, opts)\n data\n end", "def read_tier1_interface_with_http_info(tier_1_id, locale_services_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}/interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1Interface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_interface\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_policy_dns_forwarder_on_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/dns-forwarder'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyDnsForwarder')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi#read_policy_dns_forwarder_on_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_policy_dns_forwarder_on_tier1(tier_1_id, opts = {})\n data, _status_code, _headers = read_policy_dns_forwarder_on_tier1_with_http_info(tier_1_id, opts)\n data\n end", "def show\n @service = Service.find(params[:id])\n end", "def tires_read(tire, opts = {})\n data, _status_code, _headers = tires_read_with_http_info(tire, opts)\n data\n end", "def service\n return softlayer_client[:Virtual_Guest].object_with_id(self.id)\n end", "def service\n context[:target]\n end", "def get_by_id(id)\n self.class.get(\"/aldebaran-instances/instances/#{id}\", :basic_auth => @auth)\n end", "def read(_request)\n raise NotImplementedError, 'Implement this method in your strategy'\n end", "def read_tier1_interface_0_with_http_info(tier_1_id, locale_services_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}/interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1Interface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_resource(id, type)\n\t\[email protected](type).call.get(id)\n\tend", "def read_tier1_service_interface_0(tier_1_id, locale_service_id, interface_id, opts = {})\n data, _status_code, _headers = read_tier1_service_interface_0_with_http_info(tier_1_id, locale_service_id, interface_id, opts)\n data\n end", "def read_tier0(tier_0_id, opts = {})\n data, _status_code, _headers = read_tier0_with_http_info(tier_0_id, opts)\n data\n end", "def get()\n \n end", "def instance\n perform_request_with_object(:get, '/api/v1/instance', {}, Mastodon::Instance)\n end", "def servicio # :doc\n id = params[:service_id]\n if id.present?\n \t\tService.find(params[:service_id]) \n \tend \n end", "def get_transfer_by_path(path)\n obj = @service.object(path)\n .tap(&:introspect)\n Transfer.new(obj.Get(Transfer::INTERFACE, 'Id').first, self)\n end", "def set_tier_setting\n @tier_setting = TierSetting.find(params[:id])\n end", "def resource_class_factory\n ActiveTriples::Resource\n end", "def read_tier0_0_with_http_info(tier_0_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi.read_tier0_0 ...'\n end\n # verify the required parameter 'tier_0_id' is set\n if @api_client.config.client_side_validation && tier_0_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_0_id' when calling PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi.read_tier0_0\"\n end\n # resource path\n local_var_path = '/infra/tier-0s/{tier-0-id}'.sub('{' + 'tier-0-id' + '}', tier_0_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier0')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier0GatewaysTier0GatewaysApi#read_tier0_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_byod_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def quick_start_method\n main_service.quick_start_method&.rest\n end", "def tier\n raw_tier || Tier.default\n end", "def read_tier1_byod_policy_service_instance_0(tier_1_id, locale_service_id, service_instance_id, opts = {})\n data, _status_code, _headers = read_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts)\n data\n end", "def set_service_particular\n @service_particular = ServiceParticular.find(params[:id])\n end", "def read_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_byod_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def _service_type\n self.class.service_type\n end", "def instance\n perform_request_with_object(:get, '/api/v1/instance', {},\n Mastodon::Instance)\n end", "def get_instance(payload)\n NewFactorInstance.new(\n @version,\n payload,\n service_sid: @solution[:service_sid],\n identity: @solution[:identity],\n )\n end", "def get\n appid = ENV['TRIMET_APP_ID']\n response = Unirest.get( \"http://developer.trimet.org/ws/v2/vehicles?appid=#{appid}\" )\n response.body\nend", "def read_tier1_service_interface(tier_1_id, locale_service_id, interface_id, opts = {})\n data, _status_code, _headers = read_tier1_service_interface_with_http_info(tier_1_id, locale_service_id, interface_id, opts)\n data\n end", "def tradevalue_svc\n tradevalue = @svc.find_value_by_name(\"tradevalue\")\n tradevalue_svc = TradeValueService.new(tradevalue)\n return tradevalue_svc, get_version(tradevalue)\n end", "def read_one\n synchronize {\n read_many.slice!(0)\n }\n end", "def service\n softlayer_client[:Software_Component].object_with_id(self.id)\n end", "def service\n self.original_service or Service.find_by_name(\"FieldStatus\")\n end", "def read\n end", "def get_instance instance_id\n instances.get_instance name: instance_path(instance_id)\n end", "def show\n @service = Service.find(params[:id])\n end", "def index\n @service_particulars = ServiceParticular.all\n @service_particular = ServiceParticular.new\n end", "def read_tier1_byod_policy_service_instance(tier_1_id, locale_service_id, service_instance_id, opts = {})\n data, _status_code, _headers = read_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts)\n data\n end", "def get_reading\n\t\turi = URI.parse('http://localhost:5000/thermometers.json')\n\t\tthermo_response = Net::HTTP.get_response(uri)\n\t\tcheck = thermo_response.body\n\t\tj = JSON.parse(check)\n\tend", "def index\n @therm_resources = ThermResource.all\n end", "def show\n @tier = Tier.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @tier }\n end\n end", "def read_tier1_interface(tier_1_id, locale_services_id, interface_id, opts = {})\n data, _status_code, _headers = read_tier1_interface_with_http_info(tier_1_id, locale_services_id, interface_id, opts)\n data\n end", "def industrial\r\n IndustrialController.instance\r\n end", "def retrieve!\n raise Error::NotImplementedError, \"There is no current end point to get sensor data by id\"\n end", "def find_service(id)\n self.class.get(\"/services/#{id}.json?apikey=#{apikey}\")\n end", "def tei druid\n url = \"#{config.stacks}/file/druid:#{druid}/#{druid}.xml\"\n open(url)\n# File.open(\"/home/lyberadmin/frda/ap_tei/#{druid}.xml\")\n rescue Exception => e\n logger.error(\"error while retrieving tei at #{url} -- #{e.message}\")\n# logger.error(\"error while retrieving tei #{druid} -- #{e.message}\")\n \"<TEI.2/>\"\n end", "def driver\n Fc3Service\n end", "def _read type, name\n result = @elasticsupport.client.search index: _index_for(type), type: type.to_s, q: \"name:#{name}\"\n result[\"hits\"][\"hits\"][0] rescue nil\n end", "def context\n unless @instance_context\n @instance_context = ServiceContext.new(@version , @params['sid'])\n end\n @instance_context\n end", "def context\n unless @instance_context\n @instance_context = ServiceContext.new(@version , @params['sid'])\n end\n @instance_context\n end", "def service_type_name\n \"REST\"\n end", "def set_service\n @service = Service.where(\"id = ?\", params[:id]).first\n end", "def getHttpService()\r\n @currentlyDisplayedItem.getHttpService\r\n end", "def first_service_with_rest\n services.find(&:methods_rest_bindings?)\n end", "def read(id)\n perform(:get, \"#{@resource_type}/#{id}\")\n end" ]
[ "0.59622973", "0.5933636", "0.58663744", "0.5777507", "0.568712", "0.5613026", "0.5460806", "0.5455378", "0.53422296", "0.5321433", "0.52945006", "0.52197695", "0.5170293", "0.51636386", "0.51562506", "0.5117856", "0.5110099", "0.51057935", "0.5105114", "0.510106", "0.50352794", "0.50352794", "0.5019281", "0.5004525", "0.5003932", "0.49978146", "0.49918073", "0.49874315", "0.49635303", "0.49584138", "0.49560732", "0.4947357", "0.49444965", "0.49429572", "0.4937659", "0.4937153", "0.4937153", "0.49280673", "0.4926707", "0.49266273", "0.4921862", "0.49208182", "0.49107745", "0.49101204", "0.49086404", "0.49051726", "0.48992947", "0.48969933", "0.48944315", "0.48912808", "0.48893288", "0.4883932", "0.4882866", "0.4879613", "0.48786902", "0.486183", "0.48594812", "0.4843902", "0.4841907", "0.48355386", "0.48216343", "0.48202193", "0.48196727", "0.48144892", "0.4800882", "0.47972912", "0.47963408", "0.4793876", "0.47906446", "0.47903126", "0.4787018", "0.47739822", "0.47704408", "0.47678047", "0.47613123", "0.47599015", "0.47591197", "0.47503525", "0.47483695", "0.47395945", "0.47353598", "0.4733782", "0.47308233", "0.47301036", "0.47269723", "0.47255227", "0.47235352", "0.4718245", "0.47117996", "0.470575", "0.47046405", "0.46954936", "0.46929422", "0.46907133", "0.46907133", "0.46890643", "0.46877754", "0.4686056", "0.46857613", "0.46850544" ]
0.50291663
22
Read Tier1 service instance endpoint Read Tier1 service instance endpoint
def read_tier1_policy_service_instance_endpoint(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, opts = {}) data, _status_code, _headers = read_tier1_policy_service_instance_endpoint_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_endpoint()\n end", "def service_endpoint; end", "def service_endpoint; end", "def endpoint; end", "def endpoint; end", "def endpoint; end", "def endpoint; end", "def endpoint\n raise NotImplementedError\n end", "def ipn_endpoint; end", "def ipn_endpoint; end", "def endpoint\n data[:endpoint]\n end", "def endpoint\n data[:endpoint]\n end", "def endpoint_name\n self.class.endpoint_name\n end", "def endpoint\n ENDPOINT[server]\n end", "def endpoint\n \"https://#{@host}:#{@port}/wsman\"\n end", "def read_tier1_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#read_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#read_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def endpoints; end", "def get endpoint\n do_request :get, endpoint\n end", "def rest_endpoint; end", "def endpoint=(_arg0); end", "def service\n @service\n end", "def service_type_name\n \"REST\"\n end", "def rest_endpoint=(_arg0); end", "def start\n call :get, @endpoint\n end", "def read_tier1_policy_service_instance_endpoint_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInstanceEndpoint')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance_endpoint_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def endpoint\n raise StandardError, 'Please implement this method.'\n end", "def endpoint\n raise StandardError, 'Please implement this method.'\n end", "def reader_endpoint\n data[:reader_endpoint]\n end", "def endpoint_url\n self.class::ENDPOINT\n end", "def read_tier1_policy_service_instance_endpoint_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInstanceEndpoint')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance_endpoint\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def ipn_endpoint=(_arg0); end", "def service(id)\n request :get, \"/services/#{id}\"\n end", "def service\n context[:target]\n end", "def endpoint_name\n self.name.split('::').last.downcase\n end", "def service; end", "def endpoint\n @endpoint||= \"#{@scheme}://#{@host}#{@path}\"\n end", "def service_name; end", "def listserv\n listservs.first\n end", "def to_endpoint id\n t=id.split('/')\n domain = t[1..-2].join('_')\n type = t[-1]\n \"freebase_tsv_#{domain}__#{type}\"\nend", "def resourceType\n 'Endpoint'\n end", "def endpoint\n @endpoint ||= 'https://rest.avalara.net'\n end", "def read_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n endpoint(get(services_url).body)\n end", "def quick_start_method\n main_service.quick_start_method&.rest\n end", "def service; services.first; end", "def endpoint\n\t\t\t\[email protected]\n\t\t\tend", "def service\n URI.parse(@config.split('<')[0].split('->')[1])\n end", "def get_ingress_endpoint(namespace, ingress_name)\n stdout, _, _ = execute(\"kubectl get ingress #{ingress_name} -n #{namespace} -o json -o jsonpath='{.status.loadBalancer.ingress[0].hostname}'\")\n stdout\nend", "def endpoint\n \"#{@scheme}://#{@host}#{@path}\"\n end", "def transaction_endpoints\n TransactionEndpointsController.instance\n end", "def bi_service\n end", "def service_uri\n \"#{host}#{service_path}\"\n end", "def read_tier1_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def endpoint\n @endpoint || YodleeApi.endpoint\n end", "def endpoint\n @endpoint || YodleeApi.endpoint\n end", "def endpoint\n @endpoint || YodleeApi.endpoint\n end", "def read_tier1_service_interface_with_http_info(tier_1_id, locale_service_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_service_interface\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def rest_end_point; end", "def set_endpoint\n @endpoint = Endpoint.where(name: params[:request_name])\n .where(client_tag: params[:client_tag]).first\n end", "def read_tier1_service_interface_0_with_http_info(tier_1_id, locale_service_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_service_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def endpoint\n options.endpoint\n end", "def default_ipn_endpoint; end", "def read_policy_dns_forwarder_on_tier1_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/dns-forwarder'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyDnsForwarder')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi#read_policy_dns_forwarder_on_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def client\n Etapper.client\nend", "def service\n return @service\n end", "def get( name, *args )\n point = find_definition( name )\n raise ServiceNotFound, \"#{fullname}.#{name}\" unless point\n\n point.instance( self, *args )\n end", "def service\n options[:service]\n end", "def read_policy_dns_forwarder_on_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/dns-forwarder'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyDnsForwarder')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi#read_policy_dns_forwarder_on_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def api_endpoint\n Solusvm.api_endpoint.dup\n end", "def service_request(service); end", "def inspect\n values = @properties.map{|k, v| \"#{k}: #{v}\"}.join(\" \")\n \"<Twilio.Proxy.V1.ServiceInstance #{values}>\"\n end", "def get_api endpoint\n\turi = URI.parse(\"http://#{@HOST}:#{@HTTP}#{endpoint}\")\n\trequest = Net::HTTP::Get.new(uri)\n\trequest[\"Accept\"] = \"application/json\"\n\toptions = { use_ssl: uri.scheme == \"https\" }\n\tresponse = Net::HTTP.start(uri.hostname, uri.port, options) do |http|\n\t\thttp.request(request)\n\tend\nend", "def read_tier1_locale_services_0_with_http_info(tier_1_id, locale_services_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#read_tier1_locale_services_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def endpoint\n\t\t\t\[email protected](\n\t\t\t\t\tssl_context: self.ssl_context,\n\t\t\t\t\treuse_address: true,\n\t\t\t\t)\n\t\t\tend", "def endpoint\n\t\t\t\[email protected](\n\t\t\t\t\tssl_context: self.ssl_context,\n\t\t\t\t\treuse_address: true,\n\t\t\t\t)\n\t\t\tend", "def connect\n service\n end", "def read_tier1_interface_with_http_info(tier_1_id, locale_services_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}/interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1Interface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_interface\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get\n appid = ENV['TRIMET_APP_ID']\n response = Unirest.get( \"http://developer.trimet.org/ws/v2/vehicles?appid=#{appid}\" )\n response.body\nend", "def endpoint_type\n return @endpoint_type\n end", "def service_directory_name\n \"rest\"\n end", "def read_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_byod_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def endpoint\n \"https://#{region.sub(/-\\d$/, '')}.power-iaas.cloud.ibm.com/pcloud/v1\"\n end", "def read_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_byod_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_interface_0_with_http_info(tier_1_id, locale_services_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}/interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1Interface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1(tier_1_id, opts = {})\n data, _status_code, _headers = read_tier1_with_http_info(tier_1_id, opts)\n data\n end", "def endpoints\n EndpointRegistry[id]\n end", "def get_calls(service)\n\t\treturn @transport.get_path(\"calls\",service)\n\tend", "def services\n\n end", "def services\n end", "def read_tier1_locale_services_with_http_info(tier_1_id, locale_services_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#read_tier1_locale_services\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def tool_proxy_service_endpoint(tcp)\n tp_services = tcp['service_offered'].find do |s|\n s['format'] == [ToolProxy::TOOL_PROXY_FORMAT]\n end\n\n # Retrieve and return the endpoint of the ToolProxy.collection service\n URI.parse(tp_services['endpoint']) unless tp_services.blank?\n end", "def tool_proxy_service_endpoint(tcp)\n tp_services = tcp['service_offered'].find do |s|\n s['format'] == [ToolProxy::TOOL_PROXY_FORMAT]\n end\n\n # Retrieve and return the endpoint of the ToolProxy.collection service\n URI.parse(tp_services['endpoint']) unless tp_services.blank?\n end", "def discovery\n resource ''\n end", "def instance\n perform_request_with_object(:get, '/api/v1/instance', {}, Mastodon::Instance)\n end", "def service_name\n resource[:name]\n end", "def endpoint\n connection.url_prefix\n end", "def get; end", "def rest_token_endpoint=(_arg0); end", "def getHttpService()\r\n @currentlyDisplayedItem.getHttpService\r\n end", "def endpoint\n @endpoint ||= 'https://api.emailcampaigns.net/2/REST/'\n end" ]
[ "0.64534795", "0.623006", "0.623006", "0.612847", "0.612847", "0.612847", "0.612847", "0.5919416", "0.58240694", "0.58240694", "0.57863206", "0.57863206", "0.5742387", "0.56770355", "0.56624746", "0.5638", "0.56114364", "0.5609996", "0.56054515", "0.55743086", "0.5557844", "0.5542484", "0.55280054", "0.55228025", "0.55205536", "0.54759836", "0.5464909", "0.5464909", "0.5452921", "0.5449599", "0.5420147", "0.5402683", "0.53748", "0.5364249", "0.5354538", "0.5345545", "0.5332911", "0.53165257", "0.5316336", "0.530725", "0.5295093", "0.527728", "0.5263015", "0.5244637", "0.52373177", "0.5228177", "0.5223825", "0.5220322", "0.52146995", "0.5211151", "0.5210828", "0.5197192", "0.5188921", "0.51789546", "0.517485", "0.517485", "0.517485", "0.51726913", "0.51663727", "0.51643974", "0.5162116", "0.5142357", "0.5093253", "0.50839734", "0.50837004", "0.50784737", "0.50765175", "0.5073463", "0.50732976", "0.50716376", "0.5062915", "0.50563496", "0.50537646", "0.50476", "0.5035749", "0.5035749", "0.5031089", "0.5030635", "0.50256556", "0.5024463", "0.5016978", "0.49976277", "0.49966118", "0.49914557", "0.49861234", "0.49784237", "0.49780822", "0.49780536", "0.4975434", "0.4973029", "0.49718034", "0.49714506", "0.49714506", "0.49693257", "0.4967144", "0.49569938", "0.4956622", "0.49466568", "0.49424163", "0.49393058", "0.49365178" ]
0.0
-1
Read Tier1 service instance endpoint Read Tier1 service instance endpoint
def read_tier1_policy_service_instance_endpoint_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint ...' end # verify the required parameter 'tier_1_id' is set if @api_client.config.client_side_validation && tier_1_id.nil? fail ArgumentError, "Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint" end # verify the required parameter 'locale_service_id' is set if @api_client.config.client_side_validation && locale_service_id.nil? fail ArgumentError, "Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint" end # verify the required parameter 'service_instance_id' is set if @api_client.config.client_side_validation && service_instance_id.nil? fail ArgumentError, "Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint" end # verify the required parameter 'service_instance_endpoint_id' is set if @api_client.config.client_side_validation && service_instance_endpoint_id.nil? fail ArgumentError, "Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint" end # resource path local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ServiceInstanceEndpoint') if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance_endpoint\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_endpoint()\n end", "def service_endpoint; end", "def service_endpoint; end", "def endpoint; end", "def endpoint; end", "def endpoint; end", "def endpoint; end", "def endpoint\n raise NotImplementedError\n end", "def ipn_endpoint; end", "def ipn_endpoint; end", "def endpoint\n data[:endpoint]\n end", "def endpoint\n data[:endpoint]\n end", "def endpoint_name\n self.class.endpoint_name\n end", "def endpoint\n ENDPOINT[server]\n end", "def endpoint\n \"https://#{@host}:#{@port}/wsman\"\n end", "def read_tier1_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#read_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#read_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def endpoints; end", "def get endpoint\n do_request :get, endpoint\n end", "def rest_endpoint; end", "def endpoint=(_arg0); end", "def service\n @service\n end", "def service_type_name\n \"REST\"\n end", "def rest_endpoint=(_arg0); end", "def start\n call :get, @endpoint\n end", "def read_tier1_policy_service_instance_endpoint_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInstanceEndpoint')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance_endpoint_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def endpoint\n raise StandardError, 'Please implement this method.'\n end", "def endpoint\n raise StandardError, 'Please implement this method.'\n end", "def reader_endpoint\n data[:reader_endpoint]\n end", "def endpoint_url\n self.class::ENDPOINT\n end", "def ipn_endpoint=(_arg0); end", "def service(id)\n request :get, \"/services/#{id}\"\n end", "def service\n context[:target]\n end", "def endpoint_name\n self.name.split('::').last.downcase\n end", "def service; end", "def endpoint\n @endpoint||= \"#{@scheme}://#{@host}#{@path}\"\n end", "def service_name; end", "def listserv\n listservs.first\n end", "def to_endpoint id\n t=id.split('/')\n domain = t[1..-2].join('_')\n type = t[-1]\n \"freebase_tsv_#{domain}__#{type}\"\nend", "def resourceType\n 'Endpoint'\n end", "def endpoint\n @endpoint ||= 'https://rest.avalara.net'\n end", "def read_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n endpoint(get(services_url).body)\n end", "def quick_start_method\n main_service.quick_start_method&.rest\n end", "def service; services.first; end", "def endpoint\n\t\t\t\[email protected]\n\t\t\tend", "def service\n URI.parse(@config.split('<')[0].split('->')[1])\n end", "def get_ingress_endpoint(namespace, ingress_name)\n stdout, _, _ = execute(\"kubectl get ingress #{ingress_name} -n #{namespace} -o json -o jsonpath='{.status.loadBalancer.ingress[0].hostname}'\")\n stdout\nend", "def endpoint\n \"#{@scheme}://#{@host}#{@path}\"\n end", "def transaction_endpoints\n TransactionEndpointsController.instance\n end", "def bi_service\n end", "def service_uri\n \"#{host}#{service_path}\"\n end", "def read_tier1_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def endpoint\n @endpoint || YodleeApi.endpoint\n end", "def endpoint\n @endpoint || YodleeApi.endpoint\n end", "def endpoint\n @endpoint || YodleeApi.endpoint\n end", "def read_tier1_service_interface_with_http_info(tier_1_id, locale_service_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_service_interface\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def rest_end_point; end", "def set_endpoint\n @endpoint = Endpoint.where(name: params[:request_name])\n .where(client_tag: params[:client_tag]).first\n end", "def read_tier1_service_interface_0_with_http_info(tier_1_id, locale_service_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_service_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def endpoint\n options.endpoint\n end", "def default_ipn_endpoint; end", "def read_policy_dns_forwarder_on_tier1_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/dns-forwarder'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyDnsForwarder')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi#read_policy_dns_forwarder_on_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def client\n Etapper.client\nend", "def service\n return @service\n end", "def get( name, *args )\n point = find_definition( name )\n raise ServiceNotFound, \"#{fullname}.#{name}\" unless point\n\n point.instance( self, *args )\n end", "def service\n options[:service]\n end", "def read_policy_dns_forwarder_on_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/dns-forwarder'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyDnsForwarder')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi#read_policy_dns_forwarder_on_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def api_endpoint\n Solusvm.api_endpoint.dup\n end", "def service_request(service); end", "def inspect\n values = @properties.map{|k, v| \"#{k}: #{v}\"}.join(\" \")\n \"<Twilio.Proxy.V1.ServiceInstance #{values}>\"\n end", "def get_api endpoint\n\turi = URI.parse(\"http://#{@HOST}:#{@HTTP}#{endpoint}\")\n\trequest = Net::HTTP::Get.new(uri)\n\trequest[\"Accept\"] = \"application/json\"\n\toptions = { use_ssl: uri.scheme == \"https\" }\n\tresponse = Net::HTTP.start(uri.hostname, uri.port, options) do |http|\n\t\thttp.request(request)\n\tend\nend", "def read_tier1_locale_services_0_with_http_info(tier_1_id, locale_services_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#read_tier1_locale_services_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def endpoint\n\t\t\t\[email protected](\n\t\t\t\t\tssl_context: self.ssl_context,\n\t\t\t\t\treuse_address: true,\n\t\t\t\t)\n\t\t\tend", "def endpoint\n\t\t\t\[email protected](\n\t\t\t\t\tssl_context: self.ssl_context,\n\t\t\t\t\treuse_address: true,\n\t\t\t\t)\n\t\t\tend", "def connect\n service\n end", "def read_tier1_interface_with_http_info(tier_1_id, locale_services_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}/interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1Interface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_interface\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get\n appid = ENV['TRIMET_APP_ID']\n response = Unirest.get( \"http://developer.trimet.org/ws/v2/vehicles?appid=#{appid}\" )\n response.body\nend", "def endpoint_type\n return @endpoint_type\n end", "def service_directory_name\n \"rest\"\n end", "def read_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_byod_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def endpoint\n \"https://#{region.sub(/-\\d$/, '')}.power-iaas.cloud.ibm.com/pcloud/v1\"\n end", "def read_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_byod_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_interface_0_with_http_info(tier_1_id, locale_services_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}/interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1Interface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1(tier_1_id, opts = {})\n data, _status_code, _headers = read_tier1_with_http_info(tier_1_id, opts)\n data\n end", "def endpoints\n EndpointRegistry[id]\n end", "def get_calls(service)\n\t\treturn @transport.get_path(\"calls\",service)\n\tend", "def services\n\n end", "def services\n end", "def read_tier1_locale_services_with_http_info(tier_1_id, locale_services_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#read_tier1_locale_services\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def tool_proxy_service_endpoint(tcp)\n tp_services = tcp['service_offered'].find do |s|\n s['format'] == [ToolProxy::TOOL_PROXY_FORMAT]\n end\n\n # Retrieve and return the endpoint of the ToolProxy.collection service\n URI.parse(tp_services['endpoint']) unless tp_services.blank?\n end", "def tool_proxy_service_endpoint(tcp)\n tp_services = tcp['service_offered'].find do |s|\n s['format'] == [ToolProxy::TOOL_PROXY_FORMAT]\n end\n\n # Retrieve and return the endpoint of the ToolProxy.collection service\n URI.parse(tp_services['endpoint']) unless tp_services.blank?\n end", "def discovery\n resource ''\n end", "def instance\n perform_request_with_object(:get, '/api/v1/instance', {}, Mastodon::Instance)\n end", "def service_name\n resource[:name]\n end", "def endpoint\n connection.url_prefix\n end", "def get; end", "def rest_token_endpoint=(_arg0); end", "def getHttpService()\r\n @currentlyDisplayedItem.getHttpService\r\n end", "def endpoint\n @endpoint ||= 'https://api.emailcampaigns.net/2/REST/'\n end" ]
[ "0.64534795", "0.623006", "0.623006", "0.612847", "0.612847", "0.612847", "0.612847", "0.5919416", "0.58240694", "0.58240694", "0.57863206", "0.57863206", "0.5742387", "0.56770355", "0.56624746", "0.5638", "0.56114364", "0.5609996", "0.56054515", "0.55743086", "0.5557844", "0.5542484", "0.55280054", "0.55228025", "0.55205536", "0.54759836", "0.5464909", "0.5464909", "0.5452921", "0.5449599", "0.5402683", "0.53748", "0.5364249", "0.5354538", "0.5345545", "0.5332911", "0.53165257", "0.5316336", "0.530725", "0.5295093", "0.527728", "0.5263015", "0.5244637", "0.52373177", "0.5228177", "0.5223825", "0.5220322", "0.52146995", "0.5211151", "0.5210828", "0.5197192", "0.5188921", "0.51789546", "0.517485", "0.517485", "0.517485", "0.51726913", "0.51663727", "0.51643974", "0.5162116", "0.5142357", "0.5093253", "0.50839734", "0.50837004", "0.50784737", "0.50765175", "0.5073463", "0.50732976", "0.50716376", "0.5062915", "0.50563496", "0.50537646", "0.50476", "0.5035749", "0.5035749", "0.5031089", "0.5030635", "0.50256556", "0.5024463", "0.5016978", "0.49976277", "0.49966118", "0.49914557", "0.49861234", "0.49784237", "0.49780822", "0.49780536", "0.4975434", "0.4973029", "0.49718034", "0.49714506", "0.49714506", "0.49693257", "0.4967144", "0.49569938", "0.4956622", "0.49466568", "0.49424163", "0.49393058", "0.49365178" ]
0.5420147
30
Read Tier1 service instance endpoint Read Tier1 service instance endpoint
def read_tier1_policy_service_instance_endpoint_0(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, opts = {}) data, _status_code, _headers = read_tier1_policy_service_instance_endpoint_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_endpoint()\n end", "def service_endpoint; end", "def service_endpoint; end", "def endpoint; end", "def endpoint; end", "def endpoint; end", "def endpoint; end", "def endpoint\n raise NotImplementedError\n end", "def ipn_endpoint; end", "def ipn_endpoint; end", "def endpoint\n data[:endpoint]\n end", "def endpoint\n data[:endpoint]\n end", "def endpoint_name\n self.class.endpoint_name\n end", "def endpoint\n ENDPOINT[server]\n end", "def endpoint\n \"https://#{@host}:#{@port}/wsman\"\n end", "def read_tier1_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#read_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#read_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def endpoints; end", "def get endpoint\n do_request :get, endpoint\n end", "def rest_endpoint; end", "def endpoint=(_arg0); end", "def service\n @service\n end", "def service_type_name\n \"REST\"\n end", "def rest_endpoint=(_arg0); end", "def start\n call :get, @endpoint\n end", "def read_tier1_policy_service_instance_endpoint_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInstanceEndpoint')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance_endpoint_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def endpoint\n raise StandardError, 'Please implement this method.'\n end", "def endpoint\n raise StandardError, 'Please implement this method.'\n end", "def reader_endpoint\n data[:reader_endpoint]\n end", "def endpoint_url\n self.class::ENDPOINT\n end", "def read_tier1_policy_service_instance_endpoint_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInstanceEndpoint')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance_endpoint\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def ipn_endpoint=(_arg0); end", "def service(id)\n request :get, \"/services/#{id}\"\n end", "def service\n context[:target]\n end", "def endpoint_name\n self.name.split('::').last.downcase\n end", "def service; end", "def endpoint\n @endpoint||= \"#{@scheme}://#{@host}#{@path}\"\n end", "def listserv\n listservs.first\n end", "def service_name; end", "def to_endpoint id\n t=id.split('/')\n domain = t[1..-2].join('_')\n type = t[-1]\n \"freebase_tsv_#{domain}__#{type}\"\nend", "def resourceType\n 'Endpoint'\n end", "def endpoint\n @endpoint ||= 'https://rest.avalara.net'\n end", "def read_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n endpoint(get(services_url).body)\n end", "def quick_start_method\n main_service.quick_start_method&.rest\n end", "def service; services.first; end", "def endpoint\n\t\t\t\[email protected]\n\t\t\tend", "def service\n URI.parse(@config.split('<')[0].split('->')[1])\n end", "def get_ingress_endpoint(namespace, ingress_name)\n stdout, _, _ = execute(\"kubectl get ingress #{ingress_name} -n #{namespace} -o json -o jsonpath='{.status.loadBalancer.ingress[0].hostname}'\")\n stdout\nend", "def transaction_endpoints\n TransactionEndpointsController.instance\n end", "def endpoint\n \"#{@scheme}://#{@host}#{@path}\"\n end", "def bi_service\n end", "def service_uri\n \"#{host}#{service_path}\"\n end", "def read_tier1_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def endpoint\n @endpoint || YodleeApi.endpoint\n end", "def endpoint\n @endpoint || YodleeApi.endpoint\n end", "def endpoint\n @endpoint || YodleeApi.endpoint\n end", "def read_tier1_service_interface_with_http_info(tier_1_id, locale_service_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_service_interface\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def rest_end_point; end", "def set_endpoint\n @endpoint = Endpoint.where(name: params[:request_name])\n .where(client_tag: params[:client_tag]).first\n end", "def read_tier1_service_interface_0_with_http_info(tier_1_id, locale_service_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_service_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def endpoint\n options.endpoint\n end", "def default_ipn_endpoint; end", "def client\n Etapper.client\nend", "def read_policy_dns_forwarder_on_tier1_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/dns-forwarder'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyDnsForwarder')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi#read_policy_dns_forwarder_on_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def service\n return @service\n end", "def get( name, *args )\n point = find_definition( name )\n raise ServiceNotFound, \"#{fullname}.#{name}\" unless point\n\n point.instance( self, *args )\n end", "def service\n options[:service]\n end", "def read_policy_dns_forwarder_on_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/dns-forwarder'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyDnsForwarder')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi#read_policy_dns_forwarder_on_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def api_endpoint\n Solusvm.api_endpoint.dup\n end", "def service_request(service); end", "def inspect\n values = @properties.map{|k, v| \"#{k}: #{v}\"}.join(\" \")\n \"<Twilio.Proxy.V1.ServiceInstance #{values}>\"\n end", "def get_api endpoint\n\turi = URI.parse(\"http://#{@HOST}:#{@HTTP}#{endpoint}\")\n\trequest = Net::HTTP::Get.new(uri)\n\trequest[\"Accept\"] = \"application/json\"\n\toptions = { use_ssl: uri.scheme == \"https\" }\n\tresponse = Net::HTTP.start(uri.hostname, uri.port, options) do |http|\n\t\thttp.request(request)\n\tend\nend", "def read_tier1_locale_services_0_with_http_info(tier_1_id, locale_services_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#read_tier1_locale_services_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def endpoint\n\t\t\t\[email protected](\n\t\t\t\t\tssl_context: self.ssl_context,\n\t\t\t\t\treuse_address: true,\n\t\t\t\t)\n\t\t\tend", "def endpoint\n\t\t\t\[email protected](\n\t\t\t\t\tssl_context: self.ssl_context,\n\t\t\t\t\treuse_address: true,\n\t\t\t\t)\n\t\t\tend", "def read_tier1_interface_with_http_info(tier_1_id, locale_services_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}/interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1Interface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_interface\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def connect\n service\n end", "def get\n appid = ENV['TRIMET_APP_ID']\n response = Unirest.get( \"http://developer.trimet.org/ws/v2/vehicles?appid=#{appid}\" )\n response.body\nend", "def endpoint_type\n return @endpoint_type\n end", "def service_directory_name\n \"rest\"\n end", "def endpoint\n \"https://#{region.sub(/-\\d$/, '')}.power-iaas.cloud.ibm.com/pcloud/v1\"\n end", "def read_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_byod_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_byod_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_interface_0_with_http_info(tier_1_id, locale_services_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}/interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1Interface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_calls(service)\n\t\treturn @transport.get_path(\"calls\",service)\n\tend", "def read_tier1(tier_1_id, opts = {})\n data, _status_code, _headers = read_tier1_with_http_info(tier_1_id, opts)\n data\n end", "def endpoints\n EndpointRegistry[id]\n end", "def services\n\n end", "def services\n end", "def read_tier1_locale_services_with_http_info(tier_1_id, locale_services_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#read_tier1_locale_services\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def tool_proxy_service_endpoint(tcp)\n tp_services = tcp['service_offered'].find do |s|\n s['format'] == [ToolProxy::TOOL_PROXY_FORMAT]\n end\n\n # Retrieve and return the endpoint of the ToolProxy.collection service\n URI.parse(tp_services['endpoint']) unless tp_services.blank?\n end", "def tool_proxy_service_endpoint(tcp)\n tp_services = tcp['service_offered'].find do |s|\n s['format'] == [ToolProxy::TOOL_PROXY_FORMAT]\n end\n\n # Retrieve and return the endpoint of the ToolProxy.collection service\n URI.parse(tp_services['endpoint']) unless tp_services.blank?\n end", "def discovery\n resource ''\n end", "def instance\n perform_request_with_object(:get, '/api/v1/instance', {}, Mastodon::Instance)\n end", "def service_name\n resource[:name]\n end", "def endpoint\n connection.url_prefix\n end", "def get; end", "def rest_token_endpoint=(_arg0); end", "def getHttpService()\r\n @currentlyDisplayedItem.getHttpService\r\n end", "def endpoint\n @endpoint ||= 'https://api.emailcampaigns.net/2/REST/'\n end" ]
[ "0.6453197", "0.6229735", "0.6229735", "0.6127977", "0.6127977", "0.6127977", "0.6127977", "0.5919018", "0.582366", "0.582366", "0.5786764", "0.5786764", "0.57416564", "0.56767005", "0.56616694", "0.5637726", "0.56110954", "0.5609412", "0.56064254", "0.5574596", "0.5556289", "0.5543263", "0.55286074", "0.55221677", "0.5520546", "0.5474707", "0.5464112", "0.5464112", "0.5454244", "0.5449284", "0.5419014", "0.5401477", "0.5375373", "0.53640145", "0.5353298", "0.53450793", "0.5332114", "0.5317117", "0.5316479", "0.5306902", "0.52949727", "0.52770823", "0.5261887", "0.52453774", "0.52374434", "0.5228392", "0.5222971", "0.5219712", "0.52150744", "0.52108836", "0.52106416", "0.5197019", "0.51886296", "0.5177885", "0.51737666", "0.51737666", "0.51737666", "0.51730716", "0.516582", "0.51629204", "0.5162391", "0.51423407", "0.50921714", "0.50832576", "0.5082842", "0.50793284", "0.50760394", "0.5073955", "0.50721455", "0.50708133", "0.50632644", "0.50571585", "0.50538653", "0.5047212", "0.5034286", "0.5034286", "0.50308967", "0.5030892", "0.5027103", "0.50245297", "0.5017153", "0.49966452", "0.49963757", "0.49902377", "0.49863392", "0.49798802", "0.49784136", "0.49782273", "0.49754596", "0.49731323", "0.49715358", "0.4970701", "0.4970701", "0.49694768", "0.49673593", "0.49579597", "0.4956144", "0.49476814", "0.49418008", "0.49403152", "0.4936327" ]
0.0
-1
Read Tier1 service instance endpoint Read Tier1 service instance endpoint
def read_tier1_policy_service_instance_endpoint_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0 ...' end # verify the required parameter 'tier_1_id' is set if @api_client.config.client_side_validation && tier_1_id.nil? fail ArgumentError, "Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0" end # verify the required parameter 'locale_service_id' is set if @api_client.config.client_side_validation && locale_service_id.nil? fail ArgumentError, "Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0" end # verify the required parameter 'service_instance_id' is set if @api_client.config.client_side_validation && service_instance_id.nil? fail ArgumentError, "Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0" end # verify the required parameter 'service_instance_endpoint_id' is set if @api_client.config.client_side_validation && service_instance_endpoint_id.nil? fail ArgumentError, "Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint_0" end # resource path local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ServiceInstanceEndpoint') if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance_endpoint_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_endpoint()\n end", "def service_endpoint; end", "def service_endpoint; end", "def endpoint; end", "def endpoint; end", "def endpoint; end", "def endpoint; end", "def endpoint\n raise NotImplementedError\n end", "def ipn_endpoint; end", "def ipn_endpoint; end", "def endpoint\n data[:endpoint]\n end", "def endpoint\n data[:endpoint]\n end", "def endpoint_name\n self.class.endpoint_name\n end", "def endpoint\n ENDPOINT[server]\n end", "def endpoint\n \"https://#{@host}:#{@port}/wsman\"\n end", "def read_tier1_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#read_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.read_tier1_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#read_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def endpoints; end", "def get endpoint\n do_request :get, endpoint\n end", "def rest_endpoint; end", "def endpoint=(_arg0); end", "def service\n @service\n end", "def service_type_name\n \"REST\"\n end", "def rest_endpoint=(_arg0); end", "def start\n call :get, @endpoint\n end", "def endpoint\n raise StandardError, 'Please implement this method.'\n end", "def endpoint\n raise StandardError, 'Please implement this method.'\n end", "def reader_endpoint\n data[:reader_endpoint]\n end", "def endpoint_url\n self.class::ENDPOINT\n end", "def read_tier1_policy_service_instance_endpoint_with_http_info(tier_1_id, locale_service_id, service_instance_id, service_instance_endpoint_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint\"\n end\n # verify the required parameter 'service_instance_endpoint_id' is set\n if @api_client.config.client_side_validation && service_instance_endpoint_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_endpoint_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_endpoint\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s).sub('{' + 'service-instance-endpoint-id' + '}', service_instance_endpoint_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInstanceEndpoint')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance_endpoint\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def ipn_endpoint=(_arg0); end", "def service(id)\n request :get, \"/services/#{id}\"\n end", "def service\n context[:target]\n end", "def endpoint_name\n self.name.split('::').last.downcase\n end", "def service; end", "def endpoint\n @endpoint||= \"#{@scheme}://#{@host}#{@path}\"\n end", "def service_name; end", "def listserv\n listservs.first\n end", "def to_endpoint id\n t=id.split('/')\n domain = t[1..-2].join('_')\n type = t[-1]\n \"freebase_tsv_#{domain}__#{type}\"\nend", "def resourceType\n 'Endpoint'\n end", "def endpoint\n @endpoint ||= 'https://rest.avalara.net'\n end", "def read_tier1_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n endpoint(get(services_url).body)\n end", "def quick_start_method\n main_service.quick_start_method&.rest\n end", "def service; services.first; end", "def endpoint\n\t\t\t\[email protected]\n\t\t\tend", "def service\n URI.parse(@config.split('<')[0].split('->')[1])\n end", "def get_ingress_endpoint(namespace, ingress_name)\n stdout, _, _ = execute(\"kubectl get ingress #{ingress_name} -n #{namespace} -o json -o jsonpath='{.status.loadBalancer.ingress[0].hostname}'\")\n stdout\nend", "def endpoint\n \"#{@scheme}://#{@host}#{@path}\"\n end", "def transaction_endpoints\n TransactionEndpointsController.instance\n end", "def bi_service\n end", "def service_uri\n \"#{host}#{service_path}\"\n end", "def read_tier1_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def endpoint\n @endpoint || YodleeApi.endpoint\n end", "def endpoint\n @endpoint || YodleeApi.endpoint\n end", "def endpoint\n @endpoint || YodleeApi.endpoint\n end", "def read_tier1_service_interface_with_http_info(tier_1_id, locale_service_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_service_interface\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def rest_end_point; end", "def set_endpoint\n @endpoint = Endpoint.where(name: params[:request_name])\n .where(client_tag: params[:client_tag]).first\n end", "def read_tier1_service_interface_0_with_http_info(tier_1_id, locale_service_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_service_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def endpoint\n options.endpoint\n end", "def default_ipn_endpoint; end", "def read_policy_dns_forwarder_on_tier1_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/dns-forwarder'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyDnsForwarder')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi#read_policy_dns_forwarder_on_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def client\n Etapper.client\nend", "def service\n return @service\n end", "def get( name, *args )\n point = find_definition( name )\n raise ServiceNotFound, \"#{fullname}.#{name}\" unless point\n\n point.instance( self, *args )\n end", "def service\n options[:service]\n end", "def read_policy_dns_forwarder_on_tier1_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi.read_policy_dns_forwarder_on_tier1_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/dns-forwarder'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyDnsForwarder')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingIPManagementDNSDNSForwarderTier1GatewaysApi#read_policy_dns_forwarder_on_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def api_endpoint\n Solusvm.api_endpoint.dup\n end", "def service_request(service); end", "def inspect\n values = @properties.map{|k, v| \"#{k}: #{v}\"}.join(\" \")\n \"<Twilio.Proxy.V1.ServiceInstance #{values}>\"\n end", "def get_api endpoint\n\turi = URI.parse(\"http://#{@HOST}:#{@HTTP}#{endpoint}\")\n\trequest = Net::HTTP::Get.new(uri)\n\trequest[\"Accept\"] = \"application/json\"\n\toptions = { use_ssl: uri.scheme == \"https\" }\n\tresponse = Net::HTTP.start(uri.hostname, uri.port, options) do |http|\n\t\thttp.request(request)\n\tend\nend", "def read_tier1_locale_services_0_with_http_info(tier_1_id, locale_services_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#read_tier1_locale_services_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def endpoint\n\t\t\t\[email protected](\n\t\t\t\t\tssl_context: self.ssl_context,\n\t\t\t\t\treuse_address: true,\n\t\t\t\t)\n\t\t\tend", "def endpoint\n\t\t\t\[email protected](\n\t\t\t\t\tssl_context: self.ssl_context,\n\t\t\t\t\treuse_address: true,\n\t\t\t\t)\n\t\t\tend", "def connect\n service\n end", "def read_tier1_interface_with_http_info(tier_1_id, locale_services_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}/interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1Interface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_interface\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get\n appid = ENV['TRIMET_APP_ID']\n response = Unirest.get( \"http://developer.trimet.org/ws/v2/vehicles?appid=#{appid}\" )\n response.body\nend", "def endpoint_type\n return @endpoint_type\n end", "def service_directory_name\n \"rest\"\n end", "def read_tier1_byod_policy_service_instance_0_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_byod_policy_service_instance_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def endpoint\n \"https://#{region.sub(/-\\d$/, '')}.power-iaas.cloud.ibm.com/pcloud/v1\"\n end", "def read_tier1_byod_policy_service_instance_with_http_info(tier_1_id, locale_service_id, service_instance_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance\"\n end\n # verify the required parameter 'service_instance_id' is set\n if @api_client.config.client_side_validation && service_instance_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_instance_id' when calling PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi.read_tier1_byod_policy_service_instance\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'service-instance-id' + '}', service_instance_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ByodPolicyServiceInstance')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionServiceInstancesTier1GatewaysApi#read_tier1_byod_policy_service_instance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1_interface_0_with_http_info(tier_1_id, locale_services_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}/interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Tier1Interface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def read_tier1(tier_1_id, opts = {})\n data, _status_code, _headers = read_tier1_with_http_info(tier_1_id, opts)\n data\n end", "def endpoints\n EndpointRegistry[id]\n end", "def get_calls(service)\n\t\treturn @transport.get_path(\"calls\",service)\n\tend", "def services\n\n end", "def services\n end", "def read_tier1_locale_services_with_http_info(tier_1_id, locale_services_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi.read_tier1_locale_services\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LocaleServices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1LocaleServicesApi#read_tier1_locale_services\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def tool_proxy_service_endpoint(tcp)\n tp_services = tcp['service_offered'].find do |s|\n s['format'] == [ToolProxy::TOOL_PROXY_FORMAT]\n end\n\n # Retrieve and return the endpoint of the ToolProxy.collection service\n URI.parse(tp_services['endpoint']) unless tp_services.blank?\n end", "def tool_proxy_service_endpoint(tcp)\n tp_services = tcp['service_offered'].find do |s|\n s['format'] == [ToolProxy::TOOL_PROXY_FORMAT]\n end\n\n # Retrieve and return the endpoint of the ToolProxy.collection service\n URI.parse(tp_services['endpoint']) unless tp_services.blank?\n end", "def discovery\n resource ''\n end", "def instance\n perform_request_with_object(:get, '/api/v1/instance', {}, Mastodon::Instance)\n end", "def service_name\n resource[:name]\n end", "def endpoint\n connection.url_prefix\n end", "def get; end", "def rest_token_endpoint=(_arg0); end", "def getHttpService()\r\n @currentlyDisplayedItem.getHttpService\r\n end", "def endpoint\n @endpoint ||= 'https://api.emailcampaigns.net/2/REST/'\n end" ]
[ "0.64534795", "0.623006", "0.623006", "0.612847", "0.612847", "0.612847", "0.612847", "0.5919416", "0.58240694", "0.58240694", "0.57863206", "0.57863206", "0.5742387", "0.56770355", "0.56624746", "0.5638", "0.56114364", "0.5609996", "0.56054515", "0.55743086", "0.5557844", "0.5542484", "0.55280054", "0.55228025", "0.55205536", "0.5464909", "0.5464909", "0.5452921", "0.5449599", "0.5420147", "0.5402683", "0.53748", "0.5364249", "0.5354538", "0.5345545", "0.5332911", "0.53165257", "0.5316336", "0.530725", "0.5295093", "0.527728", "0.5263015", "0.5244637", "0.52373177", "0.5228177", "0.5223825", "0.5220322", "0.52146995", "0.5211151", "0.5210828", "0.5197192", "0.5188921", "0.51789546", "0.517485", "0.517485", "0.517485", "0.51726913", "0.51663727", "0.51643974", "0.5162116", "0.5142357", "0.5093253", "0.50839734", "0.50837004", "0.50784737", "0.50765175", "0.5073463", "0.50732976", "0.50716376", "0.5062915", "0.50563496", "0.50537646", "0.50476", "0.5035749", "0.5035749", "0.5031089", "0.5030635", "0.50256556", "0.5024463", "0.5016978", "0.49976277", "0.49966118", "0.49914557", "0.49861234", "0.49784237", "0.49780822", "0.49780536", "0.4975434", "0.4973029", "0.49718034", "0.49714506", "0.49714506", "0.49693257", "0.4967144", "0.49569938", "0.4956622", "0.49466568", "0.49424163", "0.49393058", "0.49365178" ]
0.54759836
25
CSV's delegated and overwritten IO methods move the pointer within the file, but FastCSV doesn't notice, so we need to recreate the fiber. The old fiber is garbage collected.
def pos=(*args) super @parser = nil @fiber = nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def touch_csv(csv_file_or_object, fields, field_generators = {})\n Slacker.touch_csv(csv_file_or_object, fields, field_generators)\n end", "def fix_csv(old_csv)\n\t\told_csv.pop\n\t\tproper_headers(old_csv)\n\t\tCSV.open(\"public/ephemeral.csv\", 'wb') do |write_crude|\n\t\t\told_csv.each do |fix_csv|\n\t\t\t\twrite_crude << fix_csv\n\t\t\tend\n\t\tend\n\tend", "def process_csv\n @file = @file.tempfile\n CSV.foreach(@file, headers: false) { |row| process_item(row[0].to_i) }\n end", "def close\n @csv.close\n end", "def convert\n # Create an object to store *all* lines of the *output* CSV\n @csv_out_data = FasterCSV.generate(FCSV_OUT_OPTS){|csv_out| \n\n # Iterate thru each *input* line\n line_in_count = 0\n FasterCSV.foreach(@in_file, FCSV_IN_OPTS) {|line_in|\n line_in_count += 1\n if line_in_count == 1\n self.class.verify_csv_in_headers(line_in.headers)\n # The output CSV shall be indentical to the input CSV but with\n # the COLUMN_ITEM_HANDLE replaced with COLUMN_ITEM_ID.\n @csv_out_headers = line_in.headers.deep_copy\n @index = @csv_out_headers.index(COLUMN_ITEM_HANDLE) # Index of column to be replaced\n @csv_out_headers[@index] = COLUMN_ITEM_ID\t# Replace this column in the header\n end\n\n # Iterate thru each *output* column\n line_out = []\n @csv_out_headers.each_with_index{|col,i|\n csv_out << @csv_out_headers if line_in_count == 1 && i == 0\t# Header line\n\n unless i == @index\n line_out << line_in[col]\n else\t\t\t\t\t\t# Replace with item_id\n h = DSpaceResource.new(line_in[COLUMN_ITEM_HANDLE], :item)\n if h && h.resource_id\n line_out << h.resource_id\t\t\t# The item_id corresponding to handle\n else\n STDERR.puts <<-MSG_HANDLE_LOOKUP.gsub(/^\\t*/, '')\n\t\tERROR: Either the handle '#{line_in[COLUMN_ITEM_HANDLE]}' was not found or it was\n\t\tfound but the corresponding item_id is NULL (eg. perhaps the item was\n\t\tdeleted from the database).\n MSG_HANDLE_LOOKUP\n exit ERROR_HANDLE_LOOKUP\n end\n end\n }\n csv_out << line_out\n }\n }\n end", "def parse(line)\n @io.rewind\n @io.truncate(0)\n @io << line\n @io.rewind\n @csv.shift\n end", "def update_summary_csv(summary_csv_path, line)\n puts \"updating summary csv: #{summary_csv_path}\"\n\n # the results row is a string rather than an array so handle as file rather than csv\n File.open(summary_csv_path, \"a+\") do |f|\n f << line\n end\nend", "def import_csv_smart\n \n end", "def save!(follow_link: true)\n raise(ReadOnlyCSVError) if @path.nil? || [email protected]_s.end_with?('.csv')\n\n path.unlink if !follow_link && path.symlink?\n\n FileUtils.mkdir_p(path.dirname)\n File.write(path, table.to_csv)\n self\n end", "def updateCSVFile\n\t\tFile.open('accounts.csv', 'w') do |file|\n\t\t\tfile << \"Account,Date,Payee,Category,Outflow,Inflow\\n\"\n\t\t\[email protected] do |line|\n\t\t\t\tfile << line\n\t\t\tend\n\t\tend\n\tend", "def update_csv\n CSV.open(@csv_location, \"w\") do |line|\n @recipearray.each do |x|\n line << [x.name, x.description, x.duration, x.tried]\n end\n end\n end", "def process_CSV_file(file, _total_lines = 0, charset = 'bom|utf-8')\n start_time = Time.now.to_i # setting up time keeping\n ActiveRecord::Base.transaction do\n SmarterCSV.process(file, chunk_size: 10, verbose: true, file_encoding: charset.to_s) do |file_chunk|\n file_chunk.each do |record_row|\n sanitized_row = sanitize_row(record_row)\n process_record_row(sanitized_row, {})\n @counter << sanitized_row # appends in latest record to allow error to report where import failed\n ### CallingActorInUpdater feeding it the this (the current) actor.\n @updater_actor.run(Celluloid::Actor.current) unless @updater_actor.nil?\n @counter\n end\n end\n # finishing up time keeping and reporting:\n total_count = @counter.size\n end_time = Time.now.to_i\n total_count_hash = { total_lines: total_count, time: ((end_time - start_time) / 60).round(2) }\n puts \"\\033[32m#{total_count_hash}\\033[0m\\n\" # green\n @exit_status = 0\n @result = total_count_hash\n end\n ensure\n # on CSV::MalformedCSVError # something gets said\n @updater_actor.terminate unless @updater_actor.nil?\n end", "def csv\n @csv_table ||= begin\n csv_raw = File.read(CSV_PATH)\n CSV.parse(csv_raw, headers: true)\n end\n\nend", "def fix_csv(csv_filenames)\n # Read line from file, modify, and write back out\n first_line = true\n new_file_name = \"#{@file_name[0...-3]}csv\"\n # Open final csv for output\n File.open(new_file_name, 'w') do |fo|\n # Iterate over tmp csv files\n csv_filenames.each do |csv|\n # Go through each line of tmp csv\n CSV.foreach(csv, headers: true) do |row|\n if first_line\n headers = @col_num_hash.keys\n fo.puts headers.join(',')\n first_line = false\n else\n fo.puts fix_data(row)\n end\n end\n end\n end\nend", "def import_csv_full\n \n end", "def csv_emit(row)\n row = row.to_h\n mutex.synchronize do\n # header if necessary\n csv_header(row.keys) if !csv.started?\n\n # emit\n print = csv.emit(row)\n puts print.ai if options[:verbose]\n\n # this is caught by Sinew::Main\n if csv.count == options[:limit]\n raise LimitError\n end\n end\n end", "def update_csv\n CSV.open(@csv_file, \"w\") do |csv|\n csv << [\"id\", \"name\", \"password\", \"title\"]\n @data.each do |record|\n csv << [record.id, record.name, record.password, record.title]\n end\n end\n end", "def add_row(row)\n\n # Delete row if it already exists\n $rows.delete_if { |r| r['file_path'] == row['file_path'] }\n $rows << row\n\n # rewrite csv:\n update_csv($rows)\nend", "def csv_uploader(infile, organisationid)\n require 'csv'\n require 'timeout'\n# counter = 1\n begin \n CSV.parse(infile).drop(1).each do |row| \n# puts \"************************************\"\n# puts \"Started reading #{counter} row and inserting row in the table\"\n Customer.customer_build_from_csv(row, organisationid) \n# puts \"Ended the process of inserting #{counter} row in the table\"\n# puts \"************************************\"\n# counter += 1 \n end \n rescue\n retry\n# puts \"*****************************************\"\n# puts \"Anup got timeout error\"\n# puts \"*****************************************\" \n end\n end", "def prepare_csv\n unparsed_file = File.open(csv.path)\n self.parsed_csv_string = \"\"\n string = unparsed_file.readlines()\n string.each_with_index do |line,i|\n parsed_line = line.encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '').gsub(/,\\\"\\\"/,'')\n # for some reason the iRacing CSV file is buggy.\n unless parsed_line == \"\\n\"\n if i == 5 or i == 6\n parsed_line = parsed_line.gsub(/\\n/,\"\\r\\n\")\n end\n self.parsed_csv_string << parsed_line\n end\n end\n unparsed_file.close\n end", "def open_data_for_write\n @data_file = CSV.open(data_file_full_path,\"w+\", @data_lib.csv_opt)\n @data_stream = @data_file\n end", "def render(truncate_after_bytes = nil)\n Tempfile.open(['csv']) do |tempfile|\n csv = CSV.new(tempfile)\n\n write_csv csv, until_condition: -> do\n truncate_after_bytes && tempfile.size > truncate_after_bytes\n end\n\n if block_given?\n yield tempfile\n else\n tempfile.rewind\n tempfile.read\n end\n end\n end", "def create_csv &block\n file = create_tempfile \"csv\"\n CSV.open file.path, \"w\", &block\n file\n end", "def reset_csv()\n node_file = File.join(csv_output_path, 'nodes.csv')\n File.delete(node_file) if File.exist?(node_file)\n end", "def with_csv(io, options = {})\n yield get_csv(io, options)\n end", "def reprocess_csv(file)\n raw = open(file).read.force_encoding(\"UTF-8\")\n csv = CSV.parse(raw, headers: true, header_converters: :symbol)\n csv.each do |row|\n data = row.to_hash.each { |k, v| v = v.to_s.gsub(/[[:space:]]+/, ' ').strip }\n data[:area_id] = data[:area].downcase\n data[:gender] = data[:gender].downcase\n data[:term] = '2013'\n %i(num).each { |i| data.delete i }\n ScraperWiki.save_sqlite([:name, :name, :term], data)\n end\nend", "def finished\n\t\t@csv[5]\n\tend", "def generate(with_headers: true)\n @file = Tempfile.new([row_model_class.name, \".csv\"])\n CSV.open(file.path, \"wb\") do |csv|\n @csv = csv\n row_model_class.setup(csv, context, with_headers: with_headers)\n yield Proxy.new(self)\n end\n ensure\n @csv = nil\n end", "def update_csv(card)\n @deck = Deck.new([card])\n text_to_add = write_csv\n file = File.open(\"./files/#{@filename}.txt\", 'a+')\n file.puts(write_csv)\n file.close\n @deck = @stupid_deck_saver\n\n end", "def convert\n STDERR.print \"\\nThis may take 10 minutes or more. Lines processed: \"\n line_in_count = 0\n\n # Create an object to store *all* lines of the *output* CSV\n @csv_out_data = FasterCSV.generate(FCSV_OUT_OPTS){|csv_out| \n\n # Iterate thru each *input* line\n FasterCSV.foreach(@in_file, FCSV_IN_OPTS) {|line_in|\n line_in_count += 1\n if line_in_count == 1\n self.class.verify_csv_in_headers(line_in.headers)\n @csv_out_headers = WILL_INCLUDE_INPUT_COLUMNS ? CSV_OUT_COLUMNS + CSV_IN_COLUMNS : CSV_OUT_COLUMNS\n end\n\n # Iterate thru each *output* column\n line_out = []\n @csv_out_headers.each_with_index{|col,i|\n csv_out << @csv_out_headers if line_in_count == 1 && i == 0\t# Header line\n\n case col\n when RmidItem, PrefixColOwner, PrefixColList\n line_out << line_in[col]\n when HdlItem\n line_out << get_handle_for_rmid(line_in[RmidItem])\n when HdlColOwner\n line_out << get_handle_for_collection_prefix(line_in[PrefixColOwner])\n when HdlColList\n if line_in[PrefixColList]\n prefixes = line_in[PrefixColList].split(VALUE_DELIMITER)\n handles = prefixes.inject([]){|a,prefix| a << get_handle_for_collection_prefix(prefix)}\n line_out << handles.join(VALUE_DELIMITER)\n else\n line_out << \"\"\n end\n end\n }\n csv_out << line_out\n STDERR.print \"#{line_in_count} \" if line_in_count % 200 == 0\n }\n }\n STDERR.puts \"; Total lines #{line_in_count} \"\n end", "def create_people_raw\n @@people_raw = CsvMapper.import('test_ward.csv') do\n read_attributes_from_file\n end\nend", "def post_csv(path, csv)\n file = Tempfile.new(['dotmailer-contacts', '.csv'])\n file.write csv\n file.rewind\n\n post path, :csv => file\n end", "def wipe_clean_file\n CSV.open('touch-contact.csv', 'w') do |csv_object|\n csv_object << [nil]\n end\n end", "def seed_from_csv(migration_class, csv_file)\n migration_class.transaction do\n csv_file.each do |line_values|\n record = migration_class.new\n line_values.to_hash.keys.map do |attribute|\n record.send(\"#{attribute.strip}=\",line_values[attribute].strip) rescue nil\n end\n record.save(:validate => false)\n end\n end\n end", "def convert_csv_file_to_object\n begin\n CSV.foreach(@file_name) do |row|\n @csv_object.push(row)\n end \n rescue => exception\n raise FileReadError, exception\n end\n end", "def get_csv_object\n @csv_object\n end", "def csv=(klass); end", "def updateCSV\n state = request.location.state\n city = request.location.city\n @project.city = city;\n @project.state = state;\n @project.save\n\n # Creates the CSV file if it doesn't exist\n CSV.open(PROJECT_CSV_PATH, 'a') do end\n\n # Read the CSV file and increment the value associated with the\n # state if the row exists. This puts the entire csv file into\n # the variable 'csv'\n rowExists = false;\n csv = CSV.read(PROJECT_CSV_PATH, headers:true);\n csv.each do |row|\n if(row[0] == state)\n row[1] = row[1].to_i + 1;\n rowExists = true;\n end\n end\n\n # This library does not allow you to simply add a row.\n # Every line in the csv variable is rewritten to the file\n CSV.open(PROJECT_CSV_PATH, 'w', write_headers:true, :headers=>['name','pop','lat','lon']) do |file|\n csv.each do |row|\n file << row\n end\n if !rowExists\n file << [state, 1, request.location.latitude, request.location.longitude]\n end\n end\n end", "def reset\n return false unless valid?\n\n @line_number = 0\n @headers = @current_row = @next_row = @skipped_rows = @next_skipped_rows = nil\n\n @ruby_csv.try(:close)\n @ruby_csv = _ruby_csv\n true\n end", "def old_csv_dump(brig)\n file = self.flies.send(brig)\n \"#{self.traverse_board}#{file}\"\n end", "def load_csv\n options = { headers: :first_row, header_converters: :symbol }\n\n CSV.foreach(@csv_path, options) do |row|\n row[:id] = row[:id].to_i\n row[:price] = row[:price].to_i\n @elements << Meal.new(row)\n end\n @next_id = @elements.empty? ? 1 : @elements.last.id + 1\n end", "def import_csv(file, current_user, replace=false)\n\n # users first...\n created_user_ids = []\n updated_user_ids = []\n user_errors = {}\n\n # if replacing entire database, delete all users not matching the current user\n User.where.not(id: current_user.id).delete_all if replace\n\n CSV.foreach(file.path, headers: true) do |row|\n row_hash = row.to_hash\n\n # check for child - if child, skip, otherwise delete so it doesn't mess up creation\n next unless !row_hash['child'] || (row_hash['child'].downcase == 'false')\n row_hash.delete 'child'\n\n # update date formats to correct the CSV export format\n if !row_hash['birthday'].blank?\n date = DateTime.strptime(row_hash['birthday'], '%m/%d/%y') rescue nil\n if date\n birthday_formatted = date.strftime('%Y-%m-%d').to_s\n row_hash['birthday'] = birthday_formatted\n end\n end\n\n # don't allow the current user to get messed with\n if row_hash['id'] == current_user.id || row_hash['email'].strip == current_user.email\n user_errors[:matching_current_user] = [current_user.full_name]\n else\n user = User.find_by_email(row_hash['email'])\n if user\n #found an existing user, so update attributes\n user.update(row_hash)\n\n if user.errors.blank?\n updated_user_ids.push user.id\n end\n else\n # import the new user\n temp_pass = row_hash['last_name'] + row_hash['first_name']\n row_hash['password'] = temp_pass\n row_hash['password_confirmation'] = temp_pass\n\n user = User.create(row_hash)\n\n if user.errors.blank?\n created_user_ids.push user.id\n end\n end\n\n # handle errors\n user.errors.each do |error|\n user_errors[error] ||= []\n user_errors[error].push user.full_name\n end\n end\n end\n\n # children next...\n created_child_ids = []\n updated_child_ids = []\n child_errors = {}\n\n # if replacing entire database, delete all children\n Child.delete_all if replace\n\n CSV.foreach(file.path, headers: true) do |row|\n row_hash = row.to_hash\n\n # check for child - if not child, skip, otherwise delete so it doesn't mess up creation\n next unless row_hash['child'] && (row_hash['child'].downcase == 'true')\n row_hash.delete 'child'\n\n # update date formats to correct the CSV export format\n if !row_hash['birthday'].blank?\n date = DateTime.strptime(row_hash['birthday'], '%m/%d/%y') rescue nil\n if date\n birthday_formatted = date.strftime('%Y-%m-%d').to_s\n row_hash['birthday'] = birthday_formatted\n end\n end\n\n # create child-only hash\n child_hash = {}\n row_hash.each do |key,value|\n if !value.blank?\n child_hash[key] = value\n end\n end\n\n child = Child.find_by_id(child_hash['id'])\n if child\n #found an existing child, so update attributes\n child.update(child_hash)\n\n if child.errors.blank?\n updated_child_ids.push child.id\n end\n else\n # import the new child\n child = Child.create(child_hash)\n\n if child.errors.blank?\n created_child_ids.push child.id\n end\n end\n\n # handle errors\n child.errors.each do |error|\n child_errors[error] ||= []\n child_errors[error].push child.full_name\n end\n end\n\n # return a hash of the saved and updated user ids, and the errors for the failures\n { created_user_ids: created_user_ids, updated_user_ids: updated_user_ids, user_errors: user_errors,\n created_child_ids: created_child_ids, updated_child_ids: updated_child_ids, child_errors: child_errors }\n end", "def write(arr)\n starting_id = read.length\n CSV.open('contacts.csv', 'a') do |csv|\n csv << arr.unshift(starting_id)\n end\n end", "def load_raw_data(klass, csv_file_path)\n\t\tCSV::Converters[:blank_to_nil] = lambda do |field|\n\t\t field && field.empty? ? nil : field\n\t\tend\n\n\t\tputs \"Loading data from #{csv_file_path}\"\n\n\t\tprogress = ProgressBar.create(:title => klass.name, :starting_at => 0, :total => nil, :format => \"%t: Records: %c Elapsed %a Records/second: %r %b\")\n\t\tcount = 0\n\n\t\tbegin\n\t\t\tFile.open(csv_file_path, 'r') do |f|\n\t\t\t\theaders = nil\n\t\t\t\trows = []\n\n\t\t\t\tf.each_with_index do |row, i| \n\t\t\t\t\tbegin\n\t\t\t\t\t\t# The first 4 lines are comments and the 5th are column labels we don't use; skip them\n\t\t\t\t\t\tnext if i < 5\n\n\t\t\t\t\t\t# The last row is a 'footer', delimited with 'F'\n\t\t\t\t\t\tnext if row.starts_with? \"F \"\n\n\t\t\t\t\t\t# I know it's weird, we parse CSV only to generate CSV again, but it's to canonicalize the CSV into a form PG\n\t\t\t\t\t\t# can use, since some of the input data are, shall we say, sloppy.\n\t\t\t\t\t\trows << try_parse_csv(row).to_csv\n\n\t\t\t\t\t\tif (rows.count == ROWS_PER_BATCH) \n\t\t\t\t\t\t\tcopy_rows klass.connection, klass.table_name, rows\n\t\t\t\t\t\tend\n\n\t\t\t\t\t\tprogress.increment\n\t\t\t\t\t\tcount += 1\n\n\t\t\t\t\trescue Exception => e\n\t\t\t\t\t\tprogress.log \"#{csv_file_path}:#{i+1}: #{e.inspect}\"\n\t\t\t\t\t\tprogress.log \"Rows contents: \"\n\t\t\t\t\t\tprogress.log \" #{rows}\"\n\t\t\t\t\t\traise e\n\t\t\t\t\tend\n\t\t\t\tend\n\n\t\t\t\t# Any remaining rows, write now\n\t\t\t\tcopy_rows klass.connection, klass.table_name, rows\n\t\t\tend\n\n\t\t\tprogress.total = count\n\t\trescue Exception => e\n\t\t\tprogress.stop\n\t\t\traise e\n\t\tend\n\n\t\tprogress.finish\n\n\t\tputs \"Loaded #{count} records\"\n\tend", "def make_testdata_reworked_csv_file\n create_column_headers_index_hash \n create_row_headers_index_hash \n clear_testdata_reworked_file\n CSV.open('testdata_reworked.csv', \"wb\") do |csv|\n CSV.foreach('testdata.csv', {headers: true}) do |row| \n row[0] = @column_hash.key(row[0].to_i)\n row[1] = @row_hash.key(row[1].to_i)\n csv << row\n end\n end\nend", "def perform_csv_load(file_name, options = {})\n require \"csv\"\n @parsed_file = CSV.read(file_name)\n\n # Create a method_mapper which maps list of headers into suitable calls on the Active Record class\n # For example if model has an attribute 'price' will map columns called Price, price, PRICE etc to this attribute\n populate_method_mapper_from_headers( @parsed_file.shift, options)\n\n puts \"\\n\\n\\nLoading from CSV file: #{file_name}\"\n puts \"Processing #{@parsed_file.size} rows\"\n begin\n Spree::Product.transaction do\n @reporter.reset\n @parsed_file.each_with_index do |row, i|\n @current_row = row\n name_index = @headers.find_index(\"Name\")\n name = row[name_index]\n if options[\"match_by\"]\n name_index = @headers.find_index(options[\"match_by\"])\n name = row[name_index]\n condition_hash = {name: row[name_index]}\n object = find_or_new(Spree::Product, condition_hash)\n @product = object || new_product\n @reporter.reset\n end\n\n puts \"\"\n action = @product.persisted? ? 'Updating' : 'Creating'\n puts \"#{action} row #{i+2}: #{name}\"\n\n @reporter.processed_object_count += 1\n\n begin\n # First assign any default values for columns not included in parsed_file\n process_missing_columns_with_defaults\n\n # Iterate over the columns method_mapper found in Excel,\n # pulling data out of associated column\n @method_mapper.method_details.each_with_index do |method_detail, col|\n value = row[col]\n process(method_detail, value)\n end\n\n rescue => e\n failure( row, true )\n logger.error \"Failed to process row [#{i}] (#{@current_row})\"\n\n if verbose\n puts \"Failed to process row [#{i}] (#{@current_row})\"\n puts e.inspect\n end\n\n # don't forget to reset the load object\n new_product\n next\n end\n\n unless save_object(@product)\n failure\n puts \"Failed to save row [#{i}]\"\n puts @product.errors.inspect if(@product)\n else\n puts \"Row #{@current_row} succesfully SAVED : ID #{@product.id}\"\n @reporter.add_loaded_object(@product)\n end\n\n # don't forget to reset the object or we'll update rather than create\n new_product\n\n end\n\n raise ActiveRecord::Rollback if(options[:dummy]) # Don't actually create/upload to DB if we are doing dummy run\n end\n rescue => e\n puts \"CAUGHT \", e.backtrace, e.inspect\n if e.is_a?(ActiveRecord::Rollback) && options[:dummy]\n puts \"CSV loading stage complete - Dummy run so Rolling Back.\"\n else\n raise e\n end\n ensure\n report\n end\n end", "def open_csv(table)\n command = \"mdb-export -bstrip -D '%F %T' -d #{Shellwords.escape(delimiter)} #{file_name} #{table}\"\n Open3.popen3(command) do |stdin, stdout, stderr|\n yield CSV.new(stdout, col_sep: delimiter)\n end\n end", "def initialize(csv_in_filename)\n @in_file = csv_in_filename\n @csv_out_headers = nil\n @index = nil\n @csv_out_data = nil\n convert\n end", "def shift\n #########################################################################\n ### This method is purposefully kept a bit long as simple conditional ###\n ### checks are faster than numerous (expensive) method calls. ###\n #########################################################################\n\n # handle headers not based on document content\n if header_row? and @return_headers and\n [Array, String].include? @use_headers.class\n if @unconverted_fields\n return add_unconverted_fields(parse_headers, Array.new)\n else\n return parse_headers\n end\n end\n\n #\n # it can take multiple calls to <tt>@io.gets()</tt> to get a full line,\n # because of \\r and/or \\n characters embedded in quoted fields\n #\n in_extended_col = false\n csv = Array.new\n\n loop do\n # add another read to the line\n unless parse = @io.gets(@row_sep)\n return nil\n end\n\n if in_extended_col\n @line.concat(parse)\n else\n @line = parse.clone\n end\n\n begin\n parse.sub!(@parsers[:line_end], \"\")\n rescue ArgumentError\n unless parse.valid_encoding?\n message = \"Invalid byte sequence in #{parse.encoding}\"\n raise MalformedCSVError.new(message, lineno + 1)\n end\n raise\n end\n\n if csv.empty?\n #\n # I believe a blank line should be an <tt>Array.new</tt>, not Ruby 1.8\n # HBCSV's <tt>[nil]</tt>\n #\n if parse.empty?\n @lineno += 1\n if @skip_blanks\n next\n elsif @unconverted_fields\n return add_unconverted_fields(Array.new, Array.new)\n elsif @use_headers\n return self.class::Row.new(@headers, Array.new)\n else\n return Array.new\n end\n end\n end\n\n next if @skip_lines and @skip_lines.match parse\n\n parts = parse.split(@col_sep_split_separator, -1)\n if parts.empty?\n if in_extended_col\n csv[-1] << @col_sep # will be replaced with a @row_sep after the parts.each loop\n else\n csv << nil\n end\n end\n\n # This loop is the hot path of csv parsing. Some things may be non-dry\n # for a reason. Make sure to benchmark when refactoring.\n parts.each do |part|\n if in_extended_col\n # If we are continuing a previous column\n if part.end_with?(@quote_char) && part.count(@quote_char) % 2 != 0\n # extended column ends\n csv.last << part[0..-2]\n if csv.last.match?(@parsers[:stray_quote])\n raise MalformedCSVError.new(\"Missing or stray quote\",\n lineno + 1)\n end\n csv.last.gsub!(@double_quote_char, @quote_char)\n in_extended_col = false\n else\n csv.last << part << @col_sep\n end\n elsif part.start_with?(@quote_char)\n # If we are starting a new quoted column\n if part.count(@quote_char) % 2 != 0\n # start an extended column\n csv << (part[1..-1] << @col_sep)\n in_extended_col = true\n elsif part.end_with?(@quote_char)\n # regular quoted column\n csv << part[1..-2]\n if csv.last.match?(@parsers[:stray_quote])\n raise MalformedCSVError.new(\"Missing or stray quote\",\n lineno + 1)\n end\n csv.last.gsub!(@double_quote_char, @quote_char)\n elsif @liberal_parsing\n csv << part\n else\n raise MalformedCSVError.new(\"Missing or stray quote\",\n lineno + 1)\n end\n elsif part.match?(@parsers[:quote_or_nl])\n # Unquoted field with bad characters.\n if part.match?(@parsers[:nl_or_lf])\n message = \"Unquoted fields do not allow \\\\r or \\\\n\"\n raise MalformedCSVError.new(message, lineno + 1)\n else\n if @liberal_parsing\n csv << part\n else\n raise MalformedCSVError.new(\"Illegal quoting\", lineno + 1)\n end\n end\n else\n # Regular ole unquoted field.\n csv << (part.empty? ? nil : part)\n end\n end\n\n # Replace tacked on @col_sep with @row_sep if we are still in an extended\n # column.\n csv[-1][-1] = @row_sep if in_extended_col\n\n if in_extended_col\n # if we're at eof?(), a quoted field wasn't closed...\n if @io.eof?\n raise MalformedCSVError.new(\"Unclosed quoted field\",\n lineno + 1)\n elsif @field_size_limit and csv.last.size >= @field_size_limit\n raise MalformedCSVError.new(\"Field size exceeded\",\n lineno + 1)\n end\n # otherwise, we need to loop and pull some more data to complete the row\n else\n @lineno += 1\n\n # save fields unconverted fields, if needed...\n unconverted = csv.dup if @unconverted_fields\n\n if @use_headers\n # parse out header rows and handle HBCSV::Row conversions...\n csv = parse_headers(csv)\n else\n # convert fields, if needed...\n csv = convert_fields(csv)\n end\n\n # inject unconverted fields and accessor, if requested...\n if @unconverted_fields and not csv.respond_to? :unconverted_fields\n add_unconverted_fields(csv, unconverted)\n end\n\n # return the results\n break csv\n end\n end\n end", "def csvReader(file, headers)\n begin\n csvTable = CSV.read(file, {col_sep:\"\\t\", quote_char:\"\\0\", headers:headers})\n rescue ArgumentError\n puts \"Error: Unsupported encoding, tabulated/CSV file must be in UTF-8 format.\"\n abort\n end\n parsedObj = OpenStruct.new()\n parsedObj.rowArray = []\n parsedObj.belArray = []\n csvTable.each do |row|\n unless row.length == 0\n current = OpenStruct.new()\n current.bel_id = row[0]\n current.bel_id.slice! \"BEL:\"\n current.bel = row[1]\n current.sentence = row[2]\n current.sentence_id = row[3]\n current.sentence_id.slice! \"SEN:\"\n current.pmid = row[4]\n parsedObj.rowArray << current\n parsedObj.belArray << row[1]\n end\n end\n parsedObj.linecount = csvTable.length\n return parsedObj\nend", "def csv_data\n @csv_data ||= compute_csv_data\n end", "def csv(handle, path = nil)\n @dsd = DataSourceDownload.get(handle)\n raise \"handle '#{handle}' does not exist\" if @dsd.nil? and handle != \"manual\"\n path = (handle == \"manual\") ? DataSourceDownload.flex(path) : @dsd.save_path_flex \n @handle = handle\n @csv ||= {}\n if @csv[path].nil? \n download_handle unless @dsd.nil?\n #puts path\n begin\n @csv[path] = CSV.read(path)\n @new_data = true\n rescue\n #resolve one ugly known file formatting problem with faster csv\n alternate_csv_load = alternate_fastercsv_read(path) #rescue condition if this fails\n #return \"READ_ERROR:CSV FORMAT OR FILE PROBLEM\" if alternate_csv_load.nil? \n @csv[path] = alternate_csv_load\n @new_data = true\n end\n end\n @csv[path]\n end", "def parse_csv(path)\n require 'csv'\n\n str = Nitro::Template.new.render(File.read(path))\n\n reader = CSV::Reader.create(str)\n header = reader.shift\n\n reader.each_with_index do |row, i|\n data = {}\n row.each_with_index do |cell, j|\n data[header[j].to_s.strip] = cell.to_s.strip\n end\n self[\"#{@name}_#{i+1}\"] = obj = instantiate(data)\n @objects << obj\n end\n end", "def convert_csv(original_csv)\n csv_options = {}\n csv_options[:col_sep] = option(:csv_col_sep) unless option(:csv_col_sep).blank?\n csv_options[:row_sep] = option(:csv_row_sep) unless option(:csv_row_sep).blank?\n csv_options[:quote_char] = option(:csv_quote_char) unless option(:csv_quote_char).blank?\n value_converter = option(:csv_value_proc)\n\n converted_csv = \"#{original_csv}.converting\"\n CSV.open(converted_csv, 'wb', csv_options) do |csv|\n CSV.foreach(original_csv) do |row|\n row = row.map{ |value| value.blank? ? '' : value_converter.call(value) } if value_converter\n csv << row\n end\n end\n FileUtils.remove(original_csv)\n FileUtils.move(converted_csv, original_csv)\n end", "def write_row(storage_path, csv_record)\n CSV.open(storage_path, 'ab') do |csv|\n csv << csv_record.values\n end\n end", "def parse_csv\n raise InvalidStateError, \"#{state.inspect} is not a valid Data state for method 'to_csv'\" unless state == :raw\n\n file_options = @options[:file_options]\n parse_options = @options[:parse_options]\n\n begin\n csv = CSVWrapper.parse(@content, parse_options)\n csv = csv.drop(1) if file_options[:has_headers] == true # drop the first row if it is a header\n rescue => e\n Logger.new(@options).print(@path, :parse, e)\n end\n\n @state = :parsed\n Data.new(@path, csv, @state, @options)\n end", "def call\n call!\n rescue CSVConverter::Error\n nullable_object\n end", "def csv_write filename , *field\n CSV.open(filename, \"a\") do |csv|\n csv << field\n end\nend", "def csv_download\n filename = sprintf(\"%s-%s.csv\",\n model_name,\n Time.now.strftime(\"%Y%m%d-%H%M%S\"))\n file = Tempfile.new(filename, Settings.edgarj.csv_dir)\n csv_visitor = EdgarjHelper::CsvVisitor.new(view_context)\n file.write CSV.generate_line(model.columns.map{|c| c.name})\n for rec in user_scoped.where(page_info.record.conditions).\n order(\n page_info.order_by.blank? ?\n nil :\n page_info.order_by + ' ' + page_info.dir) do\n array = []\n for col in model.columns do\n array << csv_visitor.visit_column(rec, col)\n end\n file.write CSV.generate_line(array)\n end\n file.close \n File.chmod(Settings.edgarj.csv_permission, file.path)\n send_file(file.path, {\n type: 'text/csv',\n filename: filename})\n #file.close(true)\n end", "def strip_csv_quotes(src_path, dest_path)\n\n require 'csv'\n open('LoginHistory-comma-delim.csv', 'w') do |f|\n first_line = true\n CSV.foreach('LoginHistory.csv') do |row|\n if first_line\n first_line = false\n else\n f.puts( row.join(',') )\n end\n \n end\n end\n\nend", "def write_row(row)\n @csv << row\n\n self\n end", "def convert_csv(path, table_name)\n \n # csv file has a header row\n header_row = true\n\n # delimiter for csv file\n delimiter = ','\n\n # variable used to skip header row\n skip_row = true\n\n\n CSV.open(path, 'r', delimiter ) do |row|\n\n row.each_with_index do |col,index|\n if col==nil then \n row[index]='NULL'\n else\n \n col.gsub!(\"'\",\"`\")\n row[index] = \"'#{ col }'\"\n end\n end\n\n # Are we reading the header row of the csv file?\n if header_row\n row.each_with_index do |col,index|\n row[index] = \"\\\"#{ col.gsub(\"'\",'').gsub(/\\s+/,'') }\\\"\"\n end\n header_row = false\n print \"INSERT INTO #{table_name} (#{row.join delimiter }) VALUES\"\n next\n end\n\n # Only skip the first (header) row\n if skip_row == true\n # dont skip further rows\n skip_row = false\n else\n # Print end of line insert delimeter\n puts delimiter\n end\n \n # Print to stdout\n print \"(#{row.join delimiter})\"\n \n end\nend", "def rewind(f)\n #the seek method of classIO, moves the file pointer(indicates current location\n # of file) to a given integer distance(first parameter), since the interger\n #distance is 0, this method moves the file pointer to beginning of file\n f.seek(0)\nend", "def update_current_file_and_current_id\n if @data_file[@current_id] && has_id_col? && @current_id != line_id\n @data_file[current_pid].close\n end\n\n @current_id = line_id\n\n if @data_file[@current_id] && @data_file[@current_id].closed?\n @data_file[@current_id].reopen(@data_file[@current_id].path, \"a\")\n elsif @current_id and @data_file[@current_id].nil? and not date.nil?\n set_datestamp\n # TODO: Make this configurable ---v\n filename = \"#{@match_buffer[\"_datestamp\"]}_#{@current_id}.data\"\n filename = File.join @options[:output_dir], filename\n\n puts \"creating new file: #{filename}\" if true || @options[:verbose]\n @data_file[@current_id] = File.open(filename, :mode => \"w\")\n end\n end", "def prepare_data\n data = CSV.read('input.csv', { col_sep: SEPARATOR })\n\n CSV.open('output.csv','wb') do |csv|\n data.each do |row|\n csv << prepare_row(row)\n end\n end\n\n rescue Errno::ENOENT\n puts 'No valid input.csv file present'\n end", "def update_meal_to_csv\n CSV.open(@csv_file, \"w\") do |csv|\n csv << [\"id\", \"name\", \"price\"]\n @meals.each do |meal|\n csv << [meal.id, meal.name, meal.price]\n end\n end\n end", "def csv_import\n #n = 0\n CSV.foreach(params[:dump][:file].tempfile,:col_sep => ';', :encoding => 'ISO-8859-1') do |row|\n c = Ticket.new( :ano => row[0],\n :mes => row[1],\n :processo_numero => row[2],\n :solicitacao_data => row[3],\n :solicitacao_hora => row[4],\n :solicitacao_descricao => row[5],\n :solicitacao_regional => row[6],\n :solicitacao_bairro => row[7],\n :solicitacao_localidade => row[8],\n :solicitacao_endereco => row[9],\n :solicitacao_roteiro => row[10],\n :rpa_codigo => row[11],\n :rpa_nome => row[12],\n :solicitacao_microrregiao => row[13],\n :solicitacao_plantao => row[14],\n :solicitacao_origem_chamado => row[15],\n :latitude => row[16],\n :longitude => row[17],\n :solicitacao_vitimas => row[18],\n :solicitacao_vitimas_fatais => row[19],\n :processo_tipo => row[20],\n :processo_origem => row[21],\n :processo_localizacao => row[22],\n :processo_status => row[23],\n :processo_data_conclusao => row[24])\n c.save\n end\n redirect_to :action => \"index\" and return\n end", "def clean_n_conv csvfile\r\n puts \"Cleaning '\" + csvfile + \"'...\"\r\n tmpfile = csvfile + \".tmp\"\r\n FileUtils.move csvfile, tmpfile\r\n\t\r\n CSV.open(csvfile.downcase,'w',';') do |csv|\r\n CSV.open(tmpfile,'r',';') do |row|\r\n date = row[0]\r\n if /(\\d{2}[\\/-]){2}\\d{4}/.match date\r\n # an alternative format was used by tts in the glostrup files \r\n # for dates - switch day and month\r\n date[0..1],date[3..4] = date[3..4],date[0..1]\r\n date.gsub! '/','-'\r\n end\r\n csv << [date] + row[1..-1]\r\n end\t\r\n end\r\n FileUtils.remove tmpfile\r\nend", "def to_csv_by_copy(filename=nil, &block)\n self.class.csv_from_iterator(each_copy, filename, &block)\n end", "def update_io\n io = create_tempfile\n rewind\n @io = (io << @io.read; io)\n __setobj__(@io)\n @in_memory = false\n nil\n end", "def import\n CSV.foreach(@file.path, :converters => :all, :return_headers => false, :headers => :first_row) do |row|\n campaign_id, source, tag, created_at, first_name, last_name,\n email, phone, company, title, status, background_info, comments,\n street1, street2, city, state, zip, country = *row.to_hash.values\n\n #TODO: implement smarter_csv and/or resque\n # https://github.com/tilo/smarter_csv\n # https://github.com/resque/resque\n\n # Rails.logger.info \"XXXXXXXX created_at#{created_at}\"\n\n if @make_contact\n # Don't Allow Duplicates\n contact = Contact.find_or_initialize_by_first_name_and_last_name_and_email(\n first_name,\n last_name,\n email\n ).tap do |contact|\n contact.user_id = @assigned.id,\n contact.source = source,\n contact.first_name = first_name,\n contact.last_name = last_name,\n contact.email = email,\n contact.phone = phone,\n # contact.company = company,\n contact.title = title,\n # contact.status = status,\n contact.background_info = process_bg_info(contact.background_info, background_info),\n contact.created_at = created_at.to_time rescue Time.current\n end\n contact.save!\n\n contact.first_name = \"INCOMPLETE\" if contact.first_name.blank?\n contact.last_name = \"INCOMPLETE\" if contact.last_name.blank?\n # contact.access? = \"Private | Public\"\n contact.access = Setting.default_access\n contact.assignee = @assigned if @assigned.present?\n contact.tag_list.add(tag)\n contact.add_comment_by_user(comments, @assigned)\n\n contact.save!\n\n #TODO: Better validation on address fields.\n if zip\n contact.business_address = Address.new(:street1 => street1, :street2 => street2, :city => city, :state => state, :zipcode => zip, :country => country, :address_type => \"Business\")\n else\n puts \"INCOMPLETE ADDRESS\"\n end\n contact.save!\n\n #\n if contact.account_contact.nil?\n\n if company\n account_name = company\n else\n account_name = contact.first_name + ' ' + contact.last_name + ' (Individual)'\n end\n\n #TODO: rails 4 Account.find_or_initialize_by(name: account_name)\n account = Account.find_or_initialize_by_name(account_name).tap do |account|\n account.user_id = @assigned.id\n account.assignee = @assigned if @assigned.present?\n account.access = contact.access\n account.category = 'customer'\n end\n account.save!\n\n contact.account_contact = AccountContact.new(:account => account, :contact => contact)\n\n # Rails.logger.info \"XXXXXXXX ACCOUNT CONTACT CREATED! #{contact.account_contact.inspect}\"\n\n # contact_account = { account: { id: account.id }, access: contact.access }\n # @account, @opportunity, @contact = contact.promote(contact_account)\n # contact = Contact.find(@contact)\n end\n\n # Rails.logger.info \"XXXXXXXX CONTACT CREATED! #{contact.inspect}\"\n\n else\n\n # Allow Duplicates\n # lead = Lead.new(\n # :user_id => @assigned.id,\n # :campaign_id => campaign_id.to_i,\n # :source => source,\n # :first_name => first_name,\n # :last_name => last_name,\n # :email => email,\n # :phone => phone,\n # :company => company,\n # :title => title, :status => status,\n # :background_info => background_info,\n # :created_at => created_at.to_time\n # )\n\n\n #TODO: rails 4 Lead.find_or_initialize_by(email: email) without tap\n # Don't Allow Duplicates\n lead = Lead.find_or_initialize_by_first_name_and_last_name_and_email(\n first_name,\n last_name,\n email\n ).tap do |lead|\n lead.user_id = @assigned.id,\n lead.campaign_id = campaign_id.to_i,\n lead.source = source,\n lead.first_name = first_name,\n lead.last_name = last_name,\n lead.email = email,\n lead.phone = phone,\n lead.company = company,\n lead.title = title,\n lead.status = status,\n lead.background_info = process_bg_info(lead.background_info, background_info),\n lead.created_at = created_at.to_time rescue Time.current\n end\n lead.save!\n\n lead.first_name = \"INCOMPLETE\" if lead.first_name.blank?\n lead.last_name = \"INCOMPLETE\" if lead.last_name.blank?\n\n # lead.access? = \"Private | Public\"\n lead.access = Setting.default_access\n lead.assignee = @assigned if @assigned.present?\n lead.tag_list.add(tag)\n lead.add_comment_by_user(comments, @assigned)\n lead.save!\n\n #TODO: Better validation on address fields.\n if zip\n lead.business_address = Address.new(:street1 => street1, :street2 => street2, :city => city, :state => state, :zipcode => zip, :country => country, :address_type => \"Business\")\n else\n puts \"INCOMPLETE ADDRESS\"\n end\n lead.save!\n\n end\n end\n\n\n end", "def load\n csv = csv_data\n @data = TableFu.new(csv_data, @table_opts[:column_options] || {})\n if @table_opts[:faceting]\n @data.col_opts[:ignored] = [@table_opts[:faceting][:facet_by]]\n @facets = @data.faceted_by @table_opts[:faceting][:facet_by]\n end\n @data.delete_rows! @table_opts[:dead_rows] if @table_opts[:dead_rows]\n end", "def parse_csv(csv_file)\n\n # Loop through all entries in CSV file\n CSV.foreach(csv_file, :quote_char => \"\\\"\") do |row|\n next if row[0] == \"From\" && row[1] == \"To\"\n next if row[0].nil?\n\n # [0, 1] refers to the 2 addresses in the csv file\n [0, 1].each do |i|\n add_location(row[i])\n end\n\n add_journey(row)\n end\nend", "def open_data_for_read\n @data_file = CSV.open(data_file_full_path,\"r\", @data_lib.csv_opt)\n @data_stream = @data_file\n end", "def process\n validate_file_type(@file_name, 'csv')\n convert_csv_file_to_object\n end", "def load_csv(csv_file_or_object, table_name, log_name = nil)\n log_name ||= \"load_csv '#{csv_file_or_object.kind_of?(CSV::Table) ? 'CSV Object' : csv_file_or_object }', 'table_name'\"\n csv_object = case csv_file_or_object\n when String then Slacker.get_csv(csv_file_or_object)\n when CSV::Table then csv_file_or_object\n when Array then Slacker.hash_array_to_csv(csv_file_or_object)\n end\n\n Slacker.load_csv(example, csv_object, table_name, log_name)\n end", "def insert_from_line( line )\n begin\n row = line.chomp.parse_csv\n @cached << record( row )\n rescue\n print '#'\n end\n\n flush_inserts if @cached.size >= CACHE_SIZE\n end", "def generate_csv_file(file_path, row_data)\n CSV.open(file_path, \"wb\") do |csv|\n csv << [\"first_name\", \"last_name\", \"dob\", \"member_id\", \"effective_date\", \"expiry_date\", \"phone_number\"]\n row_data.each { |row| csv << row }\n end\nend", "def rewind(f)\n # sets the line counter to 0\n f.seek(0)\n # end of function block\nend", "def load_file full_name\n file = FasterCSV.open( full_name , { :col_sep => \"\\t\"} ) \n @header = file.shift\n @data = file.readlines\n #puts @header\n @header.each do |col|\n #puts \"col=#{col}= mapped to =#{@mapping[col]}=\"\n end\n index = 0\n while index < @data.length\n row = @data[index]\n #puts \"row is \" + row.join(\"--\")\n @mapping.each do |key,val|\n #puts \"Row:#{val} at #{@mapping.index(val)} is --#{@header.index(@mapping.index(val))}--value---\"\n #puts \"--#{at_in(val,row)}--\" if @header.index(@mapping.index(val))\n end\n prod = get_product(row)\n set_attributes_and_image( prod , row )\n set_taxon(prod , row)\n #puts \"saving -\" + prod.description + \"- at \" + at_in(:price,row) #if at_in(:price,row) == \"0\"\n prod.save!\n throw \"no master for #{prod.name}\" if prod.master == nil \n# pr = get_product( row )\n# puts \"TAXONs #{pr.taxons}\"\n \n puts \"saved -\" + prod.description + \"- at \" + at_in(:price,row) #if at_in(:price,row) == \"0\"\n index = slurp_variants(prod , index + 1) #read variants if there are, returning the last read line\n end\n\n end", "def delete(id)\n table = CSV.table(@csvfile)\n deleted_contact = table.delete(id - 1)\n\n File.open(@csvfile, 'w') do |f|\n f.write(table.to_csv)\n end\n Contact.new(id, deleted_contact[0], deleted_contact[1], deleted_contact[2])\n end", "def with_temp_file offset = 0\n temp_file = Tempfile.new 'picky'\n \n temp_path = temp_file.path\n `tail -n +#{offset} #{@path} > #{temp_path}`\n yield temp_path\n \n temp_file.delete\n end", "def create_file_from_parent(original_path, new_path, value_map)\n assert_non_linked_parent(new_path)\n\n new_path.unlink if new_path.exist?\n\n FileUtils.cp(original_path, new_path)\n\n file = Atlas::CSVDocument.read(new_path)\n\n value_map.each do |cell, value|\n file.set(cell.row, cell.column, value)\n end\n\n file.save!(follow_link: false)\n file.path.chmod(0o444)\n end", "def rewind(f)\n # the seek(procurar) method of classIO, moves the file pointer(indicates urrent location in the file)\n # to a given integer distance (the first parameter), since the integer distance is 0,\n # this method moves the file pointer to the beginning of the file\n f.seek(0)\nend", "def process_silently(csv_file)\n assert_output { process(csv_file) }\n end", "def parse_painter_csv_file\n csv_data = CSV.read(\"db/painter_seed_data.csv\")\n csv_data.shift\n # iterate over each element and send back a hash \n # need to shift again at the beginning to get rid of id on the row\n painter_object_array = []\n csv_data.each do |painter_row_arr|\n painter_row_arr.shift\n painter_object = {\n :name => painter_row_arr[0],\n :years => painter_row_arr[1],\n :genre => painter_row_arr[2],\n :nationality => painter_row_arr[3],\n :bio => painter_row_arr[4],\n :painting_num => painter_row_arr[6],\n :portrait => painter_row_arr[7]\n }\n painter_object_array.push(painter_object) \n end\n painter_object_array.flatten\nend", "def update(attr_hash)\n # Prevent update of id field\n attr_hash.reject! { |k, v| k == :id || k == \"id\" }\n csv_table = CSV.table(table_path, converters: CONVERTERS)\n old_row = csv_table.find { |row| row.field(:id) == id }\n new_row = CSV::Row.new(old_row.headers, old_row.fields)\n\n # Assign new values to the row by param name (which should be a field name)\n attr_hash.each { |k, v| new_row[k] = v }\n # Delete the old_row\n csv_table = CSV.table(table_path, converters: CONVERTERS)\n csv_table.delete_if do |row|\n row == old_row\n end\n csv_table << new_row\n # Write the csv_table to a file, replacing the original\n File.open(table_path, 'w') do |f| # w => write-only\n f.write(csv_table.to_csv)\n end\n # Note: AR returns true if successful, false if not.\n # If AR is successful, it updates the receiving instance's attributes.\n # This returns a new instance with the variables on success.\n new_row ? self.class.new(new_row.to_hash) : false\n end", "def <<(row)\n # make sure headers have been assigned\n if header_row? and [Array, String].include? @use_headers.class and !@write_headers\n parse_headers # won't read data for Array or String\n end\n\n # handle HBCSV::Row objects and Hashes\n row = case row\n when self.class::Row then row.fields\n when Hash then @headers.map { |header| row[header] }\n else row\n end\n\n @headers = row if header_row?\n @lineno += 1\n\n output = row.map(&@quote).join(@col_sep) + @row_sep # quote and separate\n if @io.is_a?(StringIO) and\n output.encoding != (encoding = raw_encoding)\n if @force_encoding\n output = output.encode(encoding)\n elsif (compatible_encoding = Encoding.compatible?(@io.string, output))\n @io.set_encoding(compatible_encoding)\n @io.seek(0, IO::SEEK_END)\n end\n end\n @io << output\n\n self # for chaining\n end", "def csv_row\n #empty by default\n []\n end", "def csv_row\n #empty by default\n []\n end", "def merge_csv(string, user)\n total = created = updated = undeleted = deleted = skipped = errors = 0\n messages = []\n string.force_encoding('UTF-8')\n logger.debug \"Contact@#{__LINE__}.merge_csv #{string.encoding.name}\" if logger.debug?\n logger.debug \"Contact@#{__LINE__}.merge_csv #{string.inspect}\" if logger.debug?\n parsed = CSV.parse(string, CSV_OPTIONS.merge(headers: true))\n total = parsed.size\n parsed.each do |csv_record|\n logger.debug \"Contact@#{__LINE__}.merge_csv #{csv_record.to_hash.inspect}\" if logger.debug?\n if (id = csv_record['id']).nil?\n record = new csv_record.to_hash, without_protection: true\n record.user_id = user.id\n record.save\n logger.debug \"Contact@#{__LINE__}.merge_csv #{record.inspect}\" if logger.debug?\n if record.valid?\n created += 1\n else\n errors += 1\n messages << [csv_record.to_csv(col_sep: \"\\t\"), record.errors.messages]\n end\n else\n record = with_deleted.find_by_user_id_and_id user, id\n if record.nil?\n skipped += 1\n else\n logger.debug \"Contact@#{__LINE__}.merge_csv #{record.inspect}\" if logger.debug?\n logger.debug \"Contact@#{__LINE__}.merge_csv #{csv_record['updated_at'].to_time.inspect} #{record.updated_at.inspect}\" if logger.debug?\n if csv_record['deleted_at'].present? and dlt = csv_record['deleted_at'].to_time and\n record.deleted_at.blank?\n if record.updated_at.to_s(:db).to_time > dlt\n skipped += 1\n else\n record.delete\n deleted += 1\n end\n elsif (upd = csv_record['updated_at'].to_time) >= record.updated_at.to_s(:db).to_time and\n (record.deleted_at.nil? or upd >= (dlt = record.deleted_at.to_s(:db).to_time))\n record.update_attributes csv_record.to_hash.merge(deleted_at: nil), without_protection: true\n if record.valid?\n updated += 1\n undeleted += 1 if dlt\n else\n errors += 1\n messages << [csv_record.to_csv(col_sep: \"\\t\"), record.errors.messages]\n end\n else\n skipped += 1\n end\n end\n end\n end\n {total: total, created: created, updated: updated, deleted: deleted, undeleted: undeleted, skipped: skipped, errors: errors, messages: messages}\n end", "def add_price(file_location, current_date, current_price)\n CSV.open(file_location, \"a\") do |f|\n f << [current_date, current_price]\n end\nend", "def csv_location\n return @@csv_location\n end", "def loadCSV\n csvFile = File.open(\"app/assets/csv/test.csv\", \"r\") #Open file with readpermissions\n if csvFile #if file was successfully opened \n csvRowArray = IO.readlines(csvFile) # Turn each row into an array element\n rowId=1 #0 is the Header Row, 1 is the first dataset.\n recordsArray = Array.new(csvRowArray.size-1)\n while csvRowArray[rowId] do #for each row that exists \n rowEntry = csvRowArray[rowId]\n rowEntry.gsub!(/\"/,'') # Remove all the '\"'s\n wordArr = rowEntry.split(\",\") #Split the array on ','s into a new array \n newRecord = Record.new\n newRecord.REF_DATE = wordArr[0]\n newRecord.GEO = wordArr[1]\n newRecord.DGUID = wordArr[2]\n newRecord.Sex = wordArr[3]\n newRecord.Age_group = wordArr[4]\n newRecord.Student_response = wordArr[5]\n newRecord.UOM = wordArr[6]\n newRecord.UOM_ID = wordArr[7]\n newRecord.SCALAR_FACTOR = wordArr[8]\n newRecord.SCALAR_ID = wordArr[9]\n newRecord.VECTOR = wordArr[10]\n newRecord.COORDINATE = wordArr[11]\n newRecord.VALUE = wordArr[12]\n newRecord.STATUS = wordArr[13]\n newRecord.SYMBOL = wordArr[14]\n newRecord.TERMINATED = wordArr[15]\n newRecord.DECIMALS = wordArr[16]\n newRecord.save\n puts rowId\n rowId = rowId+1 \n end\n return recordsArray\n else #file not opened\n puts \"Unable to open file\" \n return \n end \n end", "def csv\n require 'csv'\n\n unless params[:uploaded_csv].blank?\n csv_path = params[:uploaded_csv].path\n\n # Wipe database on csv load, will need to be modified when event RSS feeds are fixed\n data_validated = false\n begin\n CSV.foreach(csv_path, :headers => true) do |row|\n csv_building = row[1]\n csv_room_number = row[3]\n csv_room_name = row[4]\n csv_department = row[7]\n csv_person_name = row[9] #can be general purpose name like 'general graduate student'\n csv_last_name, csv_first_name = csv_person_name.split(',').map(&:strip)\n\n csv_person_department = row[11] # appears to be less relevant to our needs\n csv_organization = row[12]\n csv_org_code, csv_person_organization = csv_organization.split(' ', 2) # Use this for department\n csv_phone = row[13]\n csv_email = row[14]\n\n # Destroy data only if the first row was parsed successfully\n unless data_validated\n Rails.logger.debug \"[[[[[[ Data validated, wiping db!!! ]]]]]]\"\n Person.destroy_all\n Department.destroy_all\n DirectoryObject.where(type: \"Room\").delete_all\n data_validated = true\n end\n\n # Don't bother with this row if a room number doesn't exist\n if csv_room_number != \"\"\n # Parse Rooms\n results = Room.where(room_number: csv_room_number)\n # Found new room?\n if results.empty?\n room = Room.new\n room.room_number = csv_room_number\n room.save\n else\n room = results.first\n end\n\n # Ensure custom data has not already been set\n # if room.name.blank?\n # room.name = csv_room_name\n # room.save\n # end\n # Parse Department\n # Don't bother with department/person parsing, something is wrong with this row\n unless csv_organization.include?(\"Identity Purged\")\n department = nil\n results = Department.where(title: csv_person_organization.downcase).first\n if results.blank?\n department = Department.new\n if csv_person_organization.present?\n department.title = (csv_person_organization).downcase\n department.save\n else\n logger.info \"entry was missing an organization\"\n end\n else\n department = results\n end\n\n # Parsing Person\n results = Person.where(email: csv_email)\n\n # Found new person?\n if results.empty?\n person = Person.new\n\n # Found existing person?\n else\n person = results.first\n end\n # Ensure room is associated\n if room.present?\n if not person.rooms.include?(room)\n person.rooms << room\n end\n end\n # Ensure department is associated\n # Currently assumes each person has one department, seems to be the case from the data\n if person.department.blank?\n if department.present?\n person.department = department\n end\n end\n person.email = csv_email\n person.phone = csv_phone\n person.first = csv_first_name\n person.last = csv_last_name\n person.save\n end\n end\n end\n\n notice = \"CSV was successfully parsed\"\n rescue\n error = \"CSV file contains invalid data\"\n end\n else\n error = \"Error uploading file\"\n end # unless csv_path.blank?\n\n respond_to do |format|\n format.html {\n redirect_to action: \"index\",\n error: error,\n notice: notice\n }\n end\n end", "def csv\n require 'csv'\n\n unless params[:uploaded_csv].blank?\n csv_path = params[:uploaded_csv].path\n\n # Wipe database on csv load, will need to be modified when event RSS feeds are fixed\n data_validated = false\n begin\n CSV.foreach(csv_path, :headers => true) do |row|\n csv_building = row[1]\n csv_room_number = row[3]\n csv_room_name = row[4]\n csv_department = row[7]\n csv_person_name = row[9] #can be general purpose name like 'general graduate student'\n csv_last_name, csv_first_name = csv_person_name.split(',').map(&:strip)\n\n csv_person_department = row[11] # appears to be less relevant to our needs\n csv_organization = row[12]\n csv_org_code, csv_person_organization = csv_organization.split(' ', 2) # Use this for department\n csv_phone = row[13]\n csv_email = row[14]\n\n # Destroy data only if the first row was parsed successfully\n unless data_validated\n Rails.logger.debug \"[[[[[[ Data validated, wiping db!!! ]]]]]]\"\n Person.destroy_all\n Department.destroy_all\n DirectoryObject.where(type: \"Room\").delete_all\n data_validated = true\n end\n\n # Don't bother with this row if a room number doesn't exist\n if csv_room_number != \"\"\n # Parse Rooms\n results = Room.where(room_number: csv_room_number)\n # Found new room?\n if results.empty?\n room = Room.new\n room.room_number = csv_room_number\n room.save\n else\n room = results.first\n end\n\n # Ensure custom data has not already been set\n # if room.name.blank?\n # room.name = csv_room_name\n # room.save\n # end\n # Parse Department\n # Don't bother with department/person parsing, something is wrong with this row\n unless csv_organization.include?(\"Identity Purged\")\n department = nil\n results = Department.where(title: csv_person_organization.downcase).first\n if results.blank?\n department = Department.new\n if csv_person_organization.present?\n department.title = (csv_person_organization).downcase\n department.save\n else\n logger.info \"entry was missing an organization\"\n end\n else\n department = results\n end\n\n # Parsing Person\n results = Person.where(email: csv_email)\n\n # Found new person?\n if results.empty?\n person = Person.new\n\n # Found existing person?\n else\n person = results.first\n end\n # Ensure room is associated\n if room.present?\n if not person.rooms.include?(room)\n person.rooms << room\n end\n end\n # Ensure department is associated\n # Currently assumes each person has one department, seems to be the case from the data\n if person.department.blank?\n if department.present?\n person.department = department\n end\n end\n person.email = csv_email\n person.phone = csv_phone\n person.first = csv_first_name\n person.last = csv_last_name\n person.save\n end\n end\n end\n\n notice = \"CSV was successfully parsed\"\n rescue\n error = \"CSV file contains invalid data\"\n end\n else\n error = \"Error uploading file\"\n end # unless csv_path.blank?\n\n respond_to do |format|\n format.html {\n redirect_to action: \"index\",\n error: error,\n notice: notice\n }\n end\n end", "def build_new_file(old_file_path:)\n headers = CSV.read(old_file_path, 'r').first\n\n CSV.open(ORIGINAL_FULL_PATH, 'w') do |csv|\n csv << headers\n CSV.foreach(old_file_path, headers: true).with_index(0) do |row, i|\n row['ScheduledTime'] = i.hour.from_now.strftime('%s')\n csv << row\n end\n end\n end", "def delete_students\n CSV.open(\"students.csv\", \"w\") do |csv|\n @students.clear\n end\nend", "def rewind\n @sio_pos = 0\n @_st_lineNumber = 0\n end", "def datat_read\n \n #Read in the csv file\n @@datat_array = CSV.read(@@datat_path_specific)\n \n #Delete the row which contains the database title.\n @@datat_array.delete_at(0)\n \n ######################################\n #puts @@datat_array[2]\n #Verify the conversion has taken place\n #puts @database + \" CSV file converted\"\n ######################################\n \n end", "def import_csv_new(csv_params:, \n table_name:, \n table_cols:)\n # using table name temp load the intial csv\n # and then updating the results back in.\n table_name_temp = table_name.to_s + \"_clone\"\n \n # 1. clone and load\n ###################\n self.clone_and_load(csv_params: csv_params, \n table_name: table_name, \n table_cols: table_cols)\n \n # 2. compare clone and orig table.\n ##################################\n \n # 3. \n \n return false\n end" ]
[ "0.62514263", "0.595696", "0.59525615", "0.5834525", "0.57536733", "0.57121974", "0.56688195", "0.5663128", "0.56610054", "0.563775", "0.560497", "0.5586076", "0.5565136", "0.5549006", "0.55057526", "0.5481447", "0.5468956", "0.54536104", "0.5451894", "0.5418598", "0.53747916", "0.53540224", "0.53503644", "0.53386974", "0.5316519", "0.53066635", "0.5301823", "0.5294249", "0.5283897", "0.5243618", "0.52228045", "0.52081394", "0.52080345", "0.52019155", "0.51998466", "0.5190767", "0.51660717", "0.51445985", "0.51406306", "0.5133548", "0.51308167", "0.5127282", "0.51124716", "0.50999033", "0.5092543", "0.5070691", "0.5060638", "0.5034675", "0.5028103", "0.50236505", "0.5020955", "0.49941733", "0.49776196", "0.49732083", "0.4969936", "0.49672246", "0.49570864", "0.4955993", "0.49532843", "0.49510834", "0.49493068", "0.49452326", "0.49451306", "0.49387184", "0.49336565", "0.49311528", "0.49295235", "0.4918453", "0.49134964", "0.49109066", "0.49100602", "0.4900502", "0.49000764", "0.48939073", "0.48878723", "0.48862043", "0.4874738", "0.48721096", "0.48644876", "0.48468217", "0.48421812", "0.4841067", "0.48262277", "0.4819516", "0.48146293", "0.48109558", "0.4809595", "0.47987103", "0.47926012", "0.47926012", "0.47924882", "0.4785568", "0.4785037", "0.47815037", "0.47808045", "0.47808045", "0.4776257", "0.47745365", "0.4769275", "0.47690547", "0.4766296" ]
0.0
-1
Complete each step below according to the challenge directions and include it in this file. Also make sure everything that isn't code is commented in the file. I worked on this challenge [by myself]. 1. Pseudocode What is the input? the input is an array What is the output? (i.e. What should the code return?) the output is the sum of the array for the first method, and a sentence with all strings in the array for the second method What are the steps needed to solve the problem? Create one method that calculates the sum of an array and one method that creates a sentence from an array. The sum method should use a single block to calculate The sentence method will loop through each word in the array and add it onto the sentence. 2. Initial Solution total method
def total(array) return array.inject { |sum, x| sum + x } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sentence_maker(array)\n\tx = 0\n\tsum = \"\"\n\twhile x <= array.length-1\n\t\tif x == array.length-1\n\t\t\tsum += array[x].to_s\n\t\t\tx += 1\n\t\telse \n\t\t\tsum += array[x].to_s + \" \"\n\t\t\tx += 1\n\t\tend\t\n\tend\n\tsum += \".\"\n\tsum.capitalize!\n\treturn sum\nend", "def sentence_maker(array)\n\tx = 0\n\tsum = \"\"\n\n\t\twhile x < (array.length - 1)\n\t\t\tsum += array[x].concat \" \" \n\t\t\tx += 1\n\t\tend \n\t\t\tsum += array[x].concat \".\" \n\treturn sum\n\nend", "def sentence_maker(array)\n x = 0\n sum = \"\"\n while x <= array.length-1\n sum += array[x].to_s + \" \"\n x += 1\n end\n sum.rstrip!\n sum += \".\"\n sum.capitalize!\n return sum\nend", "def sentence_maker(array)\n\tlength = array.length\n\tsum = array[0].to_s.capitalize!\n\tfor i in 1...length\n\t\tsum = sum + \" \" + array[i].to_s\n\tend\n \tsum + \".\"\nend", "def sentence_maker(array)\n str_array = array.collect{|i| i.to_s} #collect method returns entire array or hash; we are converting all elements of array into string\n sentence = array[0] #converts first element of array into new array\n sentence[0] = str_array[0][0].upcase #makes first letter uppercase\n str_array.shift\n\tstr_array.each { |i| sentence = sentence + \" \" + i.to_s}\n\treturn sentence + \".\"\nend", "def sentence_maker(array)\n sentence = \"\"\n array.each do |x|\n sentence = sentence + x.to_s + \" \"\n end\n\n sentence[0] = sentence[0].upcase\n sentence = sentence.rstrip\n sentence = sentence + \".\"\n return sentence\n\nend", "def sentence_maker(arraystring)\n fullsentence = ''\n length_of_arraystring = arraystring.length\n current_index_of_array = 0\n while current_index_of_array < length_of_arraystring\n if current_index_of_array == 0\n word = arraystring[current_index_of_array].to_s.capitalize\n fullsentence = fullsentence + word + ' '\n\n elsif current_index_of_array == length_of_arraystring - 1\n word = arraystring[current_index_of_array].to_s\n fullsentence = fullsentence + word + '.'\n else\n word = arraystring[current_index_of_array].to_s\n fullsentence = fullsentence + word + ' '\n end\n current_index_of_array = current_index_of_array + 1\n\n end\n# puts fullsentence\n return fullsentence\nend", "def sentence_maker(array_of_strings)\n\t# Declare new sentence variable and set to \"\"\n\tsentence = \"\"\n\t# Capitalize first word in array\n\tarray_of_strings[0].to_s.capitalize!\n\t# For each member of array_of_strings, add to the sentence variable (converting to string)\n\tfor num in 0..(array_of_strings.length - 1)\n\t\t\tsentence += array_of_strings[num].to_s\n\t\t# unless the member of the array is the last member of array_of_strings_, add a space after the word\n\t\tunless num == (array_of_strings.length - 1)\n\t\t\tsentence += \" \"\n\t\tend\n\tend\n\t# End the sentence variable with a period\n\tsentence += \".\"\n\t# Return the sentence variable\n\treturn sentence\nend", "def sentence_maker(word_array)\n sentence = word_array.inject(\" \"){|words,element| words += element.to_s + \" \"}\n sentence.strip!.capitalize!\n sentence << \".\"\nend", "def sentence_maker(array)\n combination = \"\"\n array[0].capitalize!\n array.each {|x| combination = combination + x.to_s + \" \"}\n combination.rstrip!\n combination = combination + \".\"\n return combination\nend", "def sentence_maker(word_array)\n sentence = word_array.inject(\" \"){|words,element| words+=element.to_s+\" \"}\n sentence.strip!.capitalize!\n sentence << \".\"\nend", "def sentence_maker ( strArray )\r\n\r\n\tanswer = ''\r\n\r\n\tstrArray.each do |thisStr|\r\n\t\tanswer += thisStr.to_s + ' '\r\n\tend\r\n\r\n\tanswer.slice!(answer.length-1)\r\n\r\n\tanswer += '.'\r\n\r\n\treturn answer.capitalize!\r\n\r\nend", "def sentence_maker(arr)\n output = \"\"\n arr.each do |word|\n output += (word.to_s + \" \")\n end\n output.capitalize.strip + \".\" \nend", "def sentence_maker(arr)\n output = \"\"\n arr.each do |word|\n output += (word.to_s + \" \")\n end\n output.capitalize.strip + \".\" \nend", "def sentence_maker(arr)\n output = \"\"\n arr.each do |word|\n output += (word.to_s + \" \")\n end\n output.capitalize.strip + \".\" \nend", "def sum\n local_array = multiply_word_with_letter_multiplier\n local_array.inject(:+)\n end", "def sentence_maker(array)\n\tanswer=\"\"\n\tarray[0]=array[0].capitalize\n\tarray.each do |x|\n\t\tx=x.to_s\n\t\tanswer+=x+\" \"\n\tend\t\n\tanswer=answer.chop+\".\"\n\treturn answer\nend", "def sentence_maker(array)\n combination = \"\"\n array.each {|x| combination = combination + x.to_s + \" \"}\n return combination.capitalize.chop + \".\"\nend", "def sentence_maker(array)\n sentence = array[0].capitalize\n for w in 1...array.length\n sentence = sentence + \" \" + array[w].to_s\n end\n return sentence + \".\"\nend", "def sentence_maker(string_array)\nnew_string = \"\"\nnew_array = []\n\nstring_array.each do |string|\n if string != string_array[-1]\n new_string += string.to_s + \" \"\n else\n new_string += string.to_s\n end\n \n new_array.push(new_string)\nend\nreturn new_array[-1].capitalize + \".\"\nend", "def sentence_maker(arr)\n string = \"\"\n i = 1\n while i < arr.length-1\n string += arr[i].to_s + ' '\n i+=1\n end\n sentence = arr[0].capitalize! + \" \" + string + arr[-1] + \".\"\n return sentence\nend", "def sentence_maker(array)\n\ti = 0\n\twhile i < array.length do\n\t\tif i == 0\n\t\t\tsentence = (array[i].capitalize.to_s + \" \")\n\t\telsif i == array.length-1\n\t\t\tsentence = sentence + (array[i].to_s + \".\") \n\t\telse\n\t\t\tsentence = sentence + (array[i].to_s + \" \")\n\t\tend\n\t\ti += 1\n\tend\n\treturn sentence\nend", "def make_sentence(array) \n\tsentence = \"\"\n\tarray.each do |mini_arrays|\n mini_arrays.each do |element|\n sentence << \"a#{element}a \"\n end\n end \n \n\tsentence\n end", "def sentence_maker(s_array)\n\n if s_array.empty? == true\n\n puts \"Array is empty add some values\"\n\n else\n\n p s_array.join(' ').capitalize + '.'\n\n end\nend", "def sentence_maker(array)\n\tsentence = array[0].capitalize.to_s\n\ti = 1\n\twhile i < array.length\n\t\tsentence = sentence + \" \" + array[i].to_s\n\t\ti += 1\n\tend\n\tsentence = sentence + \".\"\n\tp sentence\n\nend", "def sentence_maker(array_of_strings)\n sentence = array_of_strings[0].capitalize\n for i in array_of_strings[1..-1]\n sentence += \" \" + i\n end \n sentence + \".\"\nend", "def word_points word\n word_array = word.upcase.split(\"\")\n points = word_array.reduce (0) {| total , letter | total + letter_values[letter]}\n puts \"The total points for your Scrabble™ answer is: #{points}\"\nend", "def solution(sentence)\n sentence_arr = []\n sentence_arr = sentence.split(\" \")\n #puts \"#{sentence_arr}\"\n sentence_str = \"\"\n sentence_arr.reverse_each { |word| sentence_str += \"#{word} \" }\n #puts \"#{sentence_str}\"\n return sentence_str\nend", "def sentence_maker (array)\n\tindex = 0\n\twhile index < array.length\n\t\tif index == 0\n\t\t\tsentence = array[index].to_s.capitalize\n\t\telse \n\t\t\tsentence = sentence + \" \" + array[index].to_s\n\t\tend\n\t\tindex += 1\n\tend\n\tsentence = sentence + \".\"\n\treturn sentence \nend", "def sentence_maker(array_of_strings)\n\n sentence = array_of_strings[0].capitalize\n \n for i in array_of_strings[1..-1]\n sentence += \" \" + i\n end \n p sentence + \".\"\n \nend", "def sentence_maker(a)\n\tsum = \"\"\n\ta.each {|a| sum += (a + \" \")}\n\n\treturn sum.chomp(\" \").capitalize + \".\"\nend", "def sentences(total)\n (1..interpret_value(total)).map do\n words(5..20).capitalize\n end.join('. ')\n end", "def sentence_maker (array)\n sentence = \"\"\n array.each do |i|\n sentence = sentence + i.to_s + \" \"\n end\n sentence = sentence.capitalize.chop + \".\"\nend", "def sentence_maker(array_of_strings)\n result = \"\"\n last_word = array_of_strings.pop\n array_of_strings.each do |word|\n result += word.to_s + \" \"\n end\n result += last_word + \".\"\n return result.capitalize!\nend", "def sentence_maker(array)\n\tsentence = array.join(\" \")\n\tsentence.capitalize!\n\tsentence += \".\"\n\treturn sentence\nend", "def sentence_maker(array)\n\tarray[0].capitalize!\n\tfinalString = array.join(' ')\n\tfinalString = finalString + '.'\nend", "def sentence_maker(array)\n sentence = \"\"\n array[0].capitalize!\n array.each do |i|\n sentence << \"#{i}\"\n unless i == array.last\n sentence << \" \"\n end\n end\n sentence << \".\"\n return sentence\nend", "def total(array)\n\tanswer=array.inject(0){\n\t\t|sum,i| sum+i\n\t}\n\treturn answer\nend", "def sentence_maker (array)\n index = 0\n sentence = \"\"\n array = array.map {|x| x.to_s}\n\nuntil index == array.length-1\n sentence += array[index] + \" \"\n index += 1\nend\n\nsentence += array[-1] + \".\"\nreturn sentence.capitalize\n\nend", "def valid_sentence?(sentence_array)\n\t# input is expected to be array\n\t# method tests rules. Does the array have \n\t\t# 1 verb or more\n\t\t# 1 noun or 2 articles minimum\n\t\t# are all the words in the dictionary\n\tnouns = [\"abcd\", \"c\", \"def\", \"h\", \"ij\", \"cde\"]\n\tverbs = [\"bc\", \"fg\", \"g\", \"hij\", \"bcd\"]\n\tarticles = [\"a\", \"ac\", \"e\"]\n\tsentence_counter = 0 \n\n\tif sentence_array.class == Array\n\t\t# continue\n\t\tfor sentence in sentence_array do \n\n\t\t\t# are all the words valid in the dictionary?\t\n\t\t\tall = nouns + verbs + articles\n\t\t\tfor word in sentence do \n\t\t\t\tif all.include?(word)\n\t\t\t\t\t# p \"this word is valid\"\n\t\t\t\telse\n\t\t\t\t\tp \"#{word} is not a valid word in the dictionary\"\n\t\t\t\t\treturn false\n\t\t\t\tend\n\t\t\tend\n\t\t\t# p \"all words in sentence ar valid words..\"\n\t\t\t\n\t\t\t# does it have a verb?\n\t\t\tv = (sentence & verbs)\n\t\t\tif v.count > 0\n\t\t\t\t# p \"sentence at index #{sentence_counter} has at least 1 verb #{v}\"\n\n\t\t\t\t# does it have 1 noun? or if not, does it have 2 articles?\n\t\t\t\tn = (sentence & nouns)\n\n\t\t\t\tif n.count > 0\n\t\t\t\t\t# p \"sentence at index #{sentence_counter} has a noun #{n}\"\n\n\t\t\t\telse\n\t\t\t\t\t# 2 articles?\n\t\t\t\t\ta = (sentence & articles)\n\t\t\t\t\tif a.count >= 2\n\t\t\t\t\t\t# p \"sentence at index #{sentence_counter} has no noun, but 2 articles #{a}\"\n\t\t\t\t\telse\n\t\t\t\t\t\treturn false\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tp \"false sentence, does not contain a verb #{sentence}\"\n\t\t\t\treturn false\n\t\t\t\t# this sentence does not have a verb\n\t\t\tend\n\t\t\tsentence_counter += 1\n\t\tend\n\t\tputs \"\"\n\t\tputs \"every sentence is valid! \\n #{sentence_array}\"\n\t\treturn true\n\telse\n\t\tp \"the input is not valid, needs to be an array\"\n\t\treturn false\n\t\t# remove this from the array\n\t\t# will have to trick the system\n\tend\n\t\nend", "def sentence_maker(arr)\n x = ''\n #Concatenate each element with a space\n arr.each{|y| x << y.to_s << ' '}\n\n #Take out any leading or trailing white space\n x.strip!\n x[0] = x[0].capitalize\n x << '.'\n p x\nend", "def sum(array)\n s = 0\n\tarray.each {|x| s+= x}\n\ts\nend", "def sentence_maker(word_array)\n\tsentence = word_array.join(\" \")\n\treturn sentence.capitalize + \".\"\nend", "def sentence_maker (array)\n array[0].capitalize!\n return array.join(\" \") + \".\"\nend", "def length_finder(input_array)\n total = []\n input_array.each { |word| total << word.length }\n return total\nend", "def total(array)\n i = 0\n answer = 0\n\n while i < array.length\n answer += array[i]\n i += 1\n end\n return answer\nend", "def total(array)\n i = 0\n answer = 0\n\n while i < array.length\n answer += array[i]\n i += 1\n end\n return answer\nend", "def sentence_maker(array)\n array[0].capitalize!\n array.join(\" \") << \".\"\nend", "def total(array)\n\tlength = array.length\n\tsum = 0 \n\tfor i in 0...length\n\tsum = sum + array[i]\n\tend\n\tsum\nend", "def total(array)\n\tarray.inject {|sum,n| sum + n}\n\tend", "def sentence_maker(array)\n result = array.join(' ')\n result = result.capitalize + \".\"\nend", "def sentence_maker(array)\n\tcomplete = \"\"\n\tarray.each do |i|\n\t\tcomplete = complete + i.to_s + \" \"\n\tend\n\tcomplete.insert(-2, \".\")\n\treturn complete.strip.capitalize\nend", "def total (array)\n\tarray.inject { |sum, n| sum + n }\nend", "def sentence_maker(array)\n sentence = array.join(\" \")\n sentence = sentence.capitalize + \".\"\nend", "def total(array)\n\tarray.inject { |sum, x| sum + x }\nend", "def total(array)\n \n len = array.length\n i = 0\n sum = 0\n \n while i < len do\n sum = sum + array[i]\n i = i + 1\n end\n return sum\nend", "def solution5(input)\n # Approach\n # Map over the initial array (to return a transformed array)\n # Map over each interal array (to return a transformed array)\n # Creates an enumerable range up to the value in the array\n # Multiple each value in the range using the inject method\n # which iterates and keeps the running total\n\n # Final solution\n # Uses shorthand version of inject\n # Remove the useless multiple by 1\n # Note the use of the starting value of 1 for inject\n # which makes 0!=1 class Quiz\n # find even values\n def solution1(input)\n # Final solution\n input.flatten.select do |value|\n value.even?\n end\n\n # First solution:\n # Works correctly\n # Unoptimized\n #\n # input.map do |ary|\n # ary.select do |value|\n # value.even?\n # end\n # end.flatten\n end\n\n # find value sum\n def solution2(input)\n # Final Solution\n input.flatten.inject(:+)\n\n # Second solution:\n # Works correctly\n # Doesn't use shortcut version of inject\n #\n # input.flatten.inject do |sum, value|\n # sum += value\n # end\n\n # First solution:\n # Works correctly\n # Unoptimized\n #\n # input.map do |ary|\n # ary.inject do |sum, value|\n # sum += value\n # end\n # end.inject do |sum, value|\n # sum += value\n # end\n end\n\n # find max value\n def solution3(input)\n # Final solution\n input.flatten.max\n\n # First solution:\n # Works correctly\n # Unoptimized\n #\n # input.map do |ary|\n # ary.max\n # end.max\n end\n\n # sum the array lengths\n def solution4(input)\n # Final solution\n input.map(&:length).inject(0, :+)\n\n # Second solution:\n # Works correctly\n # Doesn't use shortcut version of inject\n #\n # input.map(&:length).inject{|sum, value| sum += value}\n\n # First solution:\n # Works correctly\n # Unoptimized\n #\n # input.map do |ary|\n # ary.length\n # end.inject {|sum, value| sum += value}\n end\n\n # transform to factorials\n # Factorial is defined as the product of all the whole numbers from 1 to n\n # Examples:\n # 4! = 4*3*2*1\n # 1! = 1\n # 0! = 1\n def solution5(input)\n # Approach\n # Map over the initial array (to return a transformed array)\n # Map over each interal array (to return a transformed array)\n # Creates an enumerable range up to the value in the array\n # Multiple each value in the range using the inject method\n # which iterates and keeps the running total\n\n # Final solution\n # Uses shorthand version of inject\n # Remove the useless multiple by 1\n # Note the use of the starting value of 1 for inject\n # which makes this work properly for all values (including 0, 1)\n input.map do |ary|\n ary.map do |value|\n (2..value).inject(1, :*)\n end\n end\n\n # First solution\n # Mostly optimized\n # Does 1 more multiplication than needed (mult by 1)\n #\n # input.map do |ary|\n # ary.map do |value|\n # (1..value).inject(1) do |factorial, value|\n # factorial *= value\n # end\n # end\n # end\n end\nend", "def sentence_maker(array)\n\tsentence = array.join(\" \")\n\tsentence.capitalize!\n\treturn sentence + \".\"\nend", "def sentence_maker(array)\n\tsentence = array.join(\" \")\n\tsentence.capitalize!\n\treturn sentence + \".\"\nend", "def sentence_maker (arr)\n sentence = \"\"\n arr[0] = arr[0].capitalize\n for i in 0...arr.length-1\n sentence = sentence + arr[i].to_s + \" \"\n end\n return sentence + arr[arr.length-1] + \".\"\nend", "def total(array)\n\tarray.inject do |sum, i| sum + i\n\tend\nend", "def sum_of_sums(array)\r\nend", "def sum(array)\n\tanswer = 0\n\tif array.length > 0 then\n\t\tarray.each {|x| answer += x}\n\telse\n\t\treturn 0\n\tend\n\treturn answer\nend", "def sentence_maker(strings)\n sentance = \"\"\n strings.each do |word|\n sentance += word.to_s + \" \"\n end\n sentance.strip!\n sentance.capitalize + \".\"\n\nend", "def total(array)\n\tarray.inject{|sum,x| sum + x }\nend", "def sentence_maker(array)\n\tsentence = array.join(\" \")\n\tsentence = sentence.to_s.capitalize + \".\"\nend", "def sum_difference_product\n answer = gets.chomp\n array1 = answer.split(\" \")\n sum = array1[0].to_i + array1[1].to_i\n diff = (array1[0].to_i - array1[1].to_i)\n prod = (array1[0].to_i * array1[1].to_i)\n puts sum\n puts diff\n puts prod\nend", "def sum_upon_sums(array)\n\nend", "def sentence_maker(array)\n sentence = array.join(\" \")\n sentence << \".\"\n sentence.capitalize!\nend", "def sentence_maker(words)\n if words.size != 0\n sentence = \"\"\n for w in 0...words.size\n word = words[w]\n if (word.is_a? String)\n sentence += word + \" \"\n else\n sentence += word.to_s + \" \"\n end\n end\n sentence.chomp!(\" \")\n sentence += \".\"\n sentence.downcase!\n sentence.capitalize!\n return sentence\n end\nend", "def array_translate(array)\n repeatedWords = \"\"\n i = 0\n while i < array.length-1\n word = array[i]\n num = array[i+1]\n num.times { repeatedWords += word }\n i += 2\n end\n return repeatedWords\nend", "def array_translate(array)\n string = ''\n i = 0 \n while i < array.length\n word = array[i]\n num = array[i + 1]\n string += (word * num)\n\n i += 2\n end\n\n string\nend", "def total (array)\n sum = 0\n array.each do |i|\n sum + i\n end\n return sum\nend", "def translate words\n\tarray = words.split \n\ti = 0\n\ttotal = \"\"\n\twhile i < array.length\n\t\tstring = array[i]\n\t\tif string[0] =~ /[aeiou]/\n\t\t\tresult = string + \"ay\"\n\t\telse\n\t\t\tletters = \"\"\n\t\t\tcounter = 0\n\t\t\tnumberConsanants = 0\n\t\t\twhile counter < string.length\n\t\t\t\tif string[counter] =~ /[aeiou]/\n\t\t\t\t\tbreak\n\t\t\t\telse\n\t\t\t\t\tletters = letters + string[counter]\n\t\t\t\t\tif string[counter] == 'q' && string[counter+1] == 'u'\n\t\t\t\t\t\tletters = letters + 'u'\n\t\t\t\t\t\tnumberConsanants = numberConsanants + 1\n\t\t\t\t\tend\n\t\t\t\t\tnumberConsanants = numberConsanants + 1\n\t\t\t\tend\n\t\t\t\tcounter = counter + 1\n\t\t\tend\n\t\t\tresult = string.slice(numberConsanants, string.length) + letters + \"ay\"\n\t\tend\n\t\ttotal = total + result\n\t\tif i != array.length - 1\n\t\t\ttotal = total + \" \"\n\t\tend\n\t\ti = i + 1\n\tend\n\ttotal\nend", "def\n \nend\n\n\n# 6. sentence_maker refactored solution", "def sentence_maker(array_of_strings)\n\n p array_of_strings.join(' ').capitalize + \".\"\n\n end", "def total(array)\n\tsum = 0\n\tarray.each do |x|\n\t\tsum = sum + x\n\tend\n\tsum\nend", "def translate(sentence)\n\twordsArray = sentence.split(' ')\n\treturnArray = []\n\n\twordsArray.each do |e| \n\t\twhile true\n\t\t\tif e[0].match(/[aeiou]/)\n\t\t\t\te = e + 'ay'\n\t\t\t\treturnArray.push(e)\n\t\t\t\tbreak\n\t\t\telse\n\t\t\t\tif e[0..1].match(/qu/)\n\t\t\t\t\te = e + e[0..1]\n\t\t\t\t\te[0..1] = ''\n\t\t\t\telse\n\t\t\t\t\te = e + e[0]\n\t\t\t\t\te[0] = ''\n\t\t\t\tend\n\t\t\t\t#if e[0..2].match(/sch/)\n\t\t\t\t#puts e\n\t\t\tend\n\t\tend\n\tend\n\n\n\t#puts returnArray\n\treturn returnArray.join(' ')\nend", "def sum_array(array)\n #array.inject(0){|sum,x| sum + x }\n array.inject(0){|sum,x| sum + x }\nend", "def sentence_maker(arr)\n string = \"\"\n arr.each do |i|\n string += i.to_s + ' '\n end\n string[-1] = \".\"\n return string = string.capitalize\nend", "def sum_of_sums(array)\n results = []\n\n loop do \n break if array.empty?\n results << array.inject(:+)\n array.pop\n end\n\n results.inject(:+)\nend", "def sentence_maker(string_array)\n string_array.join(\" \").capitalize + \".\"\nend", "def sum_of_sums(array)\n sequence_total = 0\n sum = 0\n array.each do |n|\n sequence_total += n\n sum += sequence_total\n end\n sum\nend", "def total (array)\n sum = 0\n for x in array\n sum += x\n end\n return sum\nend", "def all_possible_word_combos(input)\n\tnouns = [\"abcd\", \"c\", \"def\", \"h\", \"ij\", \"cde\"]\n\tverbs = [\"bc\", \"fg\", \"g\", \"hij\", \"bcd\"]\n\tarticles = [\"a\", \"ac\", \"e\"]\n\tall = nouns + verbs + articles\n\t\n\ttemp_array_for_combo = []\n\tall_valid_sentences_based_on_input = []\n\n\tfor word in all do \n\t\tif input.include?(word)\n\t\t\ttemp_array_for_combo << word\n\t\tend\n\tend\n\t# how many words can be in sentence?\n\t# we dont have any rules for word count in a sentence, only examples are 3 or 4 word sentences\n\ttemp_array_test_validity = temp_array_for_combo.combination(4).to_a + temp_array_for_combo.combination(3).to_a \n\n\tfor sentence in temp_array_test_validity do \n\t\t# sort the characters \n\t\tcombined_sentence = sentence.join.chars.sort\n\t\tcombined_sentence = combined_sentence.join\n\t\t# and check to match with input\n\t\tif combined_sentence == input\n\t\t\tall_valid_sentences_based_on_input.push(sentence)\n\t\tend\n\tend\n\n\tfor sentence in all_valid_sentences_based_on_input do \n\t\tsentence = sentence.sort! { |a,b| a <=> b }\n\tend\n\treturn all_valid_sentences_based_on_input\nend", "def sentence_maker(array_of_strings)\n return array_of_strings.join(\" \").capitalize + '.'\nend", "def translate(arr)\n vowels = %w{a e i o u y}\n consonants = %w{b c d f g h j k l m n p q r s t v w x y z}\n\n a = arr.split.map do |word| \n if vowels.include?(word[0])\n word + \"ay\"\n elsif word[0..1] == \"qu\"\n word[2..-1] + \"quay\"\n elsif word[0..2] == \"sch\"\n word[3..-1] + \"schay\"\n elsif word[0..2] == \"squ\"\n word[3..-1] + \"squay\"\n elsif consonants.include?(word[0]) && consonants.include?(word[1]) && consonants.include?(word[2])\n word[3..-1] + word[0..2] + \"ay\"\n elsif consonants.include?(word[0]) && consonants.include?(word[1])\n word[2..-1] + word[0..1] + \"ay\"\n elsif consonants.include?(word[0])\n word[1..-1] + word[0] + \"ay\"\n end\n end\n\n a.join(\" \")\nend", "def total(array)\n\tarray.inject {|sum, a| a + sum}\nend", "def sentence_maker(array)\n string = array.join(' ').capitalize! + '.'\nend", "def sentence_maker(array)\n array.join(\" \")\n array(0,1).capitalize + array(1..-1) + \".\"\nend", "def sentence_maker (arr)\n\n arr[0] = arr[0].capitalize\n sentence = arr.join(\" \")\n\n return sentence + \".\"\nend", "def add_length(str)\n # Init new array to store our results in\n new_array = []\n\n # First, we need to split the string, to break this into seperate words\n # then iterate through our string, and then calculating the length of the string\n # and storing that result into word_length\n str.split.each do |word|\n word_length = word.length\n\n # Assign a new string containing the word that we're iterating through, along with\n # the length of the word, then storing that into total\n total = \"#{word} #{word_length}\"\n\n # Append our new string into our currently empty array\n new_array << total\n end\n\n # Return results\n new_array\nend", "def total (array)\n\tindex = 0\n\tsum = 0\n\twhile index < array.length\n\t\tsum = sum + array[index]\n\t\tindex += 1\n\tend\n\treturn sum\nend", "def total(array)\n sum = 0\n array.each do |x|\n sum = sum + x\n end\n sum\nend", "def sum_array(array)\n return array.sum\n\n # sum_total_of_array = 0\n # for number in array\n # sum_total_of_array += number\n # end\n # return sum_total_of_array\nend", "def total(array) \n\tsum = 0\n\ti = 0\n\tfor i in 0.. array.length\n\tarray.each { |i| sum += i}\n\treturn sum\nend\nend", "def total(array)\n array.inject { |sum, n| sum + n}\nend", "def translate(sentence)\r\n words = sentence.split(\" \")\r\n words.collect! do |a|\r\n if(a =~ /\\w\\.\\.\\.\\w/) #matching e.g \"yes...no\"\r\n morewords = a.split(\"...\")\r\n ##\r\n #alternative: allows for recursion, but loses accuracy since \"a...b\" becomes \"a ... b\"\r\n #probably some non-messy way to make it work, and be less redundant too\r\n #\r\n #morewords.insert(1, \"...\")\r\n #translate(morewords.join(\" \"))\r\n pig(morewords[0], 1) + \"...\" + pig(morewords[1], 1)\r\n elsif(a =~ /\\w\\W\\w/ and !(a =~ /'/)) #matching e.g. \"steins;gate\", \"ninety-nine\", but not \"it's\"\r\n nonletter = a.scan(/\\W/)[0]\r\n morewords = a.split(/\\W/)\r\n #morewords.insert(1, nonletter)\r\n #translate(morewords.join(\" \"))\r\n pig(morewords[0], 1) + nonletter + pig(morewords[1], 1)\r\n elsif(a[0..1].match(/qu/)) #quiet = ietquay\r\n pig(a, 2)\r\n elsif(a[0..2].match(/sch|.qu/)) #school = oolschay, square = aresquay\r\n pig(a, 3)\r\n else\r\n x = a.index(/[AaEeIiOoUu]/) #starts with other consonant(s) or a vowel; find the first vowel\r\n if(!(x.nil?)) #found at least one vowel\r\n pig(a, x) \r\n else #x is nil, no vowels found\r\n a.index(/[[:alpha:]]/) ? pig(a, 1) : a #if it contains letters, attempt to process; otherwise, do nothing\r\n end\r\n end\r\n end\r\n return words.join(\" \")\r\nend", "def sum(theArray)\n\ttotal = 0\n\ttheArray.each do |i|\n\t\ttotal = total + i\n\tend\n\treturn total\nend", "def generate_sentence\n\n if @array_words.length < 3\n return \"Length of the input_file is too small to produce trigrams\"\n\n # This function results in an error message if there are no capital\n # words or no end of sentence punctutation in the input file.\n elsif (@end_of_sentence_punctutation == 0) or (@sentence_starters.length == 0)\n return \"End of sentence punctuation or sentence starters or both not found in the text!\"\n end\n\n # Based on a random key from the sentence_starters array, which contains\n # all the keys for the hash that start with a capital word a new key is\n # randomly chosen. Words that follow the key are randomly generated\n # based on probilitity. As soon as an end of sentence punctuation is\n # seen the process of generating words that follow a constantly chaging\n # key stops and the sentence is output. Uses the same process to\n # generate following words as the generate_text method. If end of\n # sentence punctutation is found in the starting key, words until the\n # end of sentence punctuation are returned. If the only end of sentence\n # punctuation is found in the first 2 words of the sentence, the program\n # will return an error message.\n key = @sentence_starters.sample\n\n if key.split[0][-1] =~ /[.|!|?]/\n return key.split[0]\n elsif key.split[1][-1] =~ /[.|!|?]/\n return key\n end\n\n sentence = key\n until sentence[-1] =~ /[!|.|?]/ do\n if @trigrams[key] == nil\n key = @trigrams.keys.sample\n end\n\n following_word = @trigrams[key].sample\n sentence += \" #{following_word}\"\n key = \"#{key.split[1]} #{following_word}\"\n \n end\n\n return sentence\n end" ]
[ "0.69088745", "0.681671", "0.67966765", "0.6706811", "0.64498925", "0.63029605", "0.6268446", "0.6233388", "0.6157397", "0.6124314", "0.60926396", "0.6061697", "0.6041328", "0.6041328", "0.6041328", "0.60397243", "0.6037254", "0.6017559", "0.59919035", "0.59793645", "0.5966288", "0.59536254", "0.5945703", "0.593324", "0.5926597", "0.58863264", "0.58715117", "0.58666533", "0.583142", "0.58178306", "0.5814435", "0.5799281", "0.57816714", "0.57784766", "0.57658315", "0.5755721", "0.57460916", "0.5699582", "0.56794137", "0.5678608", "0.5666258", "0.56518996", "0.5632324", "0.5611816", "0.5609938", "0.5605627", "0.5605627", "0.56029636", "0.5600636", "0.5586786", "0.55862564", "0.55844855", "0.55839396", "0.5580582", "0.557792", "0.55766374", "0.55762136", "0.5575276", "0.5575276", "0.5572199", "0.5571705", "0.55700517", "0.55679286", "0.55616283", "0.5552163", "0.55502874", "0.5544907", "0.55345976", "0.55268204", "0.5525368", "0.55234164", "0.5516139", "0.5514983", "0.5513793", "0.5510006", "0.5509743", "0.5507598", "0.5501874", "0.5499496", "0.5498619", "0.5498583", "0.5496673", "0.5493834", "0.54915994", "0.5491195", "0.54787886", "0.54784745", "0.54777664", "0.5474643", "0.54696035", "0.5469506", "0.54552937", "0.545224", "0.5448257", "0.54477996", "0.5443511", "0.54392546", "0.54382306", "0.54377025", "0.5435714" ]
0.55993026
49
3. Refactored Solution Remove return from total function because there is an implicit return
def total(array) array.inject { |sum, x| sum + x } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def total; end", "def sum; end", "def total(a,b)\r\n return (a+b)\r\nend", "def calculated; end", "def total(numbers)\n return numbers.reduce(:+)\nend", "def total(arr)\n return arr.inject(:+)\nend", "def computeTotal\n # get rule for total\n rule = @rules.find{ |obj| obj.getCode == \"total\" } \n # sum item prices\n total = @items.inject(0){|sum, x| sum + x.getPrice} \n # if rule exists and condition is met, apply discount\n if rule && total > rule.getThreshold \n total = rule.getPercent ? total * (1-rule.getValue) : total - rule.getValue\n end\n return total\n end", "def total_price\n sum = 0\n line_items.to_a.sum do |check|\n check.total_price.to_i\n end\n\t\nend", "def total(numbers)\n numbers.reduce(:+)\nend", "def total ( numbers )\r\n\r\n\treturn numbers.reduce(:+);\r\n\r\nend", "def total(arr)\n x = arr.reduce(:+)\n return x\nend", "def lift_total\n # lifters.reduce(0) do |total, lifter|\n # total += lifter.lift_total\n # total\n lifers.sum { |lifter| lifter.lift_total }\n end", "def cards_total(cards) #private method, so could not be used in test\n total = 0 #unitilized variable\n for card in cards\n total += card.value\n end # return statment was in middle of for loop\n return \"You have a total of\" + total.to_s #no implicit conversion of Integer into String\n\nend", "def total(numbers)\n result = 0\n numbers.each { |x| result += x }\n return result\nend", "def total\n return 0 if @products.empty?\n total = (@products.sum { |name, price| price } * 1.075).round(2)\n return total\n end", "def total (number)\n sum = 0\n number.each do | x |\n sum += x\n end\n return sum\nend", "def total(a)\n\ta.reduce(:+)\nend", "def total(array)\n sum = 0.0\n result = 0.0\n if array.length > 0 then\n array.each do |item|\n sum += item\n end\n result = sum \n end\n return result\nend", "def calc_return(total, pool, commission)\n if pool == 0\n return 0\n elsif total == 0\n return ( pool - (pool*commission) ) \n else\n return ( pool - (pool*commission) ) / total.to_f\n end\n end", "def total(nums)\n nums.inject(:+)\nend", "def pretotal\n total\n end", "def total(arr)\nnumber = 0\narr.each { |x| number += x}\n return number\nend", "def total(arr)\n arr.inject(:+)\nend", "def total (array)\n total = 0\n array.each do |i|\n total += i\nend\nreturn total\nend", "def total(arr)\n output = 0\n arr.each do |x|\n output += x\n end\n output\nend", "def total\n sum = 0\n\n @four_result.each do |result|\n sum += result\n end\n @six_result.each do |result|\n sum += result\n end\n @eight_result.each do |result|\n sum += result\n end\n @ten_result.each do |result|\n sum += result\n end\n @twelve_result.each do |result|\n sum += result\n end\n @twenty_result.each do |result|\n sum += result\n end\n @percentile_result.each do |result|\n sum += result\n end\n\n sum\n end", "def total(array)\n sum = 0\n array.each do |x|\n sum += x\nend\nsum\nend", "def total(num)\n sum = 0\n num.each do |x|\n sum = sum + x\n end\n return sum\nend", "def total(list)\n\n p list.reduce(:+)\n \nend", "def total(prices)\n amount = 0\n prices.each do |price|\n amount += price\n end\n amount\nend", "def get_total\n counts = convert_to_hash(@item_list)\n uniq_items = @item_list.uniq\n\n final = (@total - @sale.apply(uniq_items, counts)).round(2) # Used round for precision\n puts get_invoice + final.to_s\n final\n end", "def total(arr)\n total = 0\n arr.each {|i| total += i}\n return total\nend", "def total(numbers)\n sum = 0\n numbers.each { |num| sum += num }\n sum\nend", "def total(numbers)\n total = 0\n numbers.each do |num|\n total += num\n end\n\n return total\nend", "def total(prices)\n amount = 0\n prices.each do |price|\n amount += price\n end\n amount\nend", "def total arr\nsum_total = 0\narr.each do |el|\nsum_total += el\nend\nsum_total\nend", "def total(list)\n list.reduce(:+)\nend", "def total(num)\n sum = 0\n num.each do |int|\n sum = sum + int\n end\n return sum\nend", "def total(numbers)\n\tnumbers.inject(:+)\nend", "def total(array)\n sum = 0\n array.each do |num|\n sum += num\n end\n return sum\nend", "def total\n roll_all.reduce(&:+)\n end", "def total(array)\n array.inject(:+)\nend", "def total(x)\n sum = 0\n\tx.each do |i|\n\t\tsum += i\n\tend\n\treturn sum\nend", "def total_cost\n# Get the total cost of a specific lifter's gym memberships\n membs_cost = memberships.map{|membership|membership.cost}\n cost_total = membs_cost.inject(:+)\n end", "def reduce_to_total(source_array , starting_point = 0)\n #source_array.reduce{|x,starting_point| starting_point + x}\n \n #source_array.reduce(:+)\n total = 0\n \n i = 0\n\n while i < source_array.length do \n \n if starting_point != 0 \n \n starting_point += source_array[i] \n \n else\n total += source_array[i]\n end\n i += 1 \n \n end \n if starting_point == 0\n return total\n else\n return starting_point\n end\n end", "def total\n (amount + fee) if amount\n end", "def total(array)\n sum = 0\n array.each { |i| sum += i}\n return sum\nend", "def total(array)\n sum = 0\n array.inject(:+)\nend", "def total(array)\n sum = 0\n array.inject(:+)\nend", "def sum_with_catch\n\t# placeholder to start running total\n\ttotal = 0\n\t# create array for each item that is multiples of 3 or 5, add to total\n\t(1...1000).each do |n|\n\t\tif (n % 3 == 0) || (n % 5 == 0)\n\t\t\ttotal += n\n\t\tend\n\tend\n\t# return total\n\treturn total\nend", "def total\n total_amount = 0\n @order.each do |product, quantity|\n prod_price = PRODUCTS[product]\n if @pricing_rules.key?(product)\n rule = @pricing_rules[product]\n n = rule[1]\n type = rule[0]\n case type\n when \"Nx1\"\n total_amount += prod_price*( quantity/n + quantity%n )\n when \"BULK\"\n disccount_price = rule[2]\n total_amount += quantity * (quantity < n ? prod_price : disccount_price) #disccount price\n end\n else\n total_amount += prod_price * quantity\n end\n end\n total_amount\n end", "def total\n return (@listOfItem.inject(0){|sum,e| sum += e.total}).round_to(2)\n end", "def sum(num, total) => total += num", "def total(nums)\r\n\ttotal = 0\r\n\r\n\tnums.each do |i|\r\n\t\ttotal += i\r\n\tend\r\n\treturn total\r\nend", "def simple_budget_checker(total)\n\nend", "def compute_total(total)\n if discount.eq?('percent')\n percent_value = amount.to_f / 100\n total = total - (total * percent_value)\n else\n total = total - amount\n (total < 0) ? 0 : total \n end \n end", "def sum arr\n # YOUR CODE HERE\n total = arr.sum\n \n return total\nend", "def item_total\n line_items.map(&:total).reduce(:+)\n end", "def total(array)\n array.sum\nend", "def sum(a, b)\n points = 100\n return points # => Never give bottom of 'return'\n a + b + points\n puts \"This is after the expicit return statement\"\nend", "def compute_total_and_print()\n @total_price=0\n $final_price_list.each do |element| \n @total_price = @total_price + element\n end\n @total_sales_tax=0\n $sales_tax_list.each do |element|\n @total_sales_tax = @total_sales_tax + element\n end\n puts \"Sales Tax : #{@total_sales_tax.round(2)}\"\n puts \"Total : #{@total_price.round(2)}\"\nend", "def total(variable)\n\treturn variable.inject{|sum, x| sum + x}\nend", "def subtotal\n items.map(&:price).reduce(&:+)\n end", "def get_Total()\n \t return @outputs[\"Total\"]\n \tend", "def total(array)\nsum = 0 \n\tarray.each do |num|\n\tsum += num \n\tend \n\treturn sum\nend", "def total(array)\n sum = 0\n array.each {|x| sum += x}\n return sum\nend", "def running_total(array)\n result = []\n\n array.inject(0) do |sum, num|\n result << sum += num\n sum # have to return sum\n end\n result\nend", "def avg_price(products)\n # subtotal=0\n # products.map do |product|\n # subtotal = subtotal + product[:price]\n # end\n # (subtotal / products.count).round(2)\n #ou\n #subtotal = subtotal / products.count\n #subtotal.round(2)\n\n ##reduce\n subtotal = products.reduce(0) do |total, product|\n total = total + product[:price]\n end\n (subtotal / products.count).round(2)\nend", "def totalSimplificado\n @biblioteca.livrosComoLista.map(&:preco).inject(0){|total, preco| total += preco}\n end", "def total(array)\n sum = array.inject(:+)\n sum\nend", "def total\n @state[0]*VALUES[0] + @state[1]*VALUES[1] + @state[2]*VALUES[2] + @state[3]*VALUES[3] + @state[4]*VALUES[4]\n end", "def total(array)\n sum = 0\n array.each { |i| sum += i }\n return sum\nend", "def total\n # TODO: implement total\n if products.length == 0\n return 0\n end\n ((@products.values.sum)*1.075).round(2)\n end", "def sub_total\n sum = 0\n line_items.each do |line_item|\n sum += line_item.total_price\n end\n sum\n end", "def total (array)\n sum = 0\n array.each do |i|\n sum + i\n end\n return sum\nend", "def total_amount\n \t amount = 0\n \t operation_items.each do | oi |\n \t\tamount = amount + oi.amount\n end\n amount\n end", "def total_fee\n fee + fee2 + fee3 + fee4\n end", "def total(prices)\n amount = 0\n #From this:\n #index = 0\n #while index < prices.length\n # amount+= prices[index]\n # index += 1\n #end\n #To this:\n prices.each do |price|\n amount += price\n end\n amount\nend", "def calculate_total_2(info) # info is a hash with expected arguments\n taxAmt = info[:price] * info[:tax]\n tipAmt = info[:price] * info[:tip]\n info[:price] + tipAmt + taxAmt\nend", "def total_cost\n lifter_membership.reduce(0){ |total, pay| \n total + pay.cost}\n end", "def total\n @total ||= ((shipping_amount * subtotal).to_f/100) + subtotal + promotion_amount.to_i\n end", "def get_sum(a,b)\n def get_sum(a,b)\n (a..b).reduce(:+) || (b..a).reduce(:+)\n end\nend", "def remaining_total\n total\n end", "def calculate_total(cards) #nested array of [['hearts', '3'], ['spades', '4']]\n\t#We want to create methods for extractable, reusable code\n\t#But the object must be in the same form\n\t#you don't have to explicitly indicate \"return\" when you want to render or puts a value, in ruby, the last line is \n\t#returned implicitly.\n\n\tarr = cards.map{|e| e[1] }\n\n\ttotal = 0\n\tarr.each do |value| \n\t\tif value == \"A\"\n\t\t\ttotal += 11\n\t\telsif value.to_i == 0 #if card value has no integer value (equals 0), add 10\n\t\t\ttotal += 10 #in instances of Jack, Queen, or King\n\t\telse\n\t\t\ttotal += value.to_i #if card has an integer value\n\t\tend\n\tend\n#correct for Aces\narr.select{|e| e == \"A\"}.count.times do\n\ttotal -= 10 if total > 21\t\n\tend\n\ttotal\nend", "def sum(nums)\n total = 0\n nums.each do |n|\n total+= n\n end\n return total\nend", "def total(nums)\n sum = 0\n nums.each {|i| sum = (sum + i)}\nend", "def total (array)\n array.inject {|m, v| m += v}\nend", "def running_total(array)\n result = []\n\n array.inject(0) do |sum, num| # without (0) after inject method does not work?\n result << sum += num\n sum # without returning sum here, method does not work?\n end\n result\nend", "def running_total\n sum = 0.00\n @items.each { |item| sum += item[\"price\"] }\n return sum\n end", "def sum arr\n #return 0 if arr.empty?\n # arr.inject(:+)\n arr.inject(0, :+)\nend", "def total(num1, num2)\n num1 + num2\nend", "def total(array)\n array[0..-1].reduce(:+)\nend", "def precio_total_compras\n compras.sum(:precio_total)\n #p = 0\n #compras.each do |compra|\n #p += (compra.precio_total || 0)\n #end\n #return p\n end", "def calculate_total\n order_items.sum(:total)\n end", "def sum_create\n total = add_create.reduce(:+)\nend", "def total(num)\n\tsum = num.inject {|x,y| x + y }\n\treturn sum\nend", "def get_grand_total_one_month\n\t$pokitdok_call.each do |drug|\n\t$total_cost << drug['retail']['total_cost_30_day']['amount'].to_f\n\tend\n\t\n\tsum_total_cost = $total_cost.inject(:+)\nend", "def full_price_total(count)\n count * unit_price\n end", "def compute_total_value\n @value= @net_price * @count\n end", "def total(array)\n \tsum = 0\n \tarray.each do |num|\n sum += num\n end\t\n return sum\n end", "def total(array)\n y = 0\n array.each {|x| y = x + y}\n return y\nend" ]
[ "0.6999281", "0.69650257", "0.67575943", "0.66929144", "0.66499627", "0.6612894", "0.65856373", "0.6556074", "0.6511263", "0.64897454", "0.6473037", "0.6444055", "0.64407015", "0.6433366", "0.64193606", "0.6417248", "0.64165866", "0.6404734", "0.6402996", "0.6394606", "0.63888985", "0.6370863", "0.63659716", "0.6361801", "0.6357162", "0.63418305", "0.6340072", "0.63394344", "0.6337691", "0.63358915", "0.63277495", "0.63202715", "0.6317769", "0.6313562", "0.6312825", "0.63016295", "0.6299416", "0.6295952", "0.6281258", "0.6276402", "0.62703794", "0.62578356", "0.6255239", "0.6253791", "0.62535137", "0.625169", "0.62496555", "0.62462604", "0.62462604", "0.62297297", "0.6225209", "0.6223399", "0.6221061", "0.62064314", "0.61967105", "0.618501", "0.61826086", "0.6181865", "0.61799705", "0.61792654", "0.6175803", "0.61715984", "0.61680835", "0.6146381", "0.6143523", "0.6143086", "0.6131132", "0.61310136", "0.61261135", "0.6125866", "0.61206394", "0.6117849", "0.61117816", "0.61106193", "0.61016244", "0.6101571", "0.6101478", "0.6091854", "0.6091805", "0.6088036", "0.60794103", "0.6078849", "0.60778475", "0.6077686", "0.60768986", "0.60767573", "0.6075036", "0.6069549", "0.6066836", "0.60648674", "0.60566884", "0.6054195", "0.6053859", "0.6053801", "0.6052521", "0.60516787", "0.6049885", "0.60441035", "0.6043619", "0.60419583", "0.60414463" ]
0.0
-1
Remove creation of sentence variable, since it does not exist prior to the loop it is assumed to be blank
def sentence_maker(array) i = 0 while i < array.length do if i == 0 sentence = (array[i].capitalize.to_s + " ") elsif i == array.length-1 sentence = sentence + (array[i].to_s + ".") else sentence = sentence + (array[i].to_s + " ") end i += 1 end return sentence end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def\n \nend\n\n\n# 6. sentence_maker refactored solution", "def reset!\n @sentence = Mikrotik::Protocol::Sentence.new\n end", "def wookie_sentence; end", "def generate_sentence\n current_words = Array.new(depth)\n sentence_array = []\n loop do\n new_word = current_words.last\n sentence_array.push new_word if new_word\n break if end_word?(new_word)\n next_word_options = @dictionary[current_words]\n if next_word_options.empty? && !end_word?(new_word)\n new_word.concat('.')\n break\n end\n next_word = next_word_options.sample\n current_words.push next_word\n current_words.shift\n end\n sentence_array.join(' ')\n end", "def sentence; end", "def sentence_maker(s_array)\n\n if s_array.empty? == true\n\n puts \"Array is empty add some values\"\n\n else\n\n p s_array.join(' ').capitalize + '.'\n\n end\nend", "def sentence\n @sentence ||= term.sentence\n end", "def create_sentence(words)\n\n\tstr=\"\"\n\tfor i in 0..words.size-1 do\n\t\tstr+=words[i]\n\t\tstr+=\" \"\n\n\tend\n\nputs str\n\t\nend", "def sentence_maker(words)\n if words.size != 0\n sentence = \"\"\n for w in 0...words.size\n word = words[w]\n if (word.is_a? String)\n sentence += word + \" \"\n else\n sentence += word.to_s + \" \"\n end\n end\n sentence.chomp!(\" \")\n sentence += \".\"\n sentence.downcase!\n sentence.capitalize!\n return sentence\n end\nend", "def delete_useless!\n @eng_sentence = @eng_sentence - @useless_eng_words\n @rus_sentence = @rus_sentence - @useless_rus_words\n end", "def wookiee_sentence; end", "def generate_sentence\n # Splitting into an array is required for easily preventing duplicate vals\n sent = Drama::Constants::SENTENCES.sample.split(/\\s/)\n sent.each do |w|\n num = sent.index(w)\n sent[num] = w % {\n things: Drama::Constants::THINGS.sample,\n sites: Drama::Constants::SITES.sample,\n people: Drama::Constants::PEOPLE.sample,\n says: Drama::Constants::SAYS.sample,\n badsoft: Drama::Constants::BADSOFT.sample,\n function: Drama::Constants::FUNCTIONS.sample,\n adj: Drama::Constants::ADJECTIVES.sample,\n enormous: Drama::Constants::SIZES.sample,\n price: Drama::Constants::PRICES.sample,\n ac1: Drama::Constants::BADVERBS.sample,\n packs: Drama::Constants::PACKS.sample,\n drama: Drama::Constants::DRAMA.sample,\n code: Drama::Constants::CODE.sample,\n ban: Drama::Constants::BANS.sample,\n activates: Drama::Constants::ACTIVATES.sample\n }\n end\n\n # add_a_drama\n sent.join(' ')\n end", "def sentence_maker(my_sentence)\n result=my_sentence.shift\n my_sentence.each { |x| result= result + \" \" + x.to_s }\n result=result + \".\"\n result.capitalize!\n end", "def assignSentence(sentence, sentIdx)\n sentenceLength = sentence.length - 1\n\n #I need to find the index of the words that don't have a length\n idx = 0\n @words.each do |word|\n if word.sentIdx == nil\n break\n end\n idx = idx + 1\n end\n\n #assuming that sentenceLength will either be right on or over. never under\n #going to give it 3 spaces to find an acceptable .?!\n tempIdx = idx + sentenceLength\n\n #puts \"idx => #{idx} - tempIdx => #{tempIdx}\"\n tmpSentence = SentenceModel.new\n tmpSentence.sentIdx = sentIdx\n\n for i in idx..tempIdx\n if @words[i] == nil\n next\n end\n \n tmpSentence.addWord @words[i]\n\n @words[i].sentIdx = sentIdx\n end\n\n @sentences.push tmpSentence\n end", "def generate_sentence\n\n if @array_words.length < 3\n return \"Length of the input_file is too small to produce trigrams\"\n\n # This function results in an error message if there are no capital\n # words or no end of sentence punctutation in the input file.\n elsif (@end_of_sentence_punctutation == 0) or (@sentence_starters.length == 0)\n return \"End of sentence punctuation or sentence starters or both not found in the text!\"\n end\n\n # Based on a random key from the sentence_starters array, which contains\n # all the keys for the hash that start with a capital word a new key is\n # randomly chosen. Words that follow the key are randomly generated\n # based on probilitity. As soon as an end of sentence punctuation is\n # seen the process of generating words that follow a constantly chaging\n # key stops and the sentence is output. Uses the same process to\n # generate following words as the generate_text method. If end of\n # sentence punctutation is found in the starting key, words until the\n # end of sentence punctuation are returned. If the only end of sentence\n # punctuation is found in the first 2 words of the sentence, the program\n # will return an error message.\n key = @sentence_starters.sample\n\n if key.split[0][-1] =~ /[.|!|?]/\n return key.split[0]\n elsif key.split[1][-1] =~ /[.|!|?]/\n return key\n end\n\n sentence = key\n until sentence[-1] =~ /[!|.|?]/ do\n if @trigrams[key] == nil\n key = @trigrams.keys.sample\n end\n\n following_word = @trigrams[key].sample\n sentence += \" #{following_word}\"\n key = \"#{key.split[1]} #{following_word}\"\n \n end\n\n return sentence\n end", "def sentence\n\t\[email protected]_100_words\n\tend", "def sentence_maker(strings)\n sentance = \"\"\n strings.each do |word|\n sentance += word.to_s + \" \"\n end\n sentance.strip!\n sentance.capitalize + \".\"\n\nend", "def generate(wordcount)\n if @dictionary.dictionary.empty?\n raise EmptyDictionaryError.new(\"The dictionary is empty! Parse a source file/string!\")\n end\n sentence = []\n sentence.concat(random_capitalized_word)\n (wordcount-1).times do\n word = weighted_random(sentence.last(@depth))\n if punctuation?(word)\n sentence[-1] = sentence.last.dup << word\n sentence.concat(random_capitalized_word)\n elsif word.nil?\n sentence.concat(random_capitalized_word)\n else\n sentence << word\n end\n end\n sentence.pop(sentence.length-wordcount)\n sentence.join(' ')\n end", "def sentence_maker(words)\n\n i = 0\n sentence = ''\n\n while i < words.length\n if i == 0\n sentence = sentence + words[0].to_s.capitalize + ' '\n end\n if i == words.length - 1\n sentence = sentence + words[(words.length - 1)].to_s + '.'\n end\n if (i != words.length - 1) && i != 0\n sentence = sentence + words[i].to_s + ' '\n end\n i += 1\n end\n return sentence\nend", "def remember_first_sentence(defn_node)\n first_sentence = defn_node.body[1]\n unless first_sentence == s(:nil)\n @first_sentences[first_sentence] ||= []\n @first_sentences[first_sentence] << defn_node\n end\n end", "def sentence_maker(words)\r\n\tsentence = ''\r\n\ti = 0\r\n\r\n\twhile i < words.length\r\n\t\tif i == 0 \r\n\t\t\tsentence = sentence + words[i].to_s.capitalize + ' '\r\n\t\t\ti += 1\r\n\t\telsif i == (words.length - 1)\r\n\t\t\tsentence = sentence + words[i].to_s + '.'\r\n\t\t\ti += 1\r\n\t\telse\r\n\t\t\tsentence = sentence + words[i].to_s + ' '\r\n\t\t\ti += 1\r\n\t\tend\r\n\tend\r\n\tp sentence\r\nend", "def count_sentences\n self.split(/\\.|\\?|\\!/).delete_if {|w| w.size < 2}.size\n binding.pry\n end", "def sentence_maker(array_of_strings)\n\t# Declare new sentence variable and set to \"\"\n\tsentence = \"\"\n\t# Capitalize first word in array\n\tarray_of_strings[0].to_s.capitalize!\n\t# For each member of array_of_strings, add to the sentence variable (converting to string)\n\tfor num in 0..(array_of_strings.length - 1)\n\t\t\tsentence += array_of_strings[num].to_s\n\t\t# unless the member of the array is the last member of array_of_strings_, add a space after the word\n\t\tunless num == (array_of_strings.length - 1)\n\t\t\tsentence += \" \"\n\t\tend\n\tend\n\t# End the sentence variable with a period\n\tsentence += \".\"\n\t# Return the sentence variable\n\treturn sentence\nend", "def sentence(word_count: T.unsafe(nil), random_words_to_add: T.unsafe(nil), open_compounds_allowed: T.unsafe(nil)); end", "def count_sentences\n \tself.split(/[.?!]/).delete_if{|obj| obj == \"\"}.count\n end", "def sentence_maker(array_of_strings)\n\n sentence = array_of_strings[0].capitalize\n \n for i in array_of_strings[1..-1]\n sentence += \" \" + i\n end \n p sentence + \".\"\n \nend", "def neutralize(sentence)\n words = sentence.split(' ')\n words.each_with_index do |word, index|\n p index\n p word\n p words\n words.delete(word) if negative?(word)\n p words\n end\n\n words.join(' ')\nend", "def sentence_maker(words)\n sentence = \"\"\n words.each { |word|\n word = word.to_s\n if word == words.first.to_s #cap if word is first in sentence\n sentence << (word.capitalize)\n else\n sentence << word\n end\n\n if word == words.last #period after last word, otherwise space\n sentence << \".\"\n else\n sentence << \" \"\n end\n }\n sentence\nend", "def textilize_without_paragraphs\n\t\tunless self.nil? or self.empty?\n\t\t string = self.textilize\n\t\t string = string[3..-1]\n\t\t string = string[0..-5]\n\t\telse\n\t\t \"\"\n\t end\n\tend", "def neutralize(sentence)\n words = sentence.split(' ')\n words.clone.each do |word|\n words.delete(word) if negative?(word)\n end\n\n words.join(' ')\nend", "def generate_sentence(sentencecount, that_starts_with: nil)\n if @dictionary.dictionary.empty?\n raise EmptyDictionaryError.new(\"The dictionary is empty! Parse a source file/string!\")\n end\n sentence = []\n # Find out how many actual keys are in the dictionary.\n key_count = @dictionary.dictionary.keys.length\n # If less than 30 keys, use that plus five as your maximum sentence length.\n maximum_length = key_count < 30 ? key_count + 5 : 30\n sentencecount.times do\n wordcount = 0\n if that_starts_with.nil?\n sentence.concat(random_capitalized_word)\n else\n sentence.concat(that_starts_with)\n if weighted_random(sentence.last(@depth)).nil?\n last_word_is_prefix = entries_starting_with(sentence.last)\n if last_word_is_prefix.empty?\n sentence.concat(random_word)\n else\n sentence.concat(last_word_is_prefix.sample[1..-1])\n end\n end\n end\n\n until (punctuation?(sentence.last[-1])) || wordcount > maximum_length\n wordcount += 1\n word = weighted_random(sentence.last(@depth))\n if punctuation?(word)\n sentence[-1] = sentence.last.dup << word\n else\n sentence << word\n end\n end\n end\n sentence.join(' ')\n end", "def sentence_maker(array)\n\tsentence = array[0].capitalize.to_s\n\ti = 1\n\twhile i < array.length\n\t\tsentence = sentence + \" \" + array[i].to_s\n\t\ti += 1\n\tend\n\tsentence = sentence + \".\"\n\tp sentence\n\nend", "def count_sentences\n sentence_array = self.split(/[.?!]/)\n sentence_array.delete_if{|sentence| sentence.empty?}\n sentence_array.length\n \n\n end", "def create_title (word)\n\tp_title = word + ' '\n\tindex = 0\n\t#do until word key does not exist\n\twhile mcw(word) != -1\n\t\tp_array = p_title.split\n\t\tword = mcw(word)\n\t\t#If the sentence already contains word, break\n\t\tbreak if p_array.include? word\n\t\tp_title = p_title + word + ' ' #Concatenate new word to sentence\n\t\tindex += 1\n\tend\n\tp_title.gsub!(/\\s$/, '') #remove trailing whitespace\n\treturn p_title\nend", "def sentence_maker(words)\n\tif words.size != 0\n\t\tsentence = \"\"\n\t\tfor w in 0...words.size\n\t\t\tword = words[w]\n\t\t\tif (word.is_a? String)\n\t\t\t\tsentence += word + \" \"\n\t\t\telse\n\t\t\t\tsentence += word.to_s + \" \"\n\t\t\tend\n\t\tend\n\t\tsentence.chomp!(\" \")\n\t\tsentence += \".\"\n\t\tsentence.downcase!\n\t\tsentence.capitalize!\n\t\treturn sentence\n\tend\nend", "def sentence_maker(words)\n sentence = ''\n words[0].capitalize!\n words.each do |x|\n sentence = sentence + x.to_s + ' '\n end\n sentence = sentence.chop + \".\"\nend", "def consonant_cancel(sentence)\n \tnewSentence = \"\"\n\tsentence.split.each do |word|\n \t# puts word\n \tnewSentence = newSentence + \" \" + find_vowel(word)\n end\n \treturn newSentence\nend", "def sentence_maker (array)\n\tindex = 0\n\twhile index < array.length\n\t\tif index == 0\n\t\t\tsentence = array[index].to_s.capitalize\n\t\telse \n\t\t\tsentence = sentence + \" \" + array[index].to_s\n\t\tend\n\t\tindex += 1\n\tend\n\tsentence = sentence + \".\"\n\treturn sentence \nend", "def sentence_maker(variable)\n\treturn variable.inject{|sentence, x| sentence + \" \" + x.to_s}.lstrip.capitalize + \".\"\nend", "def sentence_maker(string_array)\nnew_string = \"\"\nnew_array = []\n\nstring_array.each do |string|\n if string != string_array[-1]\n new_string += string.to_s + \" \"\n else\n new_string += string.to_s\n end\n \n new_array.push(new_string)\nend\nreturn new_array[-1].capitalize + \".\"\nend", "def preform\n length = @sentence.length - 1\n u = 1\n puts @sentence\n for i in (0..length) do\n u == 1 ? @sentence[i] = @sentence[i].upcase : @sentence[i] = @sentence[i].downcase\n u = u*(-1)\n end\n puts @sentence\n end", "def sentence(word_count: T.unsafe(nil), supplemental: T.unsafe(nil), random_words_to_add: T.unsafe(nil), open_compounds_allowed: T.unsafe(nil)); end", "def sentence_maker(array)\n sentence = \"\"\n array.each do |x|\n sentence = sentence + x.to_s + \" \"\n end\n\n sentence[0] = sentence[0].upcase\n sentence = sentence.rstrip\n sentence = sentence + \".\"\n return sentence\n\nend", "def sentence_maker(x)\n\tx.join(\" \")\nend", "def sentence_maker (strings)\n\njoin_strings = String.new\n\n strings.each { |string| join_strings += \" \" + \"#{string}\"}\n join_strings[0] = \"\"\n join_strings[0] = join_strings[0].capitalize\n return join_strings + \".\"\n\nend", "def sentence_cache\n @sentence_cache ||= Gemmy::Components::Cache.new \"sentence_pos\"\n end", "def remove_w_words(sentence)\n \nend", "def sentence_maker(sentence)\n sentence[0] = sentence[0].capitalize\n sentence.join(\" \") + \".\"\nend", "def sentence_maker(word_array)\n sentence = word_array.inject(\" \"){|words,element| words += element.to_s + \" \"}\n sentence.strip!.capitalize!\n sentence << \".\"\nend", "def neutralize(sentence)\n words = sentence.split(' ')\n\n # bug fix: \n # words.each do |word|\n # words.delete(word) if negative?(word)\n # end\n #\n # Can't delete while iterating. Use this instead:\n words.reject! { |word| negative?(word) }\n\n words.join(' ')\nend", "def sentence_maker(array)\n sentence = \"\"\n array[0].capitalize!\n array.each do |i|\n sentence << \"#{i}\"\n unless i == array.last\n sentence << \" \"\n end\n end\n sentence << \".\"\n return sentence\nend", "def solution(sentence)\n sentence_arr = []\n sentence_arr = sentence.split(\" \")\n #puts \"#{sentence_arr}\"\n sentence_str = \"\"\n sentence_arr.reverse_each { |word| sentence_str += \"#{word} \" }\n #puts \"#{sentence_str}\"\n return sentence_str\nend", "def sentence_maker (array)\n sentence = \"\"\n array.each do |i|\n sentence = sentence + i.to_s + \" \"\n end\n sentence = sentence.capitalize.chop + \".\"\nend", "def sentence_maker(array_of_strings)\n result = \"\"\n last_word = array_of_strings.pop\n array_of_strings.each do |word|\n result += word.to_s + \" \"\n end\n result += last_word + \".\"\n return result.capitalize!\nend", "def sentence_maker(word_array)\n sentence = word_array.inject(\" \"){|words,element| words+=element.to_s+\" \"}\n sentence.strip!.capitalize!\n sentence << \".\"\nend", "def sentence_maker(array_of_strings)\n sentence = array_of_strings[0].capitalize\n for i in array_of_strings[1..-1]\n sentence += \" \" + i\n end \n sentence + \".\"\nend", "def split_sentences\n sentences = self.plain_text.split(\".\")\n while sentences.include?(\" \") do\n sentences = check_for_blanks_in_arr(sentences)\n end\n sentences\n end", "def sentence_maker(array)\n\tx = 0\n\tsum = \"\"\n\n\t\twhile x < (array.length - 1)\n\t\t\tsum += array[x].concat \" \" \n\t\t\tx += 1\n\t\tend \n\t\t\tsum += array[x].concat \".\" \n\treturn sum\n\nend", "def makeTitle()\n title = ''\n while title == ''\n tmpTitle = @sentences[:dialogue][rand(@sentences[:dialogue].size - 1)]\n quotedSections = tmpTitle.scan(QUOTED_TEXT_REGEX)\n if !quotedSections.nil? && !quotedSections[0].nil?\n title = quotedSections[0][0].gsub(STRIP_FROM_TITLE_REGEX, '')\n end\n end\n return title\nend", "def neutralize(sentence)\n words = sentence.split(' ')\n words.each do |word|\n words.delete(word) if negative?(word)\n end\n\n words.join(' ')\nend", "def sentence_maker(words)\n sentence = \"\"\n words.each { |word| sentence << word.to_s + \" \"}\n sentence = sentence.chomp(\" \") << \".\"\n return sentence.capitalize\nend", "def sentence(format = :raw)\n raw_sentence = read_attribute(:sentence)\n\n case format\n when :raw then raw_sentence\n when :clear then raw_sentence.gsub(FILL_DELIMITER, '')\n end\n end", "def neutralize(sentence)\n words = sentence.split(' ')\n ok_words = words.select do |word|\n !negative?(word)\n end\n\n ok_words.join(' ')\nend", "def get_words\n @sentences.each_index do |i|\n s = @sentences[i]\n words = s.split(' ')\n words.each do |w|\n word = w.gsub(WORD_SANITIZE, '').downcase\n if belongs_to_known_abbreviations? word\n add_word_to_result(word, i)\n else\n add_word_to_result(word.gsub(DOT_SANITIZE, ''), i)\n end\n end\n end\n end", "def sentence_maker(my_sentence)\n result=my_sentence.join(\" \")\n result=result.capitalize + \".\"\n end", "def paragraph(\n word_count: rand(DEFAULT_WORD_COUNT_RANGE),\n sentence_count: rand(DEFAULT_SENTENCE_COUNT_RANGE),\n fillers: dictionnary.fillers\n )\n sentence_count = 0 if sentence_count.negative?\n paragraph = []\n sentence_count.times do\n s = sentence(word_count: word_count, fillers: fillers)\n paragraph << s unless s.empty?\n end\n paragraph.join(' ')\n end", "def sentence_maker (array)\n index = 0\n sentence = \"\"\n array = array.map {|x| x.to_s}\n\nuntil index == array.length-1\n sentence += array[index] + \" \"\n index += 1\nend\n\nsentence += array[-1] + \".\"\nreturn sentence.capitalize\n\nend", "def sentence_maker(arr)\n string = \"\"\n i = 1\n while i < arr.length-1\n string += arr[i].to_s + ' '\n i+=1\n end\n sentence = arr[0].capitalize! + \" \" + string + arr[-1] + \".\"\n return sentence\nend", "def sentence_maker(arr)\n output = \"\"\n arr.each do |word|\n output += (word.to_s + \" \")\n end\n output.capitalize.strip + \".\" \nend", "def sentence_maker(arr)\n output = \"\"\n arr.each do |word|\n output += (word.to_s + \" \")\n end\n output.capitalize.strip + \".\" \nend", "def sentence_maker(arr)\n output = \"\"\n arr.each do |word|\n output += (word.to_s + \" \")\n end\n output.capitalize.strip + \".\" \nend", "def sentences(number: T.unsafe(nil)); end", "def catch_phrase\n [\n [\"ninja\",\"master\",\"student\"].rand, \n [\"\", \"\", \"\", \"\", \"\", \"\", \"weapons\", \"s' 3rd annual\",\"s' 5th annual\",\"s' 10th annual\", \"s' secret\"].rand,\n [\"gathering\",\"celebration\",\"meeting\",\"tournament\",\"competition\",\"party\",\"training camp\",\"sparring event\"].rand,\n [\"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"with Leonardo\", \"with Raphael\", \"with Michaelangelo\", \"with Donatello\"].rand\n ].join(' ').gsub(/ s\\'/,'s\\'').gsub(/\\s\\s/,' ').strip\n end", "def sinking_deleting_text(thread)\n arr = []\n arr << \"sinking\" if thread.sunk?\n arr << \"deleting\" if thread.deleted?\n if arr.empty?\n \"\"\n else\n arr.to_sentence\n end\n end", "def sentence_maker_refactored(words)\n words.first.capitalize!\n words.join(\" \") + \".\"\nend", "def play_offense\n empty_spaces = best_line.spaces.select { |space| space.value.nil? } \n empty_spaces.sample\n end", "def log_sentence sentence\n sentence_cache.get_or_set(sentence) do\n engtagger_lookup(sentence).map do |word, pos|\n finalize_pos(word, pos)\n end\n end\n end", "def sentence_maker(arraystring)\n fullsentence = ''\n length_of_arraystring = arraystring.length\n current_index_of_array = 0\n while current_index_of_array < length_of_arraystring\n if current_index_of_array == 0\n word = arraystring[current_index_of_array].to_s.capitalize\n fullsentence = fullsentence + word + ' '\n\n elsif current_index_of_array == length_of_arraystring - 1\n word = arraystring[current_index_of_array].to_s\n fullsentence = fullsentence + word + '.'\n else\n word = arraystring[current_index_of_array].to_s\n fullsentence = fullsentence + word + ' '\n end\n current_index_of_array = current_index_of_array + 1\n\n end\n# puts fullsentence\n return fullsentence\nend", "def lose_word\n if self.text.split.length > 1\n prev_line = self.text.split\n prev_line.delete_at(rand(prev_line.length))\n self.text = prev_line.join(\" \")\n self.save\n end\n end", "def valid_sentence(string, dictionary)\n #Create a global variable to be able to access throughout\n $process = {}\n final_sentences = []\n sentences(string, dictionary).each do |array|\n set = array.split(\" \")\n if dictionary_words?(set) && verb_present?(set) && noun_articles_present?(set)\n final_sentences << array\n end\n end\n final_sentences.sort!\n end", "def to_s\n text = 'Once upon a time ' + @sentences[0].to_s\n @sentences[1..-1].each do |sentence|\n bridge = BRIDGES.pick.to_s\n text += bridge + ' ' + (bridge[-1,1] == '.' ? sentence.to_s.capitalize : sentence.to_s)\n end\n text.gsub!(/ ,/, ',') # a little clean-up\n text.gsub!(/(.{70,80}) /, \"\\\\1\\n\")\n text + \".\\nThe End.\\n\"\n end", "def sentence_maker arr\n catenated_str = ''\n space = ' '\n i = 0\n\n arr.each do |el|\n catenated_str += i == 0 ? el.capitalize.to_s : i == (arr.length - 1) ? space + el.to_s + '.' : space + el.to_s\n i+=1\n end\n catenated_str\nend", "def test_String_003_ToSentence\n \n puts2(\"\")\n puts2(\"#######################\")\n puts2(\"Testcase: test_String_003_ToSentence\")\n puts2(\"#######################\")\n \n \n puts2(\"\\nA specific string...\")\n sString = \"oNCE UPON a time Long ago and far away\"\n puts2(\"\\n String: \" + sString)\n sSentence = sString.to_sentence\n puts2(\" Sentence: \" + sSentence)\n \n puts2(\"\\nFour sets of 2 pseudo words as sentences...\")\n 4.times {\n sString = random_pseudowords(2,10)\n puts2(\"\\n String: \" + sString)\n sSentence = sString.to_sentence\n puts2(\" Sentence: \" + sSentence)\n }\n \n puts2(\"\\nTwo sets of 3 pseudo words ending in a period as sentences...\")\n 2.times {\n sString = random_pseudowords(3,10) + \".\"\n puts2(\"\\n String: \" + sString)\n sSentence = sString.to_sentence\n puts2(\" Sentence: \" + sSentence)\n }\n \n puts2(\"\\nTwo sets of 4 pseudo words ending in a exclamation point as sentences...\")\n 2.times {\n sString = random_pseudowords(4,10) + \"!\"\n puts2(\"\\n String: \" + sString)\n sSentence = sString.to_sentence\n puts2(\" Sentence: \" + sSentence)\n }\n \n puts2(\"\\nTwo sets of 5 pseudo words ending in a question mark as sentences...\")\n 2.times {\n sString = random_pseudowords(5,10) + \"?\"\n puts2(\"\\n String: \" + sString)\n sSentence = sString.to_sentence\n puts2(\" Sentence: \" + sSentence)\n }\n \n end", "def sentence_maker(array)\n\tanswer=\"\"\n\tarray[0]=array[0].capitalize\n\tarray.each do |x|\n\t\tx=x.to_s\n\t\tanswer+=x+\" \"\n\tend\t\n\tanswer=answer.chop+\".\"\n\treturn answer\nend", "def make_sentence parts\n index = 1\n parts.delete('.')\n string = parts.join(' ') + '.'\n if string.include?(\" ,\")\n string.gsub!(\" ,\", \",\")\n end\n string\nend", "def compact_sentence (sentence, important)\n\tremove_interrupts(sentence)\n\tremove_duplicates(sentence, important)\nend", "def sentence_maker (arr)\n sentence = \"\"\n arr[0] = arr[0].capitalize\n for i in 0...arr.length-1\n sentence = sentence + arr[i].to_s + \" \"\n end\n return sentence + arr[arr.length-1] + \".\"\nend", "def sentence_maker(array)\n str_array = array.collect{|i| i.to_s} #collect method returns entire array or hash; we are converting all elements of array into string\n sentence = array[0] #converts first element of array into new array\n sentence[0] = str_array[0][0].upcase #makes first letter uppercase\n str_array.shift\n\tstr_array.each { |i| sentence = sentence + \" \" + i.to_s}\n\treturn sentence + \".\"\nend", "def sentence_maker(array)\n sentence = array[0].capitalize\n for w in 1...array.length\n sentence = sentence + \" \" + array[w].to_s\n end\n return sentence + \".\"\nend", "def sentences(total)\n (1..interpret_value(total)).map do\n words(5..20).capitalize\n end.join('. ')\n end", "def neutralize(sentence)\n words = sentence.split(' ')\n unchanged_words = sentence.split(' ')\n unchanged_words.each do |word|\n words.delete(word) if negative?(word)\n end\n\n words.join(' ')\nend", "def sentence_maker(words)\n\tstring = \"\"\n\twords.each do |x|\n\t\tstring = string + x.to_s + \" \"\n\tend\n\treturn string.capitalize.strip + \".\"\nend", "def count_sentences\n return self.split(/\\.|\\?|\\!/).delete_if {|word| word.size < 1}.count\n\n end", "def paragraph(sentence_count: T.unsafe(nil), random_sentences_to_add: T.unsafe(nil)); end", "def neutralize(sentence)\n words = sentence.split(' ')\n words.reject! { |word| negative?(word) }\n words.join(' ')\nend", "def neutralize(sentence)\n words = sentence.split(' ')\n words.reject! { |word| negative?(word) }\n words.join(' ')\nend", "def abbreviate_sentence(sent)\n # Write your code here\n empty_array = []\n sent.chars.each do |element|\n if element.length > 4\n element.each do |letters|\n letters.gsub(/[aeiou]/i, \" \" )\n letters << empty_array\n end\n end\n end\n p empty_array.join(\"\")\nend", "def reverse_sentence(my_sentence)\n i = 0\n each_word_array = []\n word = \"\"\n reverse_sentence = \"\"\n until i > my_sentence.length\n if my_sentence[i] != \" \" && my_sentence[i] != nil\n word += my_sentence[i]\n i += 1\n elsif my_sentence[i] == nil\n each_word_array << word\n\n (each_word_array.length - 1).times do |j|\n reverse_sentence += \"#{each_word_array[each_word_array.length - (j + 1)]}\"\n i += 1\n end\n\n return reverse_sentence += \"#{each_word_array[0]}\"\n else\n each_word_array << word\n each_word_array << my_sentence[i]\n word = \"\"\n i += 1\n end\n end\nend", "def get_sentences\n # Get initial letters of sentences.\n initial_letters = @text.scan(SENTENCE_DELIMITER).map {|i| i[-1]}\n # Get sentences by splitting text with the pattern. \n # Sentences from index 1 to end are without initial letters.\n @sentences = @text.split(SENTENCE_DELIMITER)\n # Add the initial letters back to the sentences.\n ([email protected]).each do |i|\n @sentences[i] = initial_letters[i - 1] + @sentences[i]\n end\n end", "def mumble(sentence)\n\treturn sentence if sentence.empty?\n\tsentence.downcase\nend" ]
[ "0.6751817", "0.6651616", "0.6352127", "0.6345335", "0.63288665", "0.62715745", "0.62142617", "0.61426395", "0.6118643", "0.6108057", "0.60680073", "0.6039611", "0.6026779", "0.6010147", "0.6002192", "0.60004956", "0.5993768", "0.5974419", "0.596539", "0.5942208", "0.59317195", "0.58955574", "0.5889194", "0.5878384", "0.5872258", "0.586443", "0.5856092", "0.5835165", "0.5832645", "0.5812306", "0.5810803", "0.5805189", "0.57991713", "0.5797184", "0.579456", "0.5793637", "0.57926184", "0.57912225", "0.578118", "0.57777196", "0.57671165", "0.5764434", "0.57540894", "0.574797", "0.5731249", "0.57183295", "0.5717907", "0.57014334", "0.5695704", "0.5695002", "0.56926674", "0.56825644", "0.5677574", "0.5677311", "0.5665409", "0.56566757", "0.5650464", "0.56487393", "0.56445813", "0.5641506", "0.56297755", "0.56120783", "0.5612062", "0.5610064", "0.5606134", "0.5599671", "0.55978066", "0.5597497", "0.55957395", "0.55957395", "0.55957395", "0.5594017", "0.5589158", "0.55864024", "0.55812097", "0.55703074", "0.5560651", "0.5556385", "0.555199", "0.5546846", "0.55457217", "0.554066", "0.5537077", "0.5535038", "0.5532117", "0.5521823", "0.5521673", "0.5519398", "0.55104256", "0.5498796", "0.54911447", "0.5491062", "0.5486847", "0.54849136", "0.548265", "0.548265", "0.5477877", "0.54751813", "0.5475019", "0.5468664" ]
0.5687697
51
Returns a one byte value as a packed string.
def to_s [(self.v || self.d)].pack("C") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_s\n value.unpack('B*').first[0...size]\n end", "def value_to_binary_string(value)\n #value.pack(\"V\")\n raise NotImplementedError\n end", "def encode\n s = \"#{@value}\\000\"\n\n n = 0\n @lengths.each do |l|\n s << [@types[n]].pack(\"#{punpack_string(l)}\")\n n += 1\n end\n s\n end", "def string\n Util.from_bytes :string, value\n end", "def to_s\n\t\t\treturn self.each_byte.to_a.pack( 'C*' )\n\t\tend", "def to_s\n packet = build_packet\n @packet_size = packet.length\n return [@packet_size].pack(\"V\") + packet\n end", "def encode_string(value)\n [value.bytesize, value].pack(\"L>A*\")\n end", "def bin2str(binary)\n str = [binary].pack(\"B*\")\n return str\nend", "def string\n binary.map { |i| i.to_i.to_s(16) }.join('')\n end", "def to_s\n @field.unpack('b*').first\n end", "def to_str\n bytes\n end", "def to_str\n bytes\n end", "def to_str\n bytes\n end", "def string()\n len = self.uint32()\n self.bytes(len)\n end", "def to_s\n @bits.to_s(2)\n end", "def to_s\n [0xFFFFFFFF, @content_data.string].pack('Va*')\n end", "def to_s\n bits=\"\"\n @fields.each {|f| \n if f.kind_of? Fields::Field\n bits << f.bitstring\n else\n bits << f.to_bitstring\n end\n }\n [bits].pack('B*')\n end", "def to_s\n \"%0#{size}b\" % number\n end", "def value_to_zero_one_string\n to_binary_s.unpack(\"C*\").map { |e| e.to_s(2).rjust(8, \"0\") }.join(\"\")\n end", "def value\n @bytes.pack('C*')\n end", "def to_s\na = unpack\ntmp = a[-1].unpack 'C*'\na[-1] = sprintf '%02x%02x%02x%02x%02x%02x', *tmp\n\"%08x-%04x-%04x-%02x%02x-%s\" % a\nend", "def string(val)\n val = val.to_s\n\n raise ArgumentError, \"string() cannot encode a string longer \" +\n \"than 2**32-1 bytes\" \\\n unless val.length <= 2**32-1\n\n self.uint32(val.length).bytes(val)\n end", "def to_binary()\n return self.unpack('B*').join\n end", "def to_s\n str = super\n case (str.size + 2) % 8\n when 0\n return str\n when 7\n # only on byte needed: use pad1 option\n self << Pad1.new\n str << [0].pack('C')\n else\n # use padn option\n len = 8 - 2 - (str.size % 8) - 2\n padn = Option.new(type: 'padn', value: \"\\x00\" * len)\n self << padn\n str << padn.to_s\n end\n str\n end", "def get_byte_str(byt, byte_size=nil)\n byt_str = \"\"\n\n # case byt.class.name\n # when \"Fixnum\"\n\n # byt_str = byt.to_s(16)\n # byte_size = 1 if !byte_size && byt <= 0xf\n # when \"String\"\n\n byt.reverse!\n byt_str = byt.unpack('H*h*').collect {|x| x.to_s}.join\n #end\n\n #Pad 0s upto byte_size\n byt_str = byt_str.rjust(byte_size*2, \"0\") if byte_size\n\n #Prefix with hex string '0x'\n byt_str = HEX_PREFIX + byt_str\n\n byt_str\n end", "def byte_arr_to_string arr\n arr.pack(\"c*\")\nend", "def convertBinaryToString(binary)\n # Use the pack function to encode the binary\n str = [binary].pack('b*')\n return str\n end", "def to_s\n if @reverse_byte\n @field.bytes.collect { |ea| (\"%08b\" % ea).reverse }.join[0, @size]\n else\n @field.bytes.collect { |ea| (\"%08b\" % ea) }.join[0, @size]\n end\n end", "def to_s\n @int.chr(Encoding::UTF_8)\n end", "def bytea(value)\n \"'\\\\x#{value.unpack1('H*')}'::bytea\"\n end", "def to_s\n [0xFF, 0xFF, 0xFF, 0xFF, @header_data, @content_data.string].pack('c5a*')\n end", "def binary_to_string(value)\n # TODO: Figure out what Cassandra's blobs look like\n value\n end", "def to_s\n fill\n String.from_java_bytes(@baos.toByteArray)\n end", "def pack_data value\r\n [value].pack('l>').split('').map(&:ord)\r\nend", "def to_s\n to_buffer.to_s\n end", "def serialize_value(value)\n [value.to_i].pack('N')\n end", "def serialize_to_string\n sio = ProtocolBuffers.bin_sio\n serialize(sio)\n return sio.string\n end", "def to_s\n [0, 32, @device_token, @payload.length, @payload ].pack(\"CnH*na*\")\n end", "def binary_to_text(b)\n [b].pack(\"B*\")\nend", "def to_s\n require 'stringio'\n\n sb = StringIO.new\n each { |block3|\n sb << block3.map { |block4|\n format(\"%0#{1 << BLOCK4}b\", (block4 || 0)).reverse }.join\n }\n\n # At max there will be just 1 block of extra bits\n # So we are cutting at exactly @size\n sb.string[0...@size]\n end", "def bytesize\n case value\n when NilClass\n 0\n when String\n @value.bytesize\n else\n @s ||= Marshal.dump(@value).bytesize\n end\n end", "def to_hexstr\n Common.unpackbytes(to_s)\n end", "def to_s(); self.unpad[0] end", "def byte(*bytes)\n return string(bytes.pack('C*')) \n end", "def to_binary_string(min_length = 0)\n BitMapping.number_to_binary_string(number, min_length)\n end", "def word(val)\n [val].pack(\"V\")\n end", "def to_s\n elements = bytes.unpack(\"NnnCCa6\")\n node = elements[-1].unpack('C*')\n elements[-1] = '%02x%02x%02x%02x%02x%02x' % node\n \"%08x-%04x-%04x-%02x%02x-%s\" % elements\n end", "def to_s\n @value.dup.force_encoding(Encoding.default_external)\n end", "def input_to_bitstring( value )\r\n value\r\n end", "def to_hex\n to_octet.unpack('H*').first\n end", "def to_s\n if value < 0\n sprintf(\"%0*.*o\", size + 3, size + 3, value).slice(3..-1)\n else\n sprintf(\"%0*.*o\", size, size, value)\n end\n end", "def encode\n s = \"#{punpack_string(@ts)}#{punpack_string(@ls)}\"\n [@type, @length, @value].pack(\"#{s}a*\")\n end", "def to_string_or_binary(value)\n encoding = value.encoding\n if encoding == Encoding::ASCII_8BIT\n Puppet::Pops::Types::PBinaryType::Binary.from_binary_string(value).to_s\n else\n # Transform to UTF-8 (do not assume UTF-8 is correct) with source invalid byte\n # sequences and UTF-8 undefined characters replaced by the default unicode uFFFD character\n # (black diamond with question mark).\n value.encode(Encoding::UTF_8, encoding, :invalid => :replace, :undef => :replace)\n end\n end", "def write_raw_short(val)\n buffer << [val].pack(\"S>\")\n end", "def hex2str(hex)\n [hex].pack('H*')\n end", "def encode_uint8(value)\n [value].pack(\"C\")\n end", "def content_string\n all_bytes.pack('C*') if(all_bytes)\n end", "def to_s\n\t\t\treturn @buffer.to_s\n\t\tend", "def to_s\r\n string = IOP.allocate_string(@size)\r\n @data.each {|x| string << x}\r\n string\r\n end", "def to_s(addr: nil)\n value = to_i(addr: addr)\n # TODO: don't fix the length at 64\n length = 64\n bits = (\"%0#{length}b\" % value).gsub(/(\\d)(?=(\\d\\d\\d\\d\\d\\d\\d\\d)+(?!\\d))/, '\\\\1_')\n comments = ''\n @instruction_specs.each do |_field_name, spec|\n comments += \"#{spec} \"\n end\n \"#{bits} // #{comments.strip}\"\n end", "def binary_string; end", "def pack_bytes(byte_string)\n [byte_string].pack('H*')\n end", "def as_signed_byte(value)\n [ value ].pack(\"c\").unpack(\"c\").first\n end", "def to_str() @value.to_s end", "def to_binary\n return '' unless @ready\n\n to_a.pack('C*') rescue binding.pry\n end", "def to_hex\n @value.unpack(\"H*\").join\n end", "def _pack_raw(n, size)\n n.to_s(16).rjust(2 * size, \"0\").scan(/../).reverse.map{ |b|\n [b].pack('H*')[0]\n }.join.force_encoding(\"ascii-8bit\")\nend", "def to_s\n @packet_data\n end", "def int2str(dw)\n (dw & 0xff).chr + ((dw >> 8) & 0xff).chr + ((dw >> 16) & 0xff).chr + ((dw >> 24) & 0xff).chr\nend", "def to_s\r\n @bitstring.reverse.scan(/.{1,8}/).map {|s| s.reverse}.reverse.map {|bin| \"\" << bin.to_i(2)}.join\r\n end", "def get_byte\n byte = @connection.getbyte.to_s 2\n byte = \"0\" * (8 - byte.length) + byte\n end", "def to_r\n\t\traw = value.to_s;\n\n\t\tif (self.type & TLV_META_TYPE_STRING == TLV_META_TYPE_STRING)\n\t\t\traw += \"\\x00\"\n\t\telsif (self.type & TLV_META_TYPE_UINT == TLV_META_TYPE_UINT)\n\t\t\traw = [value].pack(\"N\")\n\t\telsif (self.type & TLV_META_TYPE_BOOL == TLV_META_TYPE_BOOL)\n\t\t\tif (value == true)\n\t\t\t\traw = [1].pack(\"c\")\n\t\t\telse\n\t\t\t\traw = [0].pack(\"c\")\n\t\t\tend\n\t\tend\n\n\t\treturn [raw.length + 8, self.type].pack(\"NN\") + raw\n\tend", "def to_octet\n ECDSA::Format::FieldElementOctetString.encode(value, hasher.group.field)\n end", "def to_s\n to_hex\n end", "def bytes(val)\n val = val.to_s\n\n # Pad with zeros until length is a multiple of 4\n while val.length % 4 != 0 do\n val += \"\\0\"\n end\n\n @io.write(val)\n end", "def format_value_to_string(value)\n value.dump\n end", "def to_str\n @value.to_s\n end", "def pack(value)\n throw \"Not implemented\"\n end", "def var_bytes(val)\n val = val.to_s\n\n raise ArgumentError, \"var_bytes() cannot encode data longer \" +\n \"than 2**32-1 bytes\" \\\n unless val.length <= 2**32-1\n\n # While strings are still byte sequences, this is the same as a\n # string\n self.string(val)\n end", "def to_str()\n @value.to_s\n end", "def to_str()\n @value.to_s\n end", "def pack_int64_bigendian(value)\n (0..7).map { |index| (value >> (index * 8)) & 0xFF }.reverse.map(&:chr).join\n end", "def encode_mpint(value)\n value.to_s(0)\n end", "def int_to_binary_string(number)\n number.to_s(2)\nend", "def byte\n Util.from_bytes :byte, value\n end", "def n_to_s( n )\n s = \"\"\n while( n > 0 )\n s = ( n & 0xFF ).chr + s\n n >>= 8\n end\n s\n end", "def encode_uint64(value)\n [value].pack(\"Q>\")\n end", "def encode_uint8(int); [int].pack(PACK_FORMAT_UINT8); end", "def to_str\n value.to_s\n end", "def pack_format\n \"a#{width}\"\n end", "def to_str\n @value\n end", "def string_value\n join(\"\\0\")\n end", "def string(str)\n integer(str.bytesize, 0) + str.dup.force_encoding('binary')\n end", "def _to_bit_string(i, min_width=0)\n hexed = i.to_s(16)\n padded = true if hexed.length % 2 == 1 # prepend 0\n bitstring = [(padded ? \"0#{hexed}\" : hexed)].pack(\"H*\").unpack(\"B*\").first\n bitstring = bitstring[4,bitstring.length - 4] if padded\n (\"0\" * [min_width - bitstring.length, 0].max) + bitstring\n end", "def encode_short(val)\n raise 'Value too big for short' if val > 0xffff\n [val.to_i].pack('n')\n end", "def to_s\n format '%-6s %-8s %s', @type.to_s.upcase, @label, @bit\n end", "def get(key)\n b = get_as_bytes(key)\n\n return nil if b.nil?\n\n b.pack(\"U*\").strip\n end", "def to_s\n (0..8).collect { |r|\n @grid[r*9,9].pack('c9') # TODO\n } .join(\"\\n\").tr(BIN,ASCII)\n end", "def to_b\n return self.to_s(2)\n end", "def to_hex_string(readable = true)\n unpacked = self.unpack('H*').first\n if readable\n unpacked.gsub(/(..)/,'\\1 ').rstrip\n else\n unpacked\n end\n\tend" ]
[ "0.788072", "0.72878927", "0.72875935", "0.7246204", "0.7229513", "0.71769094", "0.7174202", "0.7141749", "0.71250767", "0.7069094", "0.705853", "0.705853", "0.705853", "0.70225877", "0.700097", "0.69838923", "0.6894329", "0.6888931", "0.6791609", "0.67694163", "0.6692308", "0.66903454", "0.6637873", "0.65646774", "0.65496427", "0.6543698", "0.65419006", "0.65399534", "0.65265316", "0.6524498", "0.6513382", "0.6496176", "0.64786035", "0.6474633", "0.647362", "0.64623827", "0.64251983", "0.64245296", "0.640792", "0.6396024", "0.63884634", "0.6380769", "0.6364641", "0.6359545", "0.6339238", "0.6296218", "0.6294408", "0.6291737", "0.6275964", "0.6265419", "0.62276644", "0.6225444", "0.6225259", "0.6216373", "0.62154895", "0.62145084", "0.62143666", "0.62009126", "0.6177709", "0.617356", "0.61655164", "0.61614674", "0.6159243", "0.6158036", "0.61504656", "0.6147347", "0.6133767", "0.61251515", "0.61250365", "0.61187994", "0.6118144", "0.6087036", "0.60649556", "0.605861", "0.60579133", "0.60522944", "0.60424805", "0.603175", "0.60154307", "0.6009569", "0.6009569", "0.60081595", "0.5996466", "0.59876597", "0.59814686", "0.5977606", "0.5977274", "0.5976124", "0.59719193", "0.5962816", "0.5959371", "0.59232587", "0.59126014", "0.59087867", "0.59062374", "0.59006494", "0.5894606", "0.58824706", "0.5877433", "0.587194" ]
0.6798357
18
GET /resellers GET /resellers.json
def index @resellers = Reseller.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def buyers\n result = get_buyers(params, false)\n render json: result, status: 200\n end", "def index\n @sellers = Seller.all\n end", "def getReseller( reseller_id)\n params = Hash.new\n params['reseller_id'] = reseller_id\n return doCurl(\"get\",\"/reseller\",params)\n end", "def index\n render json: Seller.all\n end", "def index\n @sellers = @commerce.sellers\n end", "def index\n @title = t('view.sellers.index_title')\n @sellers = Seller.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sellers }\n end\n end", "def index\n @sales_sellers = Sales::Seller.all\n end", "def show\n @seller = Seller.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @seller }\n end\n end", "def show\n @seller = Seller.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @seller }\n end\n end", "def index\n @sells = Sell.all\n\n render json: @sells\n end", "def show\n @title = t('view.sellers.show_title')\n @seller = Seller.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @seller }\n end\n end", "def seller\n response = JSON.parse(@client.get(\"items/#{send(:id)}/sellers\").body)\n Promisepay::User.new(@client, response['users'])\n end", "def seller\n response = JSON.parse(@client.get(\"items/#{send(:id)}/sellers\").body)\n Promisepay::User.new(@client, response['users'])\n end", "def seller\n response = JSON.parse(@client.get(\"items/#{send(:id)}/sellers\").body)\n Promisepay::User.new(@client, response['users'])\n end", "def sellers\r\n @sellers ||= SellersController.new(configuration: @configuration)\r\n end", "def list\n perform_request(action: 'reseller-list')\n parse_returned_params_as_list('usernames')\n end", "def sellers\n find_related_frbr_objects( :is_sold_by, :which_roles?) \n end", "def show\n render json: Agent.find(params[:id]).buyers\n end", "def listRestaurants\n _restaurants = Restaurant.all\n render json: _restaurants\n end", "def payers(params = {})\n scope 'default'\n get('payers/', params)\n end", "def show\n @seller_info = SellerInfo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @seller_info }\n end\n end", "def index\n # @sellers = Seller.order(:name)\n\n # @hash = Gmaps4rails.build_markers(@sellers) do |seller, marker|\n # marker.lat seller.latitude\n # marker.lng seller.longitude\n # marker.title seller.name\n # end\n authorize Seller\n @sellers = Seller.all\n end", "def show\n render json: @sell\n end", "def show\n @sell = Sell.find(params[:id])\n @repurchase = Repurchase.new\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @repurchase }\n end\n end", "def index\n @renters = Renter.page(params[:page]).per(10)\n end", "def index\n @selleraccounts = Selleraccount.all\n end", "def index\n @retailers = Retailer.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @retailers }\n end\n end", "def show\n @seller = Seller.find(params[:seller])\n return @seller\n end", "def index\n @offerte_regels = OfferteRegel.all\n end", "def show_seller_name\n @sellers = Seller.order(:name)\n end", "def index\n @seller_accounts = SellerAccount.all\n end", "def sellers(ids)\n list_sellers = []\n ids.each do |id|\n list_sellers << Seller.find(id)\n end\n list_sellers\n end", "def index\n @core_sellers = Core::Seller.find_mine(params).paginate(page: params[:page])\n end", "def index\n @buyers = Buyer.all\n end", "def index\n @buyers = Buyer.all\n end", "def index\n @cars = Car.all\n #@cars = Car.where({:seller_id => session[:seller_id]}).all\n #@seller = Seller.find(params[:id])\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cars }\n end\n end", "def show\n @revenue = Revenue.find(params[:id])\n\n render json: @revenue\n end", "def set_reseller\n @reseller = Reseller.find(params[:id])\n end", "def index\n @recruiters = Recruiter.all\n render_json_serializer(@recruiters)\n end", "def index\n page = params[:page] || 1\n @riders = @book.riders.page(page)\n end", "def index \n #leave this in place for future - currently allowing only one seller per user \n @seller = self.current_member.seller\n respond_to do |format|\n if @seller.nil?\n format.html { redirect_to new_member_seller_url(self.current_member) }\n else\n format.html { redirect_to member_seller_url(current_member, @seller)}\n format.xml { render :xml => @sellers.to_xml }\n end\n end\n end", "def index\n @rentable_items = RentableItem.all\n render json: @rentable_items\n end", "def show\n @seller = Seller.find(params[:id])\n \n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @seller.to_xml }\n end\n end", "def index\n @marketers = Marketer.all\n end", "def index\n respond_with(@collection) do |format|\n format.html # index.html.erb\n format.json { render json: @retailers }\n end\n end", "def index\n if(current_user.customer_id?)\n @resturants = Resturant.where(\"region_id = ?\", current_user.customer.region_id)\n else\n @resturants = Resturant.where(\"region_id = ?\", current_user.driver.region_id)\n end\n \n render json: @resturants, status: 200\n end", "def offers\n return nil unless have_key?\n url = \"/v1/offers\"\n #Hashie::Mash.new(\n self.class.post(url, :headers => headers_for(url)).parsed_response\n end", "def show\n merchant = Merchant.find(params[\"id\"])\n if params[\"date\"].nil?\n render json: RevenueSerializer.new(merchant.revenue_on_id)\n else\n render json: RevenueSerializer.new(merchant.revenue_by_date(params[\"date\"]))\n end\n end", "def index\n @prayers = Prayer.where(\"user_id = ?\", getUser())\n\n @prayer_requests = PrayerRequest.all \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @prayers }\n end\n end", "def show\n @sell = Sell.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sell }\n end\n end", "def new\n @title = t('view.sellers.new_title')\n @seller = Seller.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @seller }\n end\n end", "def new\n @seller = Seller.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @seller }\n end\n end", "def index\n @rsvps = Rsvp.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rsvps }\n end\n end", "def index\n @renters = Renter.all\n end", "def show\n @renter = Renter.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @renter }\n end\n end", "def get_reseller_accounts\r\n # Prepare query url.\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/reseller/accounts'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.get(\r\n _query_url\r\n )\r\n BasicAuth.apply(_request)\r\n _context = execute_request(_request)\r\n\r\n # Validate response against endpoint and global error codes.\r\n return nil if _context.response.status_code == 404\r\n validate_response(_context)\r\n\r\n # Return appropriate response type.\r\n _context.response.raw_body\r\n end", "def index\n if params[:user_id]\n @rents = find_user.rents\n render json: @rents\n elsif params[:book_id]\n @rents = find_book.rents\n render json: @rents\n else\n @rents = Rent.all\n render json: @rents\n end\n end", "def index\n @recruiters = Recruiter.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @recruiters }\n end\n end", "def index\n @collection = current_user.collections.find(params[:collection_id]) \n @recommenders = @collection.recommenders.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @recommenders }\n end\n end", "def getOffers\n if current_contractor || current_user\n offers_per_post = Offer.where(post_id: params[:post_id])\n @offers = offers_per_post.order(created_at: :asc).limit(10)\n\n render json: @offers.as_json(include: [{contractor: { methods: [:avatar_url] }}, :post,])\n end\n end", "def index\n @riders = Rider.all\n end", "def stats\n result = UserReservation.stats params[:id_list]\n render json: {revenue:result[:totalRevenue]}\n end", "def show\n @rater = Rater.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rater }\n end\n end", "def index\n @prayers = Prayer.all\n render json: @prayers, status: 200 # you've got a serializer. Maybe you should use it.\n end", "def index\n @offerers = Offerer.all\n end", "def index\n @supermarkets = Supermarket.all\n respond_to do |format|\n format.json { render json: @supermarkets, status: :ok } \n end \n end", "def index\n\t #@racers = Racer.all\n\t if !request.accept || request.accept == \"*/*\"\n\t\t\trender plain: \"/api/racers/#{params[:racer_id]}/entries\"\n\t\telse\n\t\t\t#real implementation ...\n\t\tend\n\t end", "def index\n json_response(Restaurant.all)\n end", "def index\n @retailers = Retailer.all\n end", "def show\n render json: @rentable_item\n end", "def index\n @sales = @saleService.all_to_json().as_json;\n end", "def show\n @rrold = Rrold.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rrold }\n end\n end", "def index\n @receivers = Receiver.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @receivers }\n end\n end", "def index\n @sales = Sale.all\n\n render json: @sales\n end", "def index\n user_id = @user.id\n @auctions = Auction.where(\"seller_id = ?\", user_id)\n\n # get all belong auctions\n render json: @auctions\n end", "def index\n skickers = Skicker.order(power: :asc)\n render json: { status: 'SUCCESS', message: 'Loaded skickers', value: skickers }\n end", "def index\n @revenue_models = RevenueModel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @revenue_models }\n end\n end", "def index\n @salers = Saler.all\n end", "def index\n @parkers = Parker.all\n\t\trespond_with @parkers\n end", "def index\n @revenue_items = RevenueItem.all\n end", "def show\n @redes = Rede.all\n end", "def show\n @reel = Reel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @reel }\n end\n end", "def index\n @offers = Offer.all\n\n render json: @offers\n end", "def allergies\n raise UserNotAuthenticated unless access_token\n\n get('records/allergies')\n end", "def get_carriers\n @transporter = Transporter.find(params[:id])\n\n render json: @transporter.carriers\n end", "def index\n @restorations = Restoration.all\n end", "def render_json\n {\n items: buyers.map { |a| BuyerPresenter.new(a).new_application_data.as_json }.to_json,\n count: total_entries\n }\n end", "def all_prices\n request :public, :get, :price\n end", "def getMerchants\n\tbegin\n\t\tresponse = RestClient.get('http://api.reimaginebanking.com/merchants?key=e0486a76005721ee6d86b140eaea2a40')\n\trescue\n\t\tputs \"error retrieving response...\"\n\tend\n\n\tmerchants = JSON.parse(response)\n\treturn merchants\nend", "def contactSeller\n userID = session[:user_id]\n sellID = params[:sell_id]\n\n uri = URI(\"http://107.170.7.58:4567/api/contact/sell\")\n parameters = {\"ext\" => \"json\", \"user_id\" => userID, \"sell_id\" => sellID}\n response = Net::HTTP.post_form(uri, parameters)\n list = JSON.parse(response.body)\n\n @response = list[0][\"kind\"]\n end", "def referrers id, date = Date.today.to_s, page = 1\n uri = \"#{BASE_URL}/gauges/#{id}/referrers?date=#{date}&page=#{page}\"\n fetch uri\n end", "def index\n @resourcers = Resourcer.all\n end", "def index\n @rents = Rent.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rents }\n end\n end", "def index\n @products = current_seller.product.all\n end", "def ratings\n Birdman::Requester.get(\"movies/#{id}/ratings\")\n end", "def index\n @restaurants = Restaurant.all\n # render json: @restaurants\n end", "def seller_params\n params[:seller]\n end", "def index\n render json: reservations\n end", "def index\n @pre_sales = PreSale.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pre_sales }\n end\n end", "def index\n @prices = Price.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @prices }\n end\n end" ]
[ "0.7240156", "0.693139", "0.6767027", "0.6755283", "0.6718882", "0.6706292", "0.6425745", "0.6425132", "0.64033175", "0.63651097", "0.63413423", "0.62723064", "0.62723064", "0.62723064", "0.6246976", "0.61726844", "0.6145422", "0.61003244", "0.6087911", "0.6042917", "0.6036944", "0.60294616", "0.59982485", "0.59717554", "0.59709173", "0.59680665", "0.5957563", "0.5946729", "0.5942252", "0.5940642", "0.5937756", "0.59370536", "0.5918241", "0.59077007", "0.59077007", "0.5870581", "0.58542466", "0.58537215", "0.58444667", "0.5826638", "0.5819606", "0.581204", "0.58083063", "0.5785208", "0.57744", "0.57706857", "0.5755691", "0.5741143", "0.57298976", "0.57209533", "0.5716404", "0.5711276", "0.5701235", "0.5698166", "0.56976146", "0.56969804", "0.5666093", "0.5665717", "0.56527907", "0.5645928", "0.5642919", "0.5638936", "0.56386614", "0.56357646", "0.5635391", "0.56313765", "0.5625276", "0.5590691", "0.5585549", "0.55848205", "0.55702996", "0.5569171", "0.5565383", "0.55634964", "0.55558974", "0.5555132", "0.5554318", "0.5552471", "0.55520725", "0.55514365", "0.5550707", "0.5544341", "0.5541564", "0.5537932", "0.5533104", "0.5519612", "0.551531", "0.55083865", "0.55045056", "0.54981536", "0.54821455", "0.54806876", "0.5480441", "0.5478445", "0.5468059", "0.5455214", "0.5453711", "0.54418117", "0.5438494", "0.54328656" ]
0.75359005
0
GET /resellers/1 GET /resellers/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @resellers = Reseller.all\n end", "def getReseller( reseller_id)\n params = Hash.new\n params['reseller_id'] = reseller_id\n return doCurl(\"get\",\"/reseller\",params)\n end", "def buyers\n result = get_buyers(params, false)\n render json: result, status: 200\n end", "def index\n @sellers = Seller.all\n end", "def index\n @title = t('view.sellers.index_title')\n @sellers = Seller.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sellers }\n end\n end", "def index\n @sellers = @commerce.sellers\n end", "def show\n @seller = Seller.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @seller }\n end\n end", "def show\n @seller = Seller.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @seller }\n end\n end", "def show\n @title = t('view.sellers.show_title')\n @seller = Seller.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @seller }\n end\n end", "def index\n render json: Seller.all\n end", "def seller\n response = JSON.parse(@client.get(\"items/#{send(:id)}/sellers\").body)\n Promisepay::User.new(@client, response['users'])\n end", "def seller\n response = JSON.parse(@client.get(\"items/#{send(:id)}/sellers\").body)\n Promisepay::User.new(@client, response['users'])\n end", "def seller\n response = JSON.parse(@client.get(\"items/#{send(:id)}/sellers\").body)\n Promisepay::User.new(@client, response['users'])\n end", "def show\n @sell = Sell.find(params[:id])\n @repurchase = Repurchase.new\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @repurchase }\n end\n end", "def show\n @seller_info = SellerInfo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @seller_info }\n end\n end", "def show\n @seller = Seller.find(params[:seller])\n return @seller\n end", "def show\n render json: Agent.find(params[:id]).buyers\n end", "def index\n @sells = Sell.all\n\n render json: @sells\n end", "def index\n @sales_sellers = Sales::Seller.all\n end", "def set_reseller\n @reseller = Reseller.find(params[:id])\n end", "def show\n @revenue = Revenue.find(params[:id])\n\n render json: @revenue\n end", "def new\n @title = t('view.sellers.new_title')\n @seller = Seller.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @seller }\n end\n end", "def show\n render json: @sell\n end", "def show\n @seller = Seller.find(params[:id])\n \n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @seller.to_xml }\n end\n end", "def new\n @seller = Seller.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @seller }\n end\n end", "def show\n merchant = Merchant.find(params[\"id\"])\n if params[\"date\"].nil?\n render json: RevenueSerializer.new(merchant.revenue_on_id)\n else\n render json: RevenueSerializer.new(merchant.revenue_by_date(params[\"date\"]))\n end\n end", "def show\n @sell = Sell.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sell }\n end\n end", "def sellers\r\n @sellers ||= SellersController.new(configuration: @configuration)\r\n end", "def show\n @renter = Renter.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @renter }\n end\n end", "def show\n @rater = Rater.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rater }\n end\n end", "def index\n page = params[:page] || 1\n @riders = @book.riders.page(page)\n end", "def show_seller_name\n @sellers = Seller.order(:name)\n end", "def show\n @repairer = Repairer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @repairer }\n end\n end", "def index\n @buyers = Buyer.all\n end", "def index\n @buyers = Buyer.all\n end", "def payers(params = {})\n scope 'default'\n get('payers/', params)\n end", "def index\n @cars = Car.all\n #@cars = Car.where({:seller_id => session[:seller_id]}).all\n #@seller = Seller.find(params[:id])\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cars }\n end\n end", "def show\n @reel = Reel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @reel }\n end\n end", "def show\r\n rating = Rating.where(rater_id: current_user.id, ratee_id: params[:id]).first\r\n render json: rating\r\n end", "def index\n @core_sellers = Core::Seller.find_mine(params).paginate(page: params[:page])\n end", "def index\n @selleraccounts = Selleraccount.all\n end", "def index\n @retailers = Retailer.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @retailers }\n end\n end", "def index \n #leave this in place for future - currently allowing only one seller per user \n @seller = self.current_member.seller\n respond_to do |format|\n if @seller.nil?\n format.html { redirect_to new_member_seller_url(self.current_member) }\n else\n format.html { redirect_to member_seller_url(current_member, @seller)}\n format.xml { render :xml => @sellers.to_xml }\n end\n end\n end", "def show\n @rrold = Rrold.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rrold }\n end\n end", "def show\n @supermarket = Supermarket.find(params[:id])\n respond_to do |format|\n format.json { render json: @supermarket, status: :ok } \n end \n end", "def show\n render json: @rentable_item\n end", "def index\n @seller_accounts = SellerAccount.all\n end", "def index\n @renters = Renter.page(params[:page]).per(10)\n end", "def index\n @recruiters = Recruiter.all\n render_json_serializer(@recruiters)\n end", "def rental(rental, options = {})\n get(\"rentals/#{rental}\", options).pop\n end", "def listRestaurants\n _restaurants = Restaurant.all\n render json: _restaurants\n end", "def index\n @marketers = Marketer.all\n end", "def index\n @offerte_regels = OfferteRegel.all\n end", "def index\n @recruiters = Recruiter.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @recruiters }\n end\n end", "def index\n @rentable_items = RentableItem.all\n render json: @rentable_items\n end", "def index\n # @sellers = Seller.order(:name)\n\n # @hash = Gmaps4rails.build_markers(@sellers) do |seller, marker|\n # marker.lat seller.latitude\n # marker.lng seller.longitude\n # marker.title seller.name\n # end\n authorize Seller\n @sellers = Seller.all\n end", "def referrers id, date = Date.today.to_s, page = 1\n uri = \"#{BASE_URL}/gauges/#{id}/referrers?date=#{date}&page=#{page}\"\n fetch uri\n end", "def new\n @seller_info = SellerInfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @seller_info }\n end\n end", "def seller\n\t\tself.sellers.last\n\tend", "def sellers\n find_related_frbr_objects( :is_sold_by, :which_roles?) \n end", "def stats\n result = UserReservation.stats params[:id_list]\n render json: {revenue:result[:totalRevenue]}\n end", "def index\n @supermarkets = Supermarket.all\n respond_to do |format|\n format.json { render json: @supermarkets, status: :ok } \n end \n end", "def index\n @riders = Rider.all\n end", "def contactSeller\n userID = session[:user_id]\n sellID = params[:sell_id]\n\n uri = URI(\"http://107.170.7.58:4567/api/contact/sell\")\n parameters = {\"ext\" => \"json\", \"user_id\" => userID, \"sell_id\" => sellID}\n response = Net::HTTP.post_form(uri, parameters)\n list = JSON.parse(response.body)\n\n @response = list[0][\"kind\"]\n end", "def show\n @beer = Beer.find(params[:id])\n @rating = Rating.new\n @rating.beer = @beer\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @beer }\n end\n end", "def index\n @rsvps = Rsvp.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rsvps }\n end\n end", "def index\n @salers = Saler.all\n end", "def new\n\t\tif params[:person_id]\n\t\t\t@seller = Seller.new(:person_id => params[:person_id])\n\t\telse\n \t@seller = Seller.new\n\t\tend\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @seller }\n end\n end", "def index\n if(current_user.customer_id?)\n @resturants = Resturant.where(\"region_id = ?\", current_user.customer.region_id)\n else\n @resturants = Resturant.where(\"region_id = ?\", current_user.driver.region_id)\n end\n \n render json: @resturants, status: 200\n end", "def index\n if params[:user_id]\n @rents = find_user.rents\n render json: @rents\n elsif params[:book_id]\n @rents = find_book.rents\n render json: @rents\n else\n @rents = Rent.all\n render json: @rents\n end\n end", "def show\n @retailer = Retailer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @retailer }\n end\n end", "def show\n @retailer = Retailer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @retailer }\n end\n end", "def index\n @collection = current_user.collections.find(params[:collection_id]) \n @recommenders = @collection.recommenders.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @recommenders }\n end\n end", "def show\n @breadcrumb = 'read'\n @sale_offer = SaleOffer.find(params[:id])\n @items = @sale_offer.sale_offer_items.paginate(:page => params[:page], :per_page => per_page).order('id')\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sale_offer }\n end\n end", "def show\n @vessel = Vessel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vessel }\n end\n end", "def index\n @prayers = Prayer.where(\"user_id = ?\", getUser())\n\n @prayer_requests = PrayerRequest.all \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @prayers }\n end\n end", "def show\n @collection = current_user.collections.find(params[:collection_id]) \n @recommender = @collection.recommenders.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recommender }\n end\n end", "def sellers(ids)\n list_sellers = []\n ids.each do |id|\n list_sellers << Seller.find(id)\n end\n list_sellers\n end", "def index\n respond_with(@collection) do |format|\n format.html # index.html.erb\n format.json { render json: @retailers }\n end\n end", "def index\n @sales = Sale.all\n\n render json: @sales\n end", "def check_ranked_beer\n render json: Beer.find_by(beer_id: params[:beerId])\n end", "def index\n @revenue_items = RevenueItem.all\n end", "def show\n render json: @sale\n end", "def index\n @product = @seller.products.find(params[:product_id]) \n end", "def show\n @revenue_model = RevenueModel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @revenue_model }\n end\n end", "def show\n @rebate = Rebate.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rebate }\n end\n end", "def show_beer\n render json: BreweryDb::ShowBeer.new(params[:beerId]).results\n end", "def list\n perform_request(action: 'reseller-list')\n parse_returned_params_as_list('usernames')\n end", "def show\n @borrower = Borrower.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @borrower }\n end\n end", "def show\n @recommender = User.where(username: params[:username]).first.recommender\n if @recommender.nil?\n render json: \"No Recommender of this user found\"\n else\n render json: @recommender.to_json(only: :latest_recommendation)\n end\n end", "def show\n @buyer = Buyer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @buyer }\n end\n end", "def index\n @renters = Renter.all\n end", "def index\n @offerers = Offerer.all\n end", "def index\n @sales = @saleService.all_to_json().as_json;\n end", "def ratings\n Birdman::Requester.get(\"movies/#{id}/ratings\")\n end", "def set_seller\n @seller = Seller.find(params[:id])\n end", "def show\n @beer = BreweryDB.beer(params[:id]) \n render json: @beer\n end", "def index\n user_id = @user.id\n @auctions = Auction.where(\"seller_id = ?\", user_id)\n\n # get all belong auctions\n render json: @auctions\n end", "def index\n render json: reservations\n end", "def show\n @retailer = Retailer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @retailer }\n end\n end", "def show\n @recruiter = Recruiter.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recruiter }\n end\n end" ]
[ "0.7352159", "0.7007593", "0.69116247", "0.6756099", "0.67179024", "0.6687764", "0.66867924", "0.6662058", "0.66377115", "0.6596913", "0.6419346", "0.6419346", "0.6419346", "0.63198936", "0.63085866", "0.62620544", "0.6254243", "0.6248468", "0.62175024", "0.61864823", "0.6166232", "0.6105482", "0.605672", "0.6042916", "0.6042586", "0.60183567", "0.6000537", "0.59952843", "0.5943519", "0.5937328", "0.58881325", "0.5871015", "0.5870143", "0.58634263", "0.58634263", "0.58610034", "0.5860302", "0.5835951", "0.5793721", "0.5793082", "0.5792374", "0.57824785", "0.57813454", "0.5778226", "0.5766095", "0.5753997", "0.5753252", "0.5753249", "0.5751643", "0.57312745", "0.57241553", "0.5716558", "0.5696406", "0.5695396", "0.56882435", "0.56867063", "0.567758", "0.5675055", "0.56634724", "0.5655667", "0.5639966", "0.56264794", "0.5622785", "0.5621162", "0.56180155", "0.56158257", "0.56102955", "0.5609914", "0.56084394", "0.56050473", "0.55929106", "0.55929106", "0.5591569", "0.558212", "0.55817324", "0.55719733", "0.55705696", "0.5566516", "0.5560251", "0.55525595", "0.5552019", "0.5550238", "0.5548325", "0.55407", "0.5540213", "0.5539514", "0.5534237", "0.55340284", "0.55275583", "0.5527001", "0.5526699", "0.5522785", "0.5520834", "0.551805", "0.5508432", "0.5507162", "0.5498686", "0.5493838", "0.54923534", "0.5488574", "0.5484492" ]
0.0
-1
POST /resellers POST /resellers.json
def create @reseller = Reseller.new(reseller_params) respond_to do |format| if @reseller.save ResellerMailer.welcome_email(@reseller).deliver_now ResellerMailer.new_signup_email(@reseller).deliver_now format.html { redirect_to thankyou_path from: 'reseller' } format.json { render :show, status: :created, location: @reseller } else format.html { render :new } format.json { render json: @reseller.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @renter = Renter.new(params[:renter])\n @locals = User.where(:city => @buyer.city)\n @users = @locals.random(5)\n respond_to do |format|\n if @renter.save\n @users.each do |user|\n RenterMailer.registration_welcome(@renter, user).deliver\n Renter.increment_counter(\"times_forwarded\", @renter.id)\n end\n format.html { redirect_to :submitted_page, :notice => 'Seller was successfully created.' }\n format.json { render :json => @renter, :status => :created, :location => @renter }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @renter.errors, :status => :unprocessable_entity }\n end\n end\n end", "def index\n @resellers = Reseller.all\n end", "def create\n @title = t('view.sellers.new_title')\n @seller = Seller.new(params[:seller])\n\n respond_to do |format|\n if @seller.save\n format.html { redirect_to @seller, notice: t('view.sellers.correctly_created') }\n format.json { render json: @seller, status: :created, location: @seller }\n else\n format.html { render action: 'new' }\n format.json { render json: @seller.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @seller = Seller.new(params[:seller])\n\n respond_to do |format|\n if @seller.save\n format.html { redirect_to @seller, :notice => 'Seller was successfully created.' }\n format.json { render :json => @seller, :status => :created, :location => @seller }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @seller.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @seller = Seller.new(params[:seller])\n \n respond_to do |format|\n if @seller.save\n format.html { redirect_to @seller, notice: 'Seller was successfully created.' }\n format.json { render json: @seller, status: :created, location: @seller }\n else\n format.html { render action: \"new\" }\n format.json { render json: @seller.errors, status: :unprocessable_entity }\n end\n end\n end", "def reseller_params\n params.require(:reseller).permit(:provider_id,\n :first_name, :last_name,\n :email,\n :phone,\n :best_time, :best_way,\n :business_name,\n :business_phone,\n :street_address_1,\n :street_address_2,\n :city, :state, :zip,\n :interested,\n :number_computers,\n :want_internet,\n :want_television,\n :want_phone,\n :number_televisions,\n :number_phones,\n :other_provider,\n :referrer_id,\n :other_referrer\n )\n end", "def buyers\n result = get_buyers(params, false)\n render json: result, status: 200\n end", "def create\n # @seller = Seller.new(seller_params)\n\n # respond_to do |format|\n # if @seller.save\n # format.html { redirect_to sellers_url, notice: \"Seller #{@seller.name} was successfully created.\"}\n # format.json { render action: 'show', status: :created, location: @seller }\n # else\n # format.html { render action: 'new' }\n # format.json { render json: @seller.errors, status: :unprocessable_entity }\n # end\n # end\n end", "def set_reseller\n @reseller = Reseller.find(params[:id])\n end", "def seller_params\n params.require(:seller).permit(:name, :reputation, :email, :location)\n end", "def create\n @store = Store.new(store_params)\n @store.commerce = @commerce\n @seller = Seller.new\n respond_to do |format|\n if @store.save\n @seller.store=@store\n @seller.commerce = @commerce\n @seller.user_id=current_user.id\n @seller.slug=current_user.cedula\n puts \"DATOS DE VENDEDOR *******\"\n puts @seller.to_json\n @seller.save\n format.html { redirect_to owner_commerce_stores_path(@store.commerce.slug), notice: 'Tienda creada exitosamente.' }\n format.json { render :show, status: :created, location: @store }\n else\n format.html { render :new }\n format.json { render json: @store.errors, status: :unprocessable_entity }\n end\n end\n end", "def create \n num_days = (Date.parse(params['rent_info']['end_date']).mjd - Date.parse(params['rent_info']['start_date']).mjd) \n total = num_days * params['rent_info']['price_per_day']\n # byebug\n if User.find(params['rent_info']['owner_id'])\n user = User.find(params['rent_info']['owner_id'])\n user.money_made += total \n user.save\n end\n\n renter_post = RenterPost.create(\n renter_id: params['rent_info']['renter_id'],\n post_id: params['rent_info'][\"post_id\"],\n start_date: params['rent_info'][\"start_date\"],\n end_date: params['rent_info'][\"end_date\"],\n status: params['rent_info'][\"status\"]\n )\n if renter_post \n render json: renter_post\n else\n render json: {error: \"Could not create Renter Post\"}\n end\n end", "def create\n @sell = Sell.new(sell_params)\n\n if @sell.save\n render json: @sell, status: :created, location: @sell\n else\n render json: @sell.errors, status: :unprocessable_entity\n end\n end", "def create\n @seller_review = SellerReview.new(seller_review_params)\n @seller_review.reviewer_id = current_user.id\n\n\n respond_to do |format|\n if @seller_review.save\n User.find(@seller_review.seller_id).seller_reviews << @seller_review\n format.html { redirect_to @seller_review, notice: 'Seller review was successfully created.' }\n format.json { render :show, status: :created, location: @seller_review}\n else\n format.html { render :new }\n format.json { render json: @seller_review.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @renter = Renter.new(renter_params)\n\n respond_to do |format|\n if @renter.save\n format.html { redirect_to @renter, notice: 'Renter was successfully created.' }\n format.json { render :show, status: :created, location: @renter }\n else\n format.html { render :new }\n format.json { render json: @renter.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n parameters = create_seller_params\n parameters[:rut] = rut_formatter(parameters[:rut])\n parameters[:name] = parameters[:name].titleize\n parameters[:user_name] = remove_non_alnum(remove_accent_marks(parameters[:name])).downcase\n parameters[:password] = parameters[:rut].tr('.','').tr('-','')[-5..-2]\n parameters[:num_of_logins] = 0\n parameters[:institution_id] = Admin.find(session[:admin_id]).institution_id\n parameters[:group_id] = params[:group_id]\n @seller = Seller.new(parameters)\n\n respond_to do |format|\n if @seller.save\n @seller.init_seller\n format.html { redirect_to sellers_url, notice: \"Se creó el vendedor #{parameters[:name]}!\" }\n format.json { render :show, status: :created, location: @seller }\n else\n format.html { render :new }\n format.json { render json: @seller.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @title = t('view.sellers.new_title')\n @seller = Seller.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @seller }\n end\n end", "def create\n @reel = Reel.new(params[:reel])\n\n respond_to do |format|\n if @reel.save\n format.html { redirect_to @reel, notice: 'Reel was successfully created.' }\n format.json { render json: @reel, status: :created, location: @reel }\n else\n format.html { render action: \"new\" }\n format.json { render json: @reel.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @seller = Seller.new(seller_params)\n @seller.commerce = @commerce\n @seller.user.role_id = seller_role\n respond_to do |format|\n if @seller.save\n format.html { redirect_to owner_commerce_sellers_path(@seller.commerce.slug), notice: 'Vendedor creado exitosamente.' }\n format.json { render :show, status: :created, location: @seller }\n else\n format.html { render :new }\n format.json { render json: @seller.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @seller = Seller.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @seller }\n end\n end", "def getReseller( reseller_id)\n params = Hash.new\n params['reseller_id'] = reseller_id\n return doCurl(\"get\",\"/reseller\",params)\n end", "def seller_params\n params.require(:seller).permit(:name, :email, :password, :firm, :produce, :produce_price, :wepay_access_token, :wepay_account_id)\n end", "def create\n @rower = Rower.new(rower_params)\n\n respond_to do |format|\n if @rower.save\n format.html { redirect_to @rower, notice: 'Rower was successfully created.' }\n format.json { render :show, status: :created, location: @rower }\n else\n format.html { render :new }\n format.json { render json: @rower.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n userID = session[:user_id]\n editionID = params[:edition_id]\n price = params[:price]\n\n uri = URI(\"http://107.170.7.58:4567/api/create/sell\")\n parameters = {\"ext\" => \"json\", \"user_id\" => userID, \"edition_id\" => editionID, \"price\" => price, \"start_date\" => Time.now, \"end_date\" => 90.days.from_now}\n response = Net::HTTP.post_form(uri, parameters)\n list = JSON.parse(response.body)\n\n @response = list[0][\"kind\"]\n end", "def create\n @engineer = Engineer.new(engineer_params)\n r = Rentee.find(params[:rentee_id])\n @engineer.rentee = r\n if @engineer.save\n end\n\n respond_to do |format|\n if @engineer.save\n format.html { redirect_to [@engineer.rentee, @engineer], notice: 'Engineer was successfully created.' }\n format.json { render :show, status: :created, location: @engineer }\n else\n format.html { render :new }\n format.json { render json: @engineer.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @sales_seller = Sales::Seller.new(sales_seller_params)\n\n respond_to do |format|\n if @sales_seller.save\n\n format.html { redirect_to @sales_seller, notice: \"Vendedor adicionado com sucesso!\" }\n format.json { render :show, status: :created, location: @sales_seller }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @sales_seller.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n rental = sporting_goods.rentals.new(rental_params)\n rental.user_id = current_user.id\n if rental.save\n render json: rental, status: 200\n else\n render json: rental, status: 400\n end\n end", "def destroy\n @reseller.destroy\n respond_to do |format|\n format.html { redirect_to resellers_url, notice: 'Reseller was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def create\n @rr_sale = RrSale.new(params[:rr_sale])\n @rr_sale.user_id=current_user.id\n helper_choose_seller @rr_sale\n respond_to do |format|\n if @rr_sale.save\n flash[:notice] = 'RrSale was successfully created.'\n format.html { redirect_to(@rr_sale) }\n format.xml { render :xml => @rr_sale, :status => :created, :location => @rr_sale }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @rr_sale.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @seller = Seller.new(seller_params)\n\n respond_to do |format|\n if @seller.save\n session[:seller_id] = @seller.id\n format.html { redirect_to @seller, notice: 'Seller was successfully created.' }\n format.json { render :show, status: :created, location: @seller }\n else\n format.html { render :new }\n format.json { render json: @seller.errors, status: :unprocessable_entity }\n end\n end\n end", "def sell_register (payload, params={})\r\n url = api_url \"/sell/register\"\r\n load = MultiJson.dump payload\r\n req = request_params(params)\r\n\r\n feed_or_retry do\r\n RestClient.post url, load, req \r\n end \r\n end", "def postEntityAdvertiserRenew( entity_id, expiry_date, publisher_id, reseller_ref, reseller_agent_id)\n params = Hash.new\n params['entity_id'] = entity_id\n params['expiry_date'] = expiry_date\n params['publisher_id'] = publisher_id\n params['reseller_ref'] = reseller_ref\n params['reseller_agent_id'] = reseller_agent_id\n return doCurl(\"post\",\"/entity/advertiser/renew\",params)\n end", "def contactSeller\n userID = session[:user_id]\n sellID = params[:sell_id]\n\n uri = URI(\"http://107.170.7.58:4567/api/contact/sell\")\n parameters = {\"ext\" => \"json\", \"user_id\" => userID, \"sell_id\" => sellID}\n response = Net::HTTP.post_form(uri, parameters)\n list = JSON.parse(response.body)\n\n @response = list[0][\"kind\"]\n end", "def create\n @reemper_valoration = ReemperValoration.create(user_id: params[:user_id], reemper_id: params[:reemper_id], valoration: params[:valoration], description: params[:description])\n\n respond_to do |format|\n if @reemper_valoration.save\n format.js\n format.json { render :show, status: :created, location: @reemper_valoration }\n else\n format.html { render :new }\n format.json { render json: @reemper_valoration.errors, status: :unprocessable_entity }\n end\n end\n end", "def seller_params\n params[:seller]\n end", "def index\n @sellers = Seller.all\n end", "def seller_params\n params.require(:seller).permit(:user_id, :seller_date, :displayed_name, :seller_description, :seller_email)\n end", "def create_rental(options = {})\n post(:rentals, rentals: [options]).pop\n end", "def index\n render json: Seller.all\n end", "def create\n @rater = Rater.new(params[:rater])\n\n respond_to do |format|\n if @rater.save\n format.html { redirect_to @rater, notice: 'Rater was successfully created.' }\n format.json { render json: @rater, status: :created, location: @rater }\n else\n format.html { render action: \"new\" }\n format.json { render json: @rater.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @reseller.update(reseller_params)\n format.html { redirect_to @reseller, notice: 'Reseller was successfully updated.' }\n format.json { render :show, status: :ok, location: @reseller }\n else\n format.html { render :edit }\n format.json { render json: @reseller.errors, status: :unprocessable_entity }\n end\n end\n end", "def postEntityClaimReseller( entity_id)\n params = Hash.new\n params['entity_id'] = entity_id\n return doCurl(\"post\",\"/entity/claim/reseller\",params)\n end", "def retailer_params\n params.require(:retailer).permit(:book_id, :price, :name, :shipping_cost, :price)\n end", "def index\n @sellers = @commerce.sellers\n end", "def seller\n response = JSON.parse(@client.get(\"items/#{send(:id)}/sellers\").body)\n Promisepay::User.new(@client, response['users'])\n end", "def seller\n response = JSON.parse(@client.get(\"items/#{send(:id)}/sellers\").body)\n Promisepay::User.new(@client, response['users'])\n end", "def seller\n response = JSON.parse(@client.get(\"items/#{send(:id)}/sellers\").body)\n Promisepay::User.new(@client, response['users'])\n end", "def create\n raise HttpException.new(402, \"Agree to terms!\") unless current_user.customer_object.has_agreed_terms?\n raise HttpException.new(402, \"Unpaid subscription!\") if !current_user.active_account? && !current_user.customer_object.trial_active?\n\n if params[:market_id]\n market = Market.find(params[:market_id])\n #Eventing.report(current_user, 'createRoster', :contest_type => contest_type.name, :buy_in => contest_type.buy_in)\n raise HttpException.new(403, \"This market is closed\") unless Market.find(params[:market_id]).accepting_rosters?\n in_progress_rosters = current_user.rosters.where(:state => 'in_progress')\n in_progress_rosters.first.destroy if in_progress_rosters.count > 5\n Eventing.report(current_user, 'createRoster', :buy_in => Roster::DEFAULT_BUY_IN)\n roster = Roster.create!(:owner_id => current_user.id,\n :market_id => market.id,\n :takes_tokens => false,\n :buy_in => Roster::DEFAULT_BUY_IN,\n :remaining_salary => Roster::DEFAULT_REMAINING_SALARY,\n :state => 'in_progress')\n else\n contest_type = ContestType.find(params[:contest_type_id])\n Eventing.report(current_user, 'createRoster', :contest_type => contest_type.name, :buy_in => contest_type.buy_in)\n roster = Roster.generate(current_user, contest_type)\n end\n\n existing_roster = Roster.find(params[:copy_roster_id]) if params[:copy_roster_id]\n roster.build_from_existing(existing_roster) if existing_roster\n render_api_response roster\n end", "def create\n @rebateable = find_rebateable\n @rebate = @rebateable.rebates.build(params[:rebate])\n @sector_names = params[:sector_names] || []\n @industry_names = params[:industry_names] || []\n @rebate.tag_names = @sector_names.join(',') + \",\" + @industry_names.join(',')\n\n respond_to do |format|\n if @rebate.save\n format.html { redirect_to :id => nil }\n format.json { render json: @rebate, status: :created, location: @rebate }\n else\n format.html { render action: \"new\" }\n format.json { render json: @rebate.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @reprodutor = Reprodutor.new(reprodutor_params)\n\n respond_to do |format|\n if @reprodutor.save\n format.html { redirect_to @reprodutor, notice: 'Reprodutor was successfully created.' }\n format.json { render action: 'show', status: :created, location: @reprodutor }\n else\n format.html { render action: 'new' }\n format.json { render json: @reprodutor.errors, status: :unprocessable_entity }\n end\n end\n end", "def seller_params\n params.require(:seller).permit(:name, :address)\n end", "def create\n @offerte_regel = OfferteRegel.new(offerte_regel_params)\n\n respond_to do |format|\n if @offerte_regel.save\n format.html { redirect_to @offerte_regel, notice: 'Offerte regel was successfully created.' }\n format.json { render :show, status: :created, location: @offerte_regel }\n else\n format.html { render :new }\n format.json { render json: @offerte_regel.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @marketer = Marketer.new(marketer_params)\n\n respond_to do |format|\n if @marketer.save\n format.html { redirect_to @marketer, notice: 'Marketer was successfully created.' }\n format.json { render :show, status: :created, location: @marketer }\n else\n format.html { render :new }\n format.json { render json: @marketer.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @seller_info = SellerInfo.new(params[:seller_info])\n\n respond_to do |format|\n if @seller_info.save\n format.html { redirect_to @seller_info, notice: 'Seller info was successfully created.' }\n format.json { render json: @seller_info, status: :created, location: @seller_info }\n else\n format.html { render action: \"new\" }\n format.json { render json: @seller_info.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n if params[:id]\n @revenue = Revenue.find(params[:id])\n @revenue.name = params[:name];\n @revenue.description = params[:description];\n @revenue.status = 1;\n if @revenue.save\n render :json => @revenue\n else\n render :json => @revenue.errors.full_messages, status: :unprocessable_entity\n end\n else\n @revenue = Revenue.new\n @revenue.name = params[:revenue_name];\n @revenue.description = params[:revenue_desc];\n @revenue.status = 1;\n if @revenue.save\n render :json => @revenue\n else\n render :json => @revenue.errors.full_messages, status: :unprocessable_entity\n end\n end\n end", "def create\n @renter = Renter.new(renter_params)\n if @renter.save\n flash[:success] = \"Yeni kiracı başarıyla eklendi.\"\n redirect_to renters_path\n else\n render 'new'\n end\n end", "def create\n @rrold = Rrold.new(params[:rrold])\n\n respond_to do |format|\n if @rrold.save\n format.html { redirect_to @rrold, notice: 'Rrold was successfully created.' }\n format.json { render json: @rrold, status: :created, location: @rrold }\n else\n format.html { render action: \"new\" }\n format.json { render json: @rrold.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_seller_params\n params.require(:seller).permit(:name, :rut, :group_id, :institution_id)\n end", "def create\n @retailer = Retailer.new(params[:retailer])\n\n respond_to do |format|\n if @retailer.save\n format.html { redirect_to @retailer, notice: \"Retailer was successfully created.\" }\n format.json { render json: @retailer, status: :created, location: @retailer }\n else\n format.html { render action: \"new\" }\n format.json { render json: @retailer.errors, status: :unprocessable_entry }\n end\n end\n end", "def create\n @retailer = Retailer.new(params[:retailer])\n\n respond_to do |format|\n if @retailer.save\n format.html { redirect_to @retailer, notice: 'Retailer was successfully created.' }\n format.json { render json: @retailer, status: :created, location: @retailer }\n else\n format.html { render action: \"new\" }\n format.json { render json: @retailer.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n # @retailer = Retailer.new(params[:retailer])\n respond_to do |format|\n if @retailer.save\n format.html { redirect_to @retailer, notice: 'Retailer was successfully created.' }\n format.json { render json: @retailer, status: :created, location: @retailer }\n else\n format.html { render action: \"new\" }\n format.json { render json: @retailer.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @railscareer = Railscareer.new(railscareer_params)\n\n respond_to do |format|\n if @railscareer.save\n format.html { redirect_to @railscareer, notice: 'Railscareer was successfully created.' }\n format.json { render action: 'show', status: :created, location: @railscareer }\n else\n format.html { render action: 'new' }\n format.json { render json: @railscareer.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @selleraccount = Selleraccount.new(selleraccount_params)\n\n respond_to do |format|\n if @selleraccount.save\n format.html { redirect_to @selleraccount, notice: 'Selleraccount was successfully created.' }\n format.json { render :show, status: :created, location: @selleraccount }\n else\n format.html { render :new }\n format.json { render json: @selleraccount.errors, status: :unprocessable_entity }\n end\n end\n end", "def renter_params\n params.require(:renter).permit(:renterID, :provider, :renterName, :oauth_token, :oauth_expires_at, :cCN, :tickets, :numRents, :birthday)\n end", "def offers\n return nil unless have_key?\n url = \"/v1/offers\"\n #Hashie::Mash.new(\n self.class.post(url, :headers => headers_for(url)).parsed_response\n end", "def new\n @seller_info = SellerInfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @seller_info }\n end\n end", "def show\n @sell = Sell.find(params[:id])\n @repurchase = Repurchase.new\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @repurchase }\n end\n end", "def sellers\r\n @sellers ||= SellersController.new(configuration: @configuration)\r\n end", "def index\n @title = t('view.sellers.index_title')\n @sellers = Seller.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sellers }\n end\n end", "def create\n @repurchase = Repurchase.new(params[:repurchase])\n\n respond_to do |format|\n if @repurchase.save\n format.html { redirect_to @repurchase, notice: 'Repurchase was successfully created.' }\n format.json { render json: @repurchase, status: :created, location: @repurchase }\n else\n format.html { render action: \"new\" }\n format.json { render json: @repurchase.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @sells = Sell.all\n\n render json: @sells\n end", "def create\n @saler = Saler.new(saler_params)\n\n respond_to do |format|\n if @saler.save\n format.html { redirect_to @saler, notice: 'Saler was successfully created.' }\n format.json { render :show, status: :created, location: @saler }\n else\n format.html { render :new }\n format.json { render json: @saler.errors, status: :unprocessable_entity }\n end\n end\n end", "def rate_post(rating)\n mock_request = Rack::MockRequest.new(APP)\n mock_request.put(rate_post_endpoint, { 'router.params' => { rating: rating }, format: :json })\n end", "def create\n @renter = Renter.new(renter_params)\n @renter.user = current_user\n\n respond_to do |format|\n if @renter.save\n format.html {\n if current_user.has_role?(:realtor) || current_user.has_role?(:vip_realtor)\n redirect_to root_path, notice: 'Заявка отправлена'\n else\n redirect_to @renter, notice: 'Запись успешно добавлена.'\n end\n }\n format.json { render action: 'show', status: :created, location: @renter }\n else\n format.html { render action: 'new' }\n format.json { render json: @renter.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @retailer = Retailer.new(retailer_params)\n\n respond_to do |format|\n if @retailer.save\n format.html { redirect_to @retailer, notice: 'Retailer was successfully created.' }\n format.json { render :show, status: :created, location: @retailer }\n else\n format.html { render :new }\n format.json { render json: @retailer.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @buyer = Buyer.new(params[:buyer])\n @locals = User.where(:city => @buyer.city)\n @users = @locals.random(5)\n respond_to do |format|\n if @buyer.save\n @users.each do |user|\n BuyerMailer.registration_welcome(@buyer, user).deliver\n Buyer.increment_counter(\"times_forwarded\", @buyer.id)\n end\n format.html { redirect_to :submitted_page, :notice => 'Seller was successfully created.' }\n format.json { render :json => @buyer, :status => :created, :location => @buyer }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @buyer.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @seller_account = SellerAccount.new(seller_account_params)\n\n respond_to do |format|\n if @seller_account.save\n format.html { redirect_to @seller_account, notice: 'Seller account was successfully created.' }\n format.json { render :show, status: :created, location: @seller_account }\n else\n format.html { render :new }\n format.json { render json: @seller_account.errors, status: :unprocessable_entity }\n end\n end\n end", "def seller_params\n params.require(:seller).permit(:email, :password, :password_confirmation)\n end", "def create\n @resto = Resto.new(resto_params)\n\n respond_to do |format|\n if @resto.save\n format.html { redirect_to @resto, notice: 'Entry was successfully created.' }\n format.json { render :show, status: :created, location: @resto }\n else\n format.html { render :new }\n format.json { render json: @resto.errors, status: :unprocessable_entity }\n end\n end\n end", "def offers \n @host.offers.create(offer_params) if request.post?\n @offers = @host.offers\n end", "def create\n @sale = Sale.new(sale_params)\n\n if @sale.save\n render json: @sale, status: :created, location: @sale\n else\n render json: @sale.errors, status: :unprocessable_entity\n end\n end", "def reemper_valoration_params\n params.require(:reemper_valoration).permit(:user_id, :reemper_id, :valoration, :description)\n end", "def create\n @item = Item.new(item_params)\n @item.seller_id = current_seller.id\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @resourcer = Resourcer.new(resourcer_params)\n\n respond_to do |format|\n if @resourcer.save\n format.html { redirect_to @resourcer, notice: 'Resourcer was successfully created.' }\n format.json { render :show, status: :created, location: @resourcer }\n else\n format.html { render :new }\n format.json { render json: @resourcer.errors, status: :unprocessable_entity }\n end\n end\n end", "def postScoot_priority( entity_id, reseller)\n params = Hash.new\n params['entity_id'] = entity_id\n params['reseller'] = reseller\n return doCurl(\"post\",\"/scoot_priority\",params)\n end", "def create\n @reeldatum = Reeldatum.new(reeldatum_params)\n\n respond_to do |format|\n if @reeldatum.save\n format.html { redirect_to @reeldatum, notice: 'Reeldatum was successfully created.' }\n format.json { render :show, status: :created, location: @reeldatum }\n else\n format.html { render :new }\n format.json { render json: @reeldatum.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @auction = Auction.new(auction_params)\n @auction.seller = @user\n\n if @auction.save\n render json: @auction, status: :created, location: seller_auction_url(@auction)\n else\n render json: @auction.errors, status: :unprocessable_entity\n end\n end", "def create\n @admin_retailer = Admin::Retailer.new(admin_retailer_params)\n\n respond_to do |format|\n if @admin_retailer.save\n format.html { redirect_to @admin_retailer, notice: 'Retailer was successfully created.' }\n format.json { render :show, status: :created, location: @admin_retailer }\n else\n format.html { render :new }\n format.json { render json: @admin_retailer.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @updaterete = Updaterete.update_rates(params)\n\n respond_to do |format|\n if @updaterete.save\n format.html { redirect_to @updaterete, notice: 'Updaterete was successfully created.' }\n format.json { render json: @updaterete, status: :created, location: @updaterete }\n else\n format.html { render action: \"new\" }\n format.json { render json: @updaterete.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n if params[:user_id] && params[:recruiter_id] && params[:review]\n user = User.find(params[:user_id])\n # puts user\n recruiter = Recruiter.find(params[:recruiter_id])\n # puts recruiter\n ################################\n params[\"got_interview\"] ? got_interview = params[\"got_interview\"] : got_interview = false\n params[\"got_job\"] ? got_job = params[\"got_job\"] : got_job = false\n got_job ? got_interview = true : \"null\" #if got job then must have had interview\n params[\"rating\"] ? rating = params[\"rating\"] : rating = 0 #0 means not rated\n params[\"recommended\"] ? recommended = params[\"recommended\"] : recommended = false\n params[\"ghoster\"] ? ghoster = params[\"ghoster\"] : ghoster = false\n # puts \"*********$\"\n # puts params\n # puts recommended\n # puts params[:recommended]\n # puts \"***************$\"\n review = Review.new(\n user_id: user.id,\n recruiter_id: recruiter.id,\n review: params[\"review\"],\n got_interview: got_interview,\n got_job: got_job,\n rating: rating,\n recommended: recommended,\n ghoster: ghoster\n ) #Review.new\n\n if review.save\n render json: {\"POSTED REVIEW\": \"ok\"} #works\n else\n render json: {\"error\": \"ERROR SAVE POSTED REVIEW\"}\n end\n ################################\n # render json: {\"POSTED REVIEW\": \"ok\"} #works\n else\n render json: {\"error\": \"no user_id or recruiter_id or review\"}\n end # if params[:user_id]\n end", "def create\n @realtor = Realtor.new(realtor_params)\n\n respond_to do |format|\n if @realtor.save\n format.html { redirect_to @realtor, notice: 'Realtor was successfully created.' }\n format.json { render :show, status: :created, location: @realtor }\n else\n format.html { render :new }\n format.json { render json: @realtor.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @resturant = Resturant.new(resturant_params)\n\n respond_to do |format|\n if @resturant.save\n format.html { redirect_to root_url, notice: 'Resturant was successfully created.' }\n format.json { render :show, status: :created, location: @resturant }\n else\n format.html { render :new }\n format.json { render json: @resturant.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @renseignement = Renseignement.new(renseignement_params)\n \n\n respond_to do |format|\n if @renseignement.save\n format.html { redirect_to @renseignement, notice: \"Renseignement was successfully created.\" }\n format.json { render :show, status: :created, location: @renseignement }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @renseignement.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @repairer = Repairer.new(params[:repairer])\n\n respond_to do |format|\n if @repairer.save\n format.html { redirect_to @repairer, notice: 'Repairer was successfully created.' }\n format.json { render json: @repairer, status: :created, location: @repairer }\n else\n format.html { render action: \"new\" }\n format.json { render json: @repairer.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @recruiter = Recruiter.new(recruiter_params)\n\n if @recruiter.save\n render_json_message({:success => t('.success')}, 201, {id: @recruiter.id})\n else\n render_json_message({:errors => @recruiter.errors.messages}, 422)\n end\n\n end", "def create\n @seller = Seller.new(params[:seller])\n @seller.member = self.current_member\n respond_to do |format|\n if @seller.save\n flash[:notice] = 'Your store account was successfully created. Happy selling!' \n format.html { redirect_back_or_default(:controller => 'dashboard', :action => 'index') }\n format.xml do\n headers[\"Location\"] = member_seller_url(@member, @seller)\n render :nothing => true, :status => \"201 Created\"\n end\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @seller.errors.to_xml }\n end\n end\n end", "def create\n @prayer = current_user.prayers.build(params[:prayer])\n\n respond_to do |format|\n if @prayer.save\n flash[:success] = \"Prayer created!\"\n format.html { redirect_to root_url, notice: 'Prayer was successfully created.' }\n format.json { render json: @prayer, status: :created, location: @prayer }\n else\n @feed_items = []\n format.html { render action: \"static_pages/home\" }\n format.json { render json: @prayer.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @rsvp = Rsvp.new(rsvp_params)\n\n if @rsvp.save\n render json: @rsvp, status: :created, location: @rsvp\n else\n render json: @rsvp.errors, status: :unprocessable_entity\n end\n end", "def create\n @reservation = Reservation.new(params[:reservation])\n @reservation.user_id = current_user.id\n\n respond_to do |format|\n if @reservation.save\n\n # UserMailer.booking_create(current_user, @reservation).deliver\n # OwnerMailer.booking_create(@reservation).deliver\n\n Reward.create( user_id: @reservation.user_id, \n reservation_id: @reservation.id, \n points_total: 5*@reservation.party_size, \n points_pending: 5*@reservation.party_size, \n description: \"\")\n \n format.html { redirect_to @reservation, notice: 'Reservation was successfully created.' }\n format.json { render json: @reservation, status: :created, location: @reservation }\n else\n format.html { render action: \"new\" }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end", "def seller_params\n params.require(:seller).permit(:first_name, :last_name, :password, :email)\n end" ]
[ "0.6455213", "0.6209023", "0.6006824", "0.5946656", "0.5892001", "0.5891423", "0.5878485", "0.57961905", "0.57387125", "0.572601", "0.5682215", "0.5666363", "0.56537455", "0.56280494", "0.56242776", "0.5612147", "0.55921185", "0.55866134", "0.55798835", "0.55791634", "0.5578174", "0.5552589", "0.5545973", "0.5538357", "0.55169064", "0.5508569", "0.54950285", "0.5453308", "0.54479754", "0.54472506", "0.5427807", "0.5423078", "0.5419338", "0.5415914", "0.5400215", "0.53987306", "0.5389647", "0.5386242", "0.5384488", "0.5373727", "0.53628165", "0.5358558", "0.5350582", "0.53441024", "0.53350085", "0.53350085", "0.53350085", "0.53328526", "0.5329075", "0.5322123", "0.53218085", "0.5294573", "0.529446", "0.5292407", "0.5271519", "0.52523345", "0.52463007", "0.52449125", "0.52412605", "0.5233325", "0.5225434", "0.5208657", "0.52078444", "0.5204185", "0.5183809", "0.5180836", "0.5161662", "0.5152205", "0.51521343", "0.5145766", "0.51432437", "0.5138978", "0.51298285", "0.51281", "0.512166", "0.51196796", "0.5118119", "0.51179105", "0.51167625", "0.51154995", "0.51148874", "0.5079766", "0.50664216", "0.5063158", "0.5061841", "0.5056132", "0.50547975", "0.5054734", "0.5048379", "0.5027392", "0.5025343", "0.5023762", "0.5023296", "0.50206226", "0.5020193", "0.5018869", "0.5006896", "0.5004407", "0.49973387", "0.4996966" ]
0.6155387
2
PATCH/PUT /resellers/1 PATCH/PUT /resellers/1.json
def update respond_to do |format| if @reseller.update(reseller_params) format.html { redirect_to @reseller, notice: 'Reseller was successfully updated.' } format.json { render :show, status: :ok, location: @reseller } else format.html { render :edit } format.json { render json: @reseller.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @supermarket = Supermarket.find(params[:id]) \n respond_to do |format|\n if @supermarket.update(supermarket_params)\n format.json { render json: @supermarket, status: :ok }\n end\n end\n end", "def update\n @seller = Seller.find(params[:id])\n\n respond_to do |format|\n if @seller.update_attributes(params[:seller])\n format.html { redirect_to @seller, :notice => 'Seller was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @seller.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @seller = Seller.find(params[:id])\n\n respond_to do |format|\n if @seller.update_attributes(params[:seller])\n format.html { redirect_to @seller, notice: 'Seller was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @seller.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @title = t('view.sellers.edit_title')\n @seller = Seller.find(params[:id])\n\n respond_to do |format|\n if @seller.update_attributes(params[:seller])\n format.html { redirect_to @seller, notice: t('view.sellers.correctly_updated') }\n format.json { head :ok }\n else\n format.html { render action: 'edit' }\n format.json { render json: @seller.errors, status: :unprocessable_entity }\n end\n end\n rescue ActiveRecord::StaleObjectError\n redirect_to edit_seller_url(@seller), alert: t('view.sellers.stale_object_error')\n end", "def update\n authorize @seller\n respond_to do |format|\n if @seller.update(seller_params)\n format.html { redirect_to root_url, notice: \"Seller #{@seller.name} was successfully updated.\" }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @seller.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @seller.update(general_params(:seller))\n @seller.update(slug: params[:seller][:slug].parameterize) if params[:seller][:slug]\n @seller.schedule.update(params[:schedule]) if params[:schedule]\n render json: @seller, own: true, status: 200\n else\n render json: @seller.errors, status: 422\n end\n end", "def update\n respond_to do |format|\n if @seller.update(seller_params)\n format.html { redirect_to @seller, notice: 'Seller was successfully updated.' }\n format.json { render :show, status: :ok, location: @seller }\n else\n format.html { render :edit }\n format.json { render json: @seller.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @remixer.update(remixer_params)\n format.html { redirect_to @remixer, notice: 'Remixer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @remixer.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @seller.update(update_seller_params)\n format.html { redirect_to @seller, notice: 'Seller was successfully updated.' }\n format.json { render :show, status: :ok, location: @seller }\n else\n format.html { render :edit }\n format.json { render json: @seller.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @seller = Seller.find(params[:id])\n \n respond_to do |format|\n if @seller.update_attributes(params[:seller])\n format.html { redirect_to seller_url(@seller) }\n format.xml { render :nothing => true }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @seller.errors.to_xml } \n end\n end\n end", "def update\n respond_to do |format|\n if @rower.update(rower_params)\n format.html { redirect_to @rower, notice: 'Rower was successfully updated.' }\n format.json { render :show, status: :ok, location: @rower }\n else\n format.html { render :edit }\n format.json { render json: @rower.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @reel = Reel.find(params[:id])\n\n respond_to do |format|\n if @reel.update_attributes(params[:reel])\n format.html { redirect_to @reel, notice: 'Reel was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @reel.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @renter = Renter.find(params[:id])\n\n respond_to do |format|\n if @renter.update_attributes(params[:renter])\n format.html { redirect_to @renter, :notice => 'Renter was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @renter.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n if @sell.update(sell_params)\n head :no_content\n else\n render json: @sell.errors, status: :unprocessable_entity\n end\n end", "def update\n @renter = Renter.find(params[:id])\n\n respond_to do |format|\n if @renter.update_attributes(params[:renter])\n format.html { redirect_to @renter, notice: 'Renter was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @renter.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n #@rr_sale = RrSale.find(params[:id])\n @rr_sale.attributes=params[:rr_sale]\n helper_choose_seller @rr_sale\n respond_to do |format|\n if @rr_sale.save\n flash[:notice] = 'RrSale was successfully updated.'\n format.html { redirect_to(@rr_sale) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @rr_sale.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @renter.update(renter_params)\n format.html { redirect_to @renter, notice: 'Запись успешно обновлена.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @renter.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n @seller.slug=nil\n if @seller.update(seller_params)\n format.html { redirect_to owner_commerce_sellers_path(@seller.commerce.slug), notice: 'Vendedor actualizado exitosamente.' }\n format.json { render :show, status: :ok, location: @seller }\n else\n format.html { render :edit }\n format.json { render json: @seller.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @seller_info = SellerInfo.find(params[:id])\n\n respond_to do |format|\n if @seller_info.update_attributes(params[:seller_info])\n format.html { redirect_to @seller_info, notice: 'Seller info was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @seller_info.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @renter.update(renter_params)\n format.html { redirect_to @renter, notice: 'Renter was successfully updated.' }\n format.json { render :show, status: :ok, location: @renter }\n else\n format.html { render :edit }\n format.json { render json: @renter.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @railscareer.update(railscareer_params)\n format.html { redirect_to @railscareer, notice: 'Railscareer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @railscareer.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @marketer.update(marketer_params)\n format.html { redirect_to @marketer, notice: 'Marketer was successfully updated.' }\n format.json { render :show, status: :ok, location: @marketer }\n else\n format.html { render :edit }\n format.json { render json: @marketer.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @sales_seller.update(sales_seller_params)\n format.html { redirect_to @sales_seller, notice: \"Dados atualizados com sucesso!\" }\n format.json { render :show, status: :ok, location: @sales_seller }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @sales_seller.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @revenue = Revenue.find(params[:id])\n\n if @revenue.update(params[:revenue])\n head :no_content\n else\n render json: @revenue.errors, status: :unprocessable_entity\n end\n end", "def update \n sneaker = find_sneaker\n # update! exceptions will be handled by the rescue_from ActiveRecord::RecordInvalid code\n sneaker.update(sneaker_params)\n render json: sneaker\n end", "def update\n respond_to do |format|\n if @offer.update(offers_params)\n format.jsonapi { render :show, status: :ok, location: @offer }\n else\n format.jsonapi { render jsonapi: @offer.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @rater = Rater.find(params[:id])\n\n respond_to do |format|\n if @rater.update_attributes(params[:rater])\n format.html { redirect_to @rater, notice: 'Rater was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @rater.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n # @retailer = Retailer.find(params[:id])\n respond_to do |format|\n if @retailer.update_attributes(params[:retailer])\n format.html { redirect_to @retailer, notice: 'Retailer was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @retailer.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @item.seller_id = current_seller.id\n respond_to do |format|\n if @item.update(item_params)\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { render :show, status: :ok, location: @item }\n else\n format.html { render :edit }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @sell.update(sell_params)\n format.html { redirect_to sells_path, notice: 'Sell was successfully updated.' }\n format.json { render :show, status: :ok, location: @sell }\n else\n format.html { render :edit }\n format.json { render json: @sell.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_reseller\n @reseller = Reseller.find(params[:id])\n end", "def update\n @retailer = Retailer.find(params[:id])\n\n respond_to do |format|\n if @retailer.update_attributes(params[:retailer])\n format.html { redirect_to @retailer, notice: \"Retailer was successfully updated.\"}\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @retailer.errors, status: \"unprocessable_entry\" }\n end\n end\n end", "def update\n @prayer = Prayer.find(params[:id])\n\n respond_to do |format|\n if @prayer.update_attributes(params[:prayer])\n format.html { redirect_to @prayer, notice: 'Prayer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @prayer.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @prayer = Prayer.find(params[:id])\n\n respond_to do |format|\n if @prayer.update_attributes(params[:prayer])\n format.html { redirect_to @prayer, notice: 'Prayer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @prayer.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @prayer = Prayer.find(params[:id])\n\n respond_to do |format|\n if @prayer.update_attributes(params[:prayer])\n format.html { redirect_to @prayer, notice: 'Prayer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @prayer.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @rental = Rental.find_by_id params[:rental][:id]\n store = Store.find_by_location params[:rental].delete(:location)\n time = parse_time params[:rental].delete(:date), params[:rental].delete(:time)\n params[:rental][:time] = time if time\n params[:rental][:store_id] = store.try(:id)\n if @rental.nil?\n customer_id = params[:customer][:id]\n render json: { errors: [\"Customer with id #{customer_id} could not be found\"] }, status: 403\n elsif @rental.update_attributes params[:rental]\n render json: @rental\n else\n render json: { errors: @rental.errors.full_messages }, status: 422\n end\n # @new_quantities = params[:rental].delete(:quantities)\n # if @new_quantities && @rental\n # @rental.rental_bikes.destroy_all\n # build_rental_bikes(@new_quantities) if @rental\n # end\n # render json: @rental.to_json if @rental.try(:save)\n end", "def update\n @collection = current_user.collections.find(params[:collection_id]) \n @recommender = @collection.recommenders.find(params[:id])\n\n respond_to do |format|\n if @recommender.update_attributes(params[:recommender])\n format.html { redirect_to collection_recommenders_path(@collection), notice: 'Recommender was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @recommender.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @sale = Sale.find(params[:id])\n\n if @sale.update(sale_params)\n head :no_content\n else\n render json: @sale.errors, status: :unprocessable_entity\n end\n end", "def update\n @retailer = Retailer.find(params[:id])\n\n respond_to do |format|\n if @retailer.update_attributes(params[:retailer])\n format.html { redirect_to @retailer, notice: 'Retailer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @retailer.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @rental = Rental.find_by_id params[:rental][:id]\n store = Store.find_by_location params[:rental].delete(:location)\n params[:rental][:time] = parse_time(params[:rental].delete(:date), params[:rental].delete(:time))\n params[:rental][:store_id] = store.try(:id)\n if @rental.nil?\n render json: { errors: [\"Customer with id #{params[:customer][:id]} could not be found\"] }, status: 403\n elsif @rental.update_attributes params[:rental]\n render json: @rental\n else\n render json: { errors: @rental.errors.full_messages }, status: 422\n end\n # @new_quantities = params[:rental].delete(:quantities)\n # if @new_quantities && @rental\n # @rental.rental_bikes.destroy_all\n # build_rental_bikes(@new_quantities) if @rental\n # end\n # render json: @rental.to_json if @rental.try(:save)\n end", "def update\n @vessel = Vessel.find(params[:id])\n\n respond_to do |format|\n if @vessel.update_attributes(params[:vessel])\n format.html { redirect_to @vessel, notice: 'Vessel was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @vessel.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @offerte_regel.update(offerte_regel_params)\n format.html { redirect_to @offerte_regel, notice: 'Offerte regel was successfully updated.' }\n format.json { render :show, status: :ok, location: @offerte_regel }\n else\n format.html { render :edit }\n format.json { render json: @offerte_regel.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @sales_rep = SalesRep.find(params[:id])\n \n respond_to do |format|\n if @sales_rep.update_attributes(params[:sales_rep])\n format.html { redirect_to @sales_rep, notice: 'Sales rep was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sales_rep.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @offerer.update(offerer_params)\n format.html { redirect_to @offerer, notice: 'Offerer was successfully updated.' }\n format.json { render :show, status: :ok, location: @offerer }\n else\n format.html { render :edit }\n format.json { render json: @offerer.errors, status: :unprocessable_entity }\n end\n end\n end", "def update(url, data)\n RestClient.put url, data, :content_type => :json\nend", "def update\n respond_to do |format|\n if @saler.update(saler_params)\n format.html { redirect_to @saler, notice: 'Saler was successfully updated.' }\n format.json { render :show, status: :ok, location: @saler }\n else\n format.html { render :edit }\n format.json { render json: @saler.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch!\n request! :patch\n end", "def update\n @prayer_request = PrayerRequest.find(params[:id])\n\n respond_to do |format|\n if @prayer_request.update_attributes(params[:prayer_request])\n format.html { redirect_to @prayer_request, notice: 'Prayer request was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @prayer_request.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n params[:book_shelf]['user'] = User.where(:id => params[:book_shelf]['user']).first\n params[:book_shelf]['book'] = Book.where(:id => params[:book_shelf]['book']).first\n @book_shelf = BookShelf.find(params[:id])\n respond_to do |format|\n if @book_shelf.update_attributes(params[:book_shelf])\n format.html { redirect_to @book_shelf, notice: 'Book shelf was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book_shelf.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @clientsOffers = ClientsOffers.find(params[:id])\n\n respond_to do |format|\n if @clientsOffers.update_attributes(params[:clientsOffers])\n format.html { redirect_to @clientsOffers, notice: 'ClientsOffers was succesfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @clientsOffers.errors, status: :unprocesable_entity }\n end\n end\n end", "def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end", "def update\n @repairer = Repairer.find(params[:id])\n\n respond_to do |format|\n if @repairer.update_attributes(params[:repairer])\n format.html { redirect_to @repairer, notice: 'Repairer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @repairer.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @freerange.update(freerange_params)\n format.html { redirect_to current_user }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @freerange.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n authorize! :edit_sell, @sell\n respond_to do |format|\n if @sell.update(sell_params)\n #format.html { redirect_to @sell, notice: 'Sell was successfully updated.' }\n format.json { render :show, status: :ok, location: @sell }\n else\n #format.html { render :edit }\n format.json { render json: @sell.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @review = Review.find(params[:id])\n @review.update(review_params)\n render json: @review\n end", "def set_update\n @recepient = Recepient.find(params[:id]) \n end", "def update\n @my_prayer_request = PrayerRequest.find(params[:id])\n\n respond_to do |format|\n if @my_prayer_request.update_attributes(params[:my_prayer_request])\n format.html { redirect_to @my_prayer_request, notice: 'My prayer request was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @my_prayer_request.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @reemper_valoration.update(reemper_valoration_params)\n format.html { redirect_to @reemper_valoration, notice: 'Reemper valoration was successfully updated.' }\n format.json { render :show, status: :ok, location: @reemper_valoration }\n else\n format.html { render :edit }\n format.json { render json: @reemper_valoration.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @sale.update(sale_params)\n format.html { redirect_to @sale, notice: 'Sale was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @sale.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @sale.update(sale_params)\n format.html { redirect_to @sale, notice: 'Sale was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @sale.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @restoration.update(restoration_params)\n format.html { redirect_to @restoration, notice: 'Restoration was successfully updated.' }\n format.json { render :show, status: :ok, location: @restoration }\n else\n format.html { render :edit }\n format.json { render json: @restoration.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @rapper.update(rapper_params)\n format.html { redirect_to @rapper, notice: 'Rapper was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @rapper.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @riesgo.update(riesgo_params)\n format.html { redirect_to @riesgo, notice: 'Riesgo was successfully updated.' }\n format.json { render :show, status: :ok, location: @riesgo }\n else\n format.html { render :edit }\n format.json { render json: @riesgo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @bundlesticker = Bundlesticker.find(params[:id])\n\n respond_to do |format|\n if @bundlesticker.update_attributes(params[:bundlesticker])\n format.html { redirect_to @bundlesticker, notice: 'Bundlesticker was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bundlesticker.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @resto.update(resto_params)\n format.html { redirect_to @resto, notice: 'Entry was successfully updated.' }\n format.json { render :show, status: :ok, location: @resto }\n else\n format.html { render :edit }\n format.json { render json: @resto.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @retailer.update(retailer_params)\n format.html { redirect_to @retailer, notice: 'Retailer was successfully updated.' }\n format.json { render :show, status: :ok, location: @retailer }\n else\n format.html { render :edit }\n format.json { render json: @retailer.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @supermarket.update(supermarket_params)\n format.html { redirect_to @supermarket, notice: 'Supermarket cadastrado com sucesso.' }\n format.json { render :show, status: :ok, location: @supermarket }\n else\n format.html { render :edit }\n format.json { render json: @supermarket.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @rider.update(rider_params)\n format.html { redirect_to [@rider.book, @rider], notice: 'Rider was successfully updated.' }\n format.json { render :show, status: :ok, location: @rider }\n else\n format.html { render :edit }\n format.json { render json: @rider.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n json_response(@restaurant.update!(restaurant_params))\n end", "def update\n if @recruiter.update(recruiter_params)\n render_json_message({success: t('.success')}, 200)\n else\n render_json_message({errors: @recruiter.errors.messages}, 422)\n end\n end", "def update\n @rrold = Rrold.find(params[:id])\n\n respond_to do |format|\n if @rrold.update_attributes(params[:rrold])\n format.html { redirect_to @rrold, notice: 'Rrold was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @rrold.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @shop_resource_offer = Shop::ResourceOffer.find(params[:id])\n\n respond_to do |format|\n if @shop_resource_offer.update_attributes(params[:shop_resource_offer])\n format.html { redirect_to @shop_resource_offer, notice: 'Resource offer was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @shop_resource_offer.errors, status: :unprocessable_entity }\n end\n end\n end", "def rest_patch(base_uri,json_payload,params)\n begin\n @response = RestClient.patch(base_uri,json_payload,params)\n rescue => e\n puts @response.code\n end\n return @response\n end", "def update\n respond_to do |format|\n if @racer.update(racer_params)\n format.html { redirect_to @racer, notice: 'Racer was successfully updated.' }\n format.json { render :show, status: :ok, location: @racer }\n else\n format.html { render :edit }\n format.json { render json: @racer.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @screener.update(screener_params)\n format.html { redirect_to @screener, notice: 'Screener was successfully updated.' }\n format.json { render :show, status: :ok, location: @screener }\n else\n format.html { render :edit }\n format.json { render json: @screener.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @rent.update(rent_params)\n format.html { redirect_to @rent, notice: 'Rent was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @rent.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @remodelings = args[:remodelings] if args.key?(:remodelings)\n end", "def update!(**args)\n @remodelings = args[:remodelings] if args.key?(:remodelings)\n end", "def update!(**args)\n @remodelings = args[:remodelings] if args.key?(:remodelings)\n end", "def update!(**args)\n @remodelings = args[:remodelings] if args.key?(:remodelings)\n end", "def update!(**args)\n @remodelings = args[:remodelings] if args.key?(:remodelings)\n end", "def update!(**args)\n @remodelings = args[:remodelings] if args.key?(:remodelings)\n end", "def update!(**args)\n @remodelings = args[:remodelings] if args.key?(:remodelings)\n end", "def update!(**args)\n @remodelings = args[:remodelings] if args.key?(:remodelings)\n end", "def update\n respond_to do |format|\n if @reprodutor.update(reprodutor_params)\n format.html { redirect_to @reprodutor, notice: 'Reprodutor was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @reprodutor.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @sellerring = Sellerring.find(params[:id])\n\n respond_to do |format|\n if @sellerring.update_attributes(params[:sellerring])\n format.html { redirect_to(@sellerring, :notice => 'Sellerring was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @sellerring.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n if @repertoire.update(repertoire_params)\n render :show, status: :ok, location: @repertoire\n else\n render json: @repertoire.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @prayer.update(prayer_params)\n format.html { redirect_to @prayer, notice: 'Prayer was successfully updated.' }\n format.json { render :show, status: :ok, location: @prayer }\n else\n format.html { render :edit }\n format.json { render json: @prayer.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @renewal = Renewal.find(params[:id])\n\n respond_to do |format|\n if @renewal.update_attributes(params[:renewal])\n format.html { redirect_to(@renewal, :notice => 'Renewal was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @renewal.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @rentable.update(rentable_params)\n format.html { redirect_to @rentable, notice: 'Rentable was successfully updated.' }\n format.json { render :show, status: :ok, location: @rentable }\n else\n format.html { render :edit }\n format.json { render json: @rentable.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @rider = Rider.find(params[:id])\n\n respond_to do |format|\n if @rider.update_attributes(params[:rider])\n format.html { redirect_to @rider, notice: 'Rider was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @rider.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @restora.update(restora_params)\n format.html { redirect_to @restora, notice: 'Restora was successfully updated.' }\n format.json { render :show, status: :ok, location: @restora }\n else\n format.html { render :edit }\n format.json { render json: @restora.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @rooster = Rooster.find(params[:id])\n\n respond_to do |format|\n if @rooster.update_attributes(params[:rooster])\n format.html { redirect_to @rooster, notice: 'Rooster was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @rooster.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @rest.update(rest_params)\n format.html { redirect_to @rest, notice: 'Rest was successfully updated.' }\n format.json { render :show, status: :ok, location: @rest }\n else\n format.html { render :edit }\n format.json { render json: @rest.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @repairer.update(repairer_params)\n format.html { redirect_to @repairer, notice: 'Repairer was successfully updated.' }\n format.json { render :show, status: :ok, location: @repairer }\n else\n format.html { render :edit }\n format.json { render json: @repairer.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @sale = Sale.find(params[:id])\n\n respond_to do |format|\n if @sale.update_attributes(params[:sale])\n format.html { redirect_to @sale, notice: 'Sale was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sale.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @sale = Sale.find(params[:id])\n\n respond_to do |format|\n if @sale.update_attributes(params[:sale])\n format.html { redirect_to @sale, notice: 'Sale was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sale.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @rally.update(rally_params)\n format.html { redirect_to @rally, notice: 'Rally was successfully updated.' }\n format.json { render :show, status: :ok, location: @rally }\n else\n format.html { render :edit }\n format.json { render json: @rally.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @sale = Sale.find(params[:id])\n\n respond_to do |format|\n if @sale.update_attributes(params[:sale])\n format.html { redirect_to @sale, notice: 'Sale was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sale.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @recruiter = Recruiter.find(params[:id])\n\n respond_to do |format|\n if @recruiter.update_attributes(params[:recruiter])\n format.html { redirect_to @recruiter, notice: 'Recruiter was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @recruiter.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.655781", "0.6412277", "0.63853073", "0.62947094", "0.62558496", "0.6226081", "0.6163599", "0.61619866", "0.6155889", "0.61457425", "0.6129929", "0.6124761", "0.61039466", "0.6093266", "0.6077119", "0.6025289", "0.6024947", "0.6024939", "0.60176075", "0.60072273", "0.60072255", "0.5998185", "0.59872556", "0.5975643", "0.59682775", "0.59614", "0.59591955", "0.59530354", "0.5946977", "0.59399235", "0.59363943", "0.5927932", "0.5925018", "0.5925018", "0.5925018", "0.59151995", "0.59077775", "0.59074837", "0.58948463", "0.5893549", "0.58855784", "0.588086", "0.58741885", "0.58613265", "0.58582217", "0.5854656", "0.585063", "0.5848936", "0.5848531", "0.58411723", "0.58363134", "0.58296984", "0.58208674", "0.5820866", "0.58066994", "0.5802204", "0.5800855", "0.5799549", "0.5798826", "0.5798826", "0.5779034", "0.57783186", "0.57747674", "0.5773506", "0.57698625", "0.57681423", "0.5761274", "0.5758023", "0.57565117", "0.57502496", "0.57485396", "0.57409066", "0.5739264", "0.57365155", "0.5735158", "0.5734079", "0.57322663", "0.57322663", "0.57322663", "0.57322663", "0.57322663", "0.57322663", "0.57322663", "0.57322663", "0.57277477", "0.5726098", "0.57230926", "0.5713296", "0.5708204", "0.57062495", "0.5699587", "0.5697399", "0.5692978", "0.5686852", "0.56810457", "0.5678227", "0.5678227", "0.56718636", "0.56697303", "0.56678385" ]
0.67319256
0
DELETE /resellers/1 DELETE /resellers/1.json
def destroy @reseller.destroy respond_to do |format| format.html { redirect_to resellers_url, notice: 'Reseller was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @seller = Seller.find(params[:id])\n @seller.destroy\n\n respond_to do |format|\n format.html { redirect_to sellers_url }\n format.json { head :ok }\n end\n end", "def destroy\n @seller = Seller.find(params[:id])\n @seller.destroy\n\n respond_to do |format|\n format.html { redirect_to sellers_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @seller = Seller.find(params[:id])\n @seller.destroy\n\n respond_to do |format|\n format.html { redirect_to sellers_url }\n format.json { head :no_content }\n end\n end", "def delete(username)\n perform_request({:action => 'reseller-delete', :username => username})\n end", "def delete(username)\n perform_request(action: 'reseller-delete', username: username)\n end", "def destroy\n @reel = Reel.find(params[:id])\n @reel.destroy\n\n respond_to do |format|\n format.html { redirect_to reels_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @rebate = Rebate.find(params[:id])\n @rebate.destroy\n\n respond_to do |format|\n format.html { redirect_to rebates_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @rrold = Rrold.find(params[:id])\n @rrold.destroy\n\n respond_to do |format|\n format.html { redirect_to rrolds_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @repurchase = Repurchase.find(params[:id])\n @repurchase.destroy\n\n respond_to do |format|\n format.html { redirect_to repurchases_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @seller.destroy\n\n respond_to do |format|\n format.html { redirect_to sellers_url, notice: 'Seller was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @core_seller.destroy\n respond_to do |format|\n format.html { redirect_to core_sellers_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @seller_info = SellerInfo.find(params[:id])\n @seller_info.destroy\n\n respond_to do |format|\n format.html { redirect_to seller_infos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @rower.destroy\n respond_to do |format|\n format.html { redirect_to rowers_url, notice: 'Rower was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @rider = Rider.find(params[:id])\n @rider.destroy\n\n respond_to do |format|\n format.html { redirect_to riders_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @seller.destroy\n respond_to do |format|\n format.html { redirect_to sellers_url, notice: 'Seller was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @seller.destroy\n respond_to do |format|\n format.html { redirect_to sellers_url, notice: 'Seller was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @supermarket = Supermarket.find(params[:id]) \n @supermarket.destroy\n respond_to do |format|\n format.json { render json: @supermarket, status: :ok }\n end\n end", "def destroy\n @seller = Seller.find(params[:id])\n @seller.destroy\n \n respond_to do |format|\n format.html { redirect_to sellers_url }\n format.xml { render :nothing => true }\n end\n end", "def destroy\n @rent.destroy\n respond_to do |format|\n format.html { redirect_to rents_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @retailer = Retailer.find(params[:id])\n @retailer.destroy\n\n respond_to do |format|\n format.html { redirect_to retailers_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @retailer = Retailer.find(params[:id])\n @retailer.destroy\n\n respond_to do |format|\n format.html { redirect_to retailers_url }\n format.json { head :ok }\n end\n end", "def destroy\n @red.destroy\n respond_to do |format|\n format.html { redirect_to reds_url }\n format.json { head :no_content }\n end\n end", "def delete\n sellID = params[:sell_id]\n\n uri = URI(\"http://107.170.7.58:4567/api/delete/sell\")\n parameters = {\"ext\" => \"json\", \"id\" => sellID}\n response = Net::HTTP.post_form(uri, parameters)\n list = JSON.parse(response.body)\n\n @response = list[0][\"kind\"]\n end", "def delete\n render json: Item.delete(params[\"id\"])\n end", "def destroy\n @rr_sale = RrSale.find(params[:id])\n @rr_sale.destroy\n\n respond_to do |format|\n format.html { redirect_to(rr_sales_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @sell = Sell.find(params[:id])\n @sell.destroy\n\n respond_to do |format|\n format.html { redirect_to sells_url }\n format.json { head :ok }\n end\n end", "def destroy\n @buyer = Buyer.find(params[:id])\n @buyer.destroy\n\n respond_to do |format|\n format.html { redirect_to buyers_url }\n format.json { head :ok }\n end\n end", "def destroy\n @rent = Rent.find(params[:id])\n @rent.destroy\n\n respond_to do |format|\n format.html { redirect_to rents_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @renter = Renter.find(params[:id])\n @renter.destroy\n\n respond_to do |format|\n format.html { redirect_to renters_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @rater = Rater.find(params[:id])\n @rater.destroy\n\n respond_to do |format|\n format.html { redirect_to raters_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @revendedor = Revendedor.find(params[:id])\n @revendedor.destroy\n\n respond_to do |format|\n format.html { redirect_to(revendedors_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @remixer.destroy\n respond_to do |format|\n format.html { redirect_to remixers_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @renter = Renter.find(params[:id])\n @renter.destroy\n\n respond_to do |format|\n format.html { redirect_to renters_url }\n format.json { head :ok }\n end\n end", "def destroy\n @recruiter = Recruiter.find(params[:id])\n @recruiter.destroy\n\n respond_to do |format|\n format.html { redirect_to recruiters_url }\n format.json { head :ok }\n end\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n @sales_rep = SalesRep.find(params[:id])\n @sales_rep.destroy\n\n respond_to do |format|\n format.html { redirect_to sales_reps_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @resturant.destroy\n respond_to do |format|\n format.html { redirect_to resturants_url, notice: 'Resturant was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @repairer = Repairer.find(params[:id])\n @repairer.destroy\n\n respond_to do |format|\n format.html { redirect_to repairers_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @sale.destroy\n respond_to do |format|\n format.html { redirect_to sales_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @railscareer.destroy\n respond_to do |format|\n format.html { redirect_to railscareers_url }\n format.json { head :no_content }\n end\n end", "def delete!\n Recliner.delete(uri)\n end", "def destroy\n @sale = Sale.find(params[:id])\n @sale.destroy\n\n respond_to do |format|\n format.html { redirect_to sales_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @sale = Sale.find(params[:id])\n @sale.destroy\n\n respond_to do |format|\n format.html { redirect_to sales_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @sale = Sale.find(params[:id])\n @sale.destroy\n\n respond_to do |format|\n format.html { redirect_to sales_url }\n format.json { head :ok }\n end\n end", "def destroy\n @sale = Sale.find(params[:id])\n @sale.destroy\n\n respond_to do |format|\n format.html { redirect_to sales_url }\n format.json { head :ok }\n end\n end", "def destroy\n @rooster = Rooster.find(params[:id])\n @rooster.destroy\n\n respond_to do |format|\n format.html { redirect_to roosters_url }\n format.json { head :no_content }\n end\n end", "def soccer_delete\n base_delete(params, \"Soccer\")\n end", "def destroy\n @recharge.destroy\n respond_to do |format|\n format.html { redirect_to recharges_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @sales_item.destroy\n respond_to do |format|\n format.html { redirect_to sales_items_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @rede = Rede.find(params[:id])\n @rede.destroy\n\n respond_to do |format|\n format.html { redirect_to(redes_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @shelf.destroy\n\n respond_to do |format|\n format.html { redirect_to shelves_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @sell.destroy\n respond_to do |format|\n format.html { redirect_to sells_url, notice: 'Sell was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @restaurant = Restaurant.find(params[:id])\n @restaurant.destroy\n\n respond_to do |format|\n format.html { redirect_to restaurants_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @restaurant = Restaurant.find(params[:id])\n @restaurant.destroy\n\n respond_to do |format|\n format.html { redirect_to restaurants_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @restaurant = Restaurant.find(params[:id])\n @restaurant.destroy\n\n respond_to do |format|\n format.html { redirect_to restaurants_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @restaurant = Restaurant.find(params[:id])\n @restaurant.destroy\n\n respond_to do |format|\n format.html { redirect_to restaurants_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @restaurant = Restaurant.find(params[:id])\n @restaurant.destroy\n\n respond_to do |format|\n format.html { redirect_to restaurants_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @restaurant = Restaurant.find(params[:id])\n @restaurant.destroy\n\n respond_to do |format|\n format.html { redirect_to restaurants_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @restaurant = Restaurant.find(params[:id])\n @restaurant.destroy\n\n respond_to do |format|\n format.html { redirect_to restaurants_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @restaurant = Restaurant.find(params[:id])\n @restaurant.destroy\n\n respond_to do |format|\n format.html { redirect_to restaurants_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @restaurant.destroy\n render json: {success: true}\n end", "def destroy\n @shelf.destroy\n respond_to do |format|\n format.html { redirect_to shelves_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @prayer = Prayer.find(params[:id])\n @prayer.destroy\n\n respond_to do |format|\n format.html { redirect_to prayers_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @prayer = Prayer.find(params[:id])\n @prayer.destroy\n\n respond_to do |format|\n format.html { redirect_to prayers_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @offerte_regel.destroy\n respond_to do |format|\n format.html { redirect_to offerte_regels_url, notice: 'Offerte regel was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @rent.destroy\n respond_to do |format|\n format.html { redirect_to rents_url, notice: 'Rent was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @rent.destroy\n respond_to do |format|\n format.html { redirect_to rents_url, notice: 'Rent was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\r\n @restaurant = Restaurant.find(params[:id])\r\n @restaurant.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to restaurants_url }\r\n format.json { head :no_content }\r\n end\r\n end", "def destroy\n @rider.destroy\n respond_to do |format|\n format.html { redirect_to riders_url, notice: 'Rider was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @rezultate.destroy\n respond_to do |format|\n format.html { redirect_to rezultates_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @request = PrayerRequest.find(params[:id])\n @prayers = Prayer.where(\"prayer_request_id = ?\", @request.id)\n @prayers.each do |prayer| \n prayer.destroy\n end\n\n respond_to do |format|\n format.html { redirect_to prayers_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @reprodutor.destroy\n respond_to do |format|\n format.html { redirect_to reprodutores_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @supermarket.destroy\n respond_to do |format|\n format.html { redirect_to supermarkets_url, notice: 'Supermarket removido com sucesso.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @renewal = Renewal.find(params[:id])\n @renewal.destroy\n\n respond_to do |format|\n format.html { redirect_to(renewals_url) }\n format.xml { head :ok }\n end\n end", "def destroy\r\n @sivic_rede.destroy\r\n respond_to do |format|\r\n format.html { redirect_to sivic_redes_url }\r\n format.json { head :no_content }\r\n end\r\n end", "def destroy\n @voucher.destroy\n respond_to do |format|\n format.html { redirect_to vouchers_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @voucher.destroy\n respond_to do |format|\n format.html { redirect_to vouchers_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @buyer.destroy\n respond_to do |format|\n format.html { redirect_to buyers_url, notice: 'Покупатель был удален.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @resto.destroy\n respond_to do |format|\n format.html { redirect_to restos_url, notice: 'Entry was deleted.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @pre_sale = PreSale.find(params[:id])\n @pre_sale.destroy\n\n respond_to do |format|\n format.html { redirect_to pre_sales_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @rapper.destroy\n respond_to do |format|\n format.html { redirect_to rappers_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @restaurant.destroy\n respond_to do |format|\n format.html { redirect_to restaurants_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @restaurant.destroy\n respond_to do |format|\n format.html { redirect_to restaurants_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @restaurant.destroy\n respond_to do |format|\n format.html { redirect_to restaurants_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @addre = Addre.find(params[:id])\n @addre.destroy\n\n respond_to do |format|\n format.html { redirect_to addres_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @offer.destroy\n respond_to do |format|\n format.jsonapi { head :no_content }\n end\n end", "def destroy\n @offer.destroy\n respond_to do |format|\n format.jsonapi { head :no_content }\n end\n end", "def destroy\n @realestate.destroy\n respond_to do |format|\n format.html { redirect_to realestates_url, notice: 'Realestate was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @franchisee_royalty.destroy\n respond_to do |format|\n format.html { redirect_to franchisee_royalties_url, notice: 'Franchisee royalty was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy_rest\n @entry_item = EntryItem.find(params[:id])\n @entry_item.destroy\n\n respond_to do |format|\n #format.html { redirect_to(entry_items_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @resourcer.destroy\n respond_to do |format|\n format.html { redirect_to resourcers_url, notice: 'Resourcer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @realestate.destroy\n respond_to do |format|\n format.html { redirect_to realestates_url, notice: \"Realestate was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def postUserReseller_remove( user_id)\n params = Hash.new\n params['user_id'] = user_id\n return doCurl(\"post\",\"/user/reseller_remove\",params)\n end", "def destroy\n @sell.destroy\n\n head :no_content\n end", "def destroy\n @saler.destroy\n respond_to do |format|\n format.html { redirect_to salers_url, notice: 'Saler was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @rally.destroy\n respond_to do |format|\n format.html { redirect_to rallies_url, notice: 'Rally was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @d_sale_item = DSaleItem.find(params[:id])\n #@d_sale_item.destroy\n\n respond_to do |format|\n format.html { redirect_to d_sale_items_url }\n format.json { head :ok }\n end\n end", "def destroy\n @riesgo.destroy\n respond_to do |format|\n format.html { redirect_to riesgos_url, notice: 'Riesgo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @prayer_request = PrayerRequest.find(params[:id])\n @prayer_request.destroy\n\n respond_to do |format|\n format.html { redirect_to prayer_requests_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @sale.destroy\n respond_to do |format|\n format.html { redirect_to sales_url, notice: \"Compra removida com sucesso.\" }\n format.json { head :no_content }\n end\n end" ]
[ "0.6895292", "0.68911314", "0.68911314", "0.6841968", "0.6770736", "0.6737219", "0.66752434", "0.6668417", "0.6662913", "0.6611177", "0.66106975", "0.6601415", "0.65979344", "0.6587867", "0.65875924", "0.65875924", "0.65874404", "0.6568915", "0.6561583", "0.6524002", "0.6516904", "0.6496218", "0.6491074", "0.64808017", "0.64737123", "0.6468134", "0.64647186", "0.6463116", "0.6462679", "0.6453375", "0.6452127", "0.6451435", "0.6450581", "0.6443642", "0.64229", "0.6413224", "0.6409428", "0.64024585", "0.63817316", "0.6373696", "0.6371906", "0.63652205", "0.63652205", "0.63639617", "0.63639617", "0.6360343", "0.63569516", "0.63449913", "0.63436705", "0.63420427", "0.63371676", "0.6326117", "0.6325256", "0.6325256", "0.6325256", "0.6325256", "0.6325256", "0.6325256", "0.6325256", "0.6325256", "0.63211113", "0.63189375", "0.6315542", "0.6315542", "0.6315208", "0.6312657", "0.6312657", "0.63065577", "0.6304145", "0.6301009", "0.6299773", "0.6298904", "0.6296665", "0.6296622", "0.62955743", "0.6295505", "0.6295505", "0.62916124", "0.628976", "0.62821615", "0.6281124", "0.6279366", "0.6279366", "0.6279366", "0.62793446", "0.6277941", "0.6277941", "0.62724227", "0.6269995", "0.6268207", "0.62651056", "0.62639475", "0.626333", "0.6259712", "0.62589294", "0.6258733", "0.6253086", "0.6251439", "0.6250833", "0.62500703" ]
0.7228871
0
Use callbacks to share common setup or constraints between actions.
def set_reseller @reseller = Reseller.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "def add_actions; end", "def callbacks; end", "def callbacks; end", "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "def define_action_helpers; end", "def post_setup\n end", "def action_methods; end", "def action_methods; end", "def action_methods; end", "def before_setup; end", "def action_run\n end", "def execute(setup)\n @action.call(setup)\n end", "def define_action_helpers?; end", "def set_actions\n actions :all\n end", "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "def setup_handler\n end", "def before_actions(*logic)\n self.before_actions = logic\n end", "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "def action; end", "def action; end", "def action; end", "def action; end", "def action; end", "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "def workflow\n end", "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "def process_action(...)\n send_action(...)\n end", "def before_dispatch(env); end", "def setup\n # override and do something appropriate\n end", "def after_actions(*logic)\n self.after_actions = logic\n end", "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "def setup(_context)\n end", "def setup(resources) ; end", "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "def determine_valid_action\n\n end", "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "def startcompany(action)\n @done = true\n action.setup\n end", "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "def setup(&block)\n define_method(:setup, &block)\n end", "def setup\n transition_to(:setup)\n end", "def setup\n transition_to(:setup)\n end", "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "def action\n end", "def config(action, *args); end", "def setup\n @setup_proc.call(self) if @setup_proc\n end", "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "def before_action \n end", "def action\n end", "def setup\n # override this if needed\n end", "def matt_custom_action_begin(label); end", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "def after(action)\n invoke_callbacks *options_for(action).after\n end", "def pre_task\n end", "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "def setup_signals; end", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "def initialize(*args)\n super\n @action = :set\nend", "def after_set_callback; end", "def setup\n #implement in subclass;\n end", "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "def lookup_action; end", "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "def around_hooks; end", "def release_actions; end", "def setup(easy)\n super\n easy.customrequest = @verb\n end", "def save_action; end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "def action_target()\n \n end", "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "def before_setup\n # do nothing by default\n end", "def setup(&blk)\n @setup_block = blk\n end", "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "def default_action; end", "def callback_phase\n super\n end", "def advice\n end", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "def _handle_action_missing(*args); end", "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend", "def call\n setup_context\n super\n end", "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end" ]
[ "0.6163443", "0.604317", "0.5943409", "0.59143174", "0.5887026", "0.58335453", "0.57738566", "0.5701527", "0.5701527", "0.56534666", "0.5618685", "0.54237175", "0.5407991", "0.5407991", "0.5407991", "0.5394463", "0.5376582", "0.5355932", "0.53376216", "0.5337122", "0.5329516", "0.5311442", "0.52963835", "0.52955836", "0.5295297", "0.5258503", "0.52442217", "0.5235414", "0.5235414", "0.5235414", "0.5235414", "0.5235414", "0.5234908", "0.5230927", "0.52263695", "0.5222485", "0.5216462", "0.52128595", "0.52070963", "0.520529", "0.517586", "0.5174021", "0.5172379", "0.5165636", "0.5161574", "0.51556087", "0.5153217", "0.5152898", "0.5151238", "0.5144674", "0.51387095", "0.51342636", "0.5113545", "0.51131564", "0.51131564", "0.5107665", "0.5107052", "0.50908124", "0.5089785", "0.50814754", "0.50807786", "0.5064482", "0.5053022", "0.50526255", "0.5050246", "0.5050246", "0.50329554", "0.5023997", "0.5021236", "0.5014815", "0.5014393", "0.4999298", "0.49990913", "0.4997733", "0.49884573", "0.49884573", "0.49840933", "0.49786162", "0.49784446", "0.49782816", "0.49659815", "0.49655175", "0.4956222", "0.49543875", "0.49536037", "0.495265", "0.4951427", "0.49438462", "0.49436793", "0.49335384", "0.49321616", "0.49264926", "0.49247074", "0.49246994", "0.49226475", "0.49194494", "0.49152806", "0.49149707", "0.49149227", "0.49144953", "0.49141943" ]
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def reseller_params params.require(:reseller).permit(:provider_id, :first_name, :last_name, :email, :phone, :best_time, :best_way, :business_name, :business_phone, :street_address_1, :street_address_2, :city, :state, :zip, :interested, :number_computers, :want_internet, :want_television, :want_phone, :number_televisions, :number_phones, :other_provider, :referrer_id, :other_referrer ) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def param_whitelist\n [:role, :title]\n end", "def expected_permitted_parameter_names; end", "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def param_whitelist\n [:rating, :review]\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "def valid_params_request?; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def permitted_params\n []\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "def safe_params\n params.require(:user).permit(:name)\n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def check_params; true; end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def quote_params\n params.permit!\n end", "def valid_params?; end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "def filtered_parameters; end", "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "def filtering_params\n params.permit(:email, :name)\n end", "def check_params\n true\n end", "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "def active_code_params\n params[:active_code].permit\n end", "def filtering_params\n params.permit(:email)\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "def list_params\n params.permit(:name)\n end", "def filter_parameters; end", "def filter_parameters; end", "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def url_whitelist; end", "def admin_social_network_params\n params.require(:social_network).permit!\n end", "def filter_params\n params.require(:filters).permit(:letters)\n end", "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "def sensitive_params=(params)\n @sensitive_params = params\n end", "def permit_request_params\n params.permit(:address)\n end", "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end", "def secure_params\n params.require(:location).permit(:name)\n end", "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end", "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end", "def url_params\n params[:url].permit(:full)\n end", "def backend_user_params\n params.permit!\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end", "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end", "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end", "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end", "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end", "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end", "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end" ]
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076", "0.62894756", "0.6283177", "0.6242471", "0.62382483", "0.6217549", "0.6214457", "0.6209053", "0.6193042", "0.6177802", "0.6174604", "0.61714715", "0.6161512", "0.6151757", "0.6150663", "0.61461", "0.61213595", "0.611406", "0.6106206", "0.6105114", "0.6089039", "0.6081015", "0.6071004", "0.60620916", "0.6019971", "0.601788", "0.6011056", "0.6010898", "0.6005122", "0.6005122", "0.6001556", "0.6001049", "0.59943926", "0.5992201", "0.59909594", "0.5990628", "0.5980841", "0.59669393", "0.59589154", "0.5958826", "0.5957911", "0.5957385", "0.5953072", "0.59526145", "0.5943361", "0.59386164", "0.59375334", "0.59375334", "0.5933856", "0.59292704", "0.59254247", "0.5924164", "0.59167904", "0.59088355", "0.5907542", "0.59064597", "0.5906243", "0.5898226", "0.589687", "0.5896091", "0.5894501", "0.5894289", "0.5891739", "0.58860534", "0.5882406", "0.587974", "0.58738774", "0.5869024", "0.58679986", "0.5867561", "0.5865932", "0.5864461", "0.58639693", "0.58617616", "0.5861436", "0.5860451", "0.58602303", "0.5854586", "0.58537364", "0.5850427", "0.5850199" ]
0.0
-1
___________________________________________________ Find all the restaurants that have the word "Austin" in it (caseinsensitive).
def restaurants_with_austin ratings.select do |r| if r["venue"].downcase.include? "austin" puts "#{r["venue"]}" end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @restaurants = if params[:search]\n Restaurant.where('name ILIKE ?', \"%#{params[:search]}%\")\n else\n @restaurants = Restaurant.all\n end\n\n end", "def find\n\t\tputs \"Enter keyword, EX: Mexican or Mex\"\n\t\tuserKeyword = gets.chomp.downcase.strip\n\t\trestaurants = Restaurant.saved_restaurants\n\t\tfound_restaurant_array = []\n\t\t\trestaurants.each do |rest|\n\t\t\tif rest.cuisine.include?(userKeyword)\n\t\t\t\tfound_restaurant_array << rest\n\t\t\tend\n\t\tend\n\t\tif !found_restaurant_array.empty?\n\t\toutput_restaurant_table(found_restaurant_array)\n\t\telse\n\t\t\toutput_action_footer(\"oops! could not find an entry\")\n\t\tend\n\tend", "def special_find(names)\n results = @restaurants.find_all do |restaurant|\n names.detect { |name| name.casecmp(restaurant.name) == 0 }\n end\n # Add separators\n results.join(\"\\n\" + (\"-\" * 80) + \"\\n\")\n end", "def search_by_cuisine(database, cuisine)\n\tsearch_result = database.execute(<<-SQL \n\t\t\tSELECT * FROM restaurants WHERE cuisine LIKE \"#{cuisine}%\" ORDER BY name\n\t\tSQL\n\t\t) \n\tprint(search_result, \"cuisine\")\nend", "def strict_matching(ingredient_name,item)\n return item.downcase.include?(ingredient_name)\nend", "def search_by_name(database, name)\n\tsearch_result = database.execute(<<-SQL \n\t\t\tSELECT * FROM restaurants WHERE name LIKE \"#{name}%\" ORDER BY name\n\t\tSQL\n\t\t) \n\tprint(search_result, \"name\")\t\nend", "def filter_by_city\n @restaurants = @restaurants.where(city: params[:city])\n end", "def name_filter(results, search)\n words = search.split(' ')\n for i in 0...words.size\n results = results.where(\"UPPER(name) LIKE ?\", \"%#{words[i]}%\")\n end\n return results\n end", "def find_by_name(entry)\n names = []\n self.all.each do |item|\n if item.name.downcase.include? entry\n names << item \n end\n end\n names\n end", "def search(term)\n all.select { |contact| contact.name.include?(term) || contact.email.include?(term) }\n end", "def myfind (str)\n if str.match(/^[[:graph:]]+$/) # name of the vaccine\n Vaccine.where(\"lower(name) like ?\", \"%#{str.downcase}%\")\n end\n end", "def starring(whazzername)\n # Find the movies with an actor who had a name like `whazzername`.\n # A name is like whazzername if the actor's name contains all of the\n # letters in whazzername, ignoring case, in order.\n\n # ex. \"Sylvester Stallone\" is like \"sylvester\" and \"lester stone\" but\n # not like \"stallone sylvester\" or \"zylvester ztallone\"\n\nend", "def search(term)\n all.select do |unit|\n unit.aliases.any? { |str| Regexp.new(term).match(str) }\n end\n end", "def search_all\n users = User.where([\"name LIKE ?\", \"%#{keywords}%\"])\n end", "def search(term)\n # pattern = Regexp.new(pattern, case_insensitive=true)\n # pattern = Regexp.new(pattern, Regexp::EXTENDED | Regexp::IGNORECASE)\n # pattern = Regexp.new(pattern)\n pattern = Regexp.new(term)\n select do |tweet|\n tweet.full_text =~ pattern\n end\n end", "def search(word)\n \n end", "def index\n #é criado a consulta sql que verifica se o restaurante possui algum prato com a categoria passada por get\n @restaurants = Restaurant.all.order(:name)\n @restaurants = @restaurants.distinct()\n @restaurants = @restaurants.joins(\"INNER JOIN dishes_restaurants AS drs\n ON restaurants.id = drs.restaurant_id INNER JOIN dishes AS di ON drs.dish_id = di.id\")\n\n @restaurants = if params[:term]\n @restaurants.where('UPPER (di.category) LIKE ? ', \"#{params[:term].upcase}%\").distinct\n\n else\n @restaurants.all\n end\n end", "def search(term)\n # TODO: Select the Contact instances from the 'contacts.csv' file whose name or email attributes contain the search term.\n Contact.all.select do |contact|\n contact.name.downcase.match(term) || contact.email.downcase.match(term)\n end\n end", "def great_matches\n filtered_matches(partial_or_perfect: [:family_name, :first_name], perfect: [:street, :city])\n end", "def find_state_for_city(user_city)\n found = false\n $states.each do |statekey, stateinfo|\n if stateinfo[1].map{|x| x.downcase}.include?(user_city.downcase)\n found = statekey\n end\n end\n if found \n puts \"Ah #{user_city} is in #{found}\"\n else\n puts \"we didnt find your city, try again sucka!\"\n end\nend", "def causeautocomplete\n searchtext = params['searchText']\n\n if session[:roleid] == ADMIN_ROLE\n # this will do a like search ignoring case\n @searchcauseresults = Charity.where(\"charityname ILIKE ?\", \"%\" + searchtext + \"%\")\n \n else\n \n # this will do a like search ignoring case\n @searchcauseresults = Charity.where(\"charityname ILIKE ?\", \"%\" + searchtext + \"%\")\n .where(isapproved: true)\n \n end\n\n \n\n #if @searchcauseresults.count == 0\n # @searchcauseresults = Charity.new\n #end\n \n render :json => @searchcauseresults\n\n end", "def search(word)\n results = []\n @books.each {|item| results << item if item[0].downcase.include?(word) }\n results.empty? ? (puts \"Search returned no results...\") : (results.each {|item| puts \"#{item[0]} (#{item[1]})\"})\n end", "def by_ingredient_search(query)\n ingredient_query = Ingredient.where('name LIKE ?', \"%#{query}%\")\n if ingredient_query.any?\n return self.approved.where(:id => ingredient_query.collect(&:recipes).flatten.uniq.collect(&:id))\n end\n return self.approved\n end", "def favorite_food?(string)\n @favorite_foods.map(&:downcase).include?(string.downcase)\n end", "def search(term)\n # TODO: Select the Contact instances from the 'MOCK_DATA.csv' file whose name or email attributes contain the search term.\n found_contacts = @@contacts.select do |contact|\n contact.name.downcase.include?(term.downcase) || contact.email.downcase.include?(term.downcase)\n end\n found_contacts\n\n end", "def name_search(search)\n words = search.split(' ')\n results = where(\"UPPER(name) LIKE ?\", \"%#{words[0]}%\")\n for i in 1...words.size\n results = results.where(\"UPPER(name) LIKE ?\", \"%#{words[i]}%\")\n end\n return results\n end", "def recipe_name_search\n key_word = User.prompt.ask(\"Please piece of recipe name\")\n key_word == nil ? (key_word = 'bdncjkascndxasklxnasmndxb') : (key_word)\n recipe_query = Recipe.all.filter{|recipe| recipe.name.include?(key_word.capitalize())}\n\n if recipe_query != []\n recipe_viewer(recipe_query)\n else\n puts 'Invalid Search!'.colorize(:red);\n end\n end", "def index\n @restaurants = Restaurant.all\n\n if params[:search_by_name] && params[:search_by_name] != \"\"\n @restaurants = Restaurant.where(\"name LIKE ?\",\n \"%#{params[:search_by_name]}%\")\n end\n\n if params[:search_by_city] && params[:search_by_city] != \"\"\n @restaurants = Restaurant.where(\"city like ?\",\n \"%#{params[:search_by_city]}%\")\n end\n\n if params[:search_by_state] && params[:search_by_state] != \"\"\n @restaurants= Restaurant.where(\"state like ?\",\n \"%#{params[:search_by_state]}%\")\n end\n\n if params[:search_by_zip] && params[:search_by_zip] != \"\"\n @restaurants= Restaurant.where(\"zip like ?\",\n \"%#{params[:search_by_zip]}%\")\n end\n\n end", "def search(term)\n # Select the Contact instances from the 'contacts.csv' file whose name or email attributes contain the search term.\n Contact.all.select do |contact|\n contact.name =~ /#{term}/i || contact.email =~ /#{term}/i\n end\n end", "def item_searcher(str)\n zombie_apocalypse_supplies = [\"hatchet\", \"rations\", \"water jug\", \"binoculars\",\n \"shotgun\", \"compass\", \"CB radio\", \"batteries\"]\n zombie_apocalypse_supplies.each do |x|\n if x == str\n puts \"yes\"\n else\n puts \"no\"\n end\n end\nend", "def find_my_planet_by_name(found)#.downcase\n found_planet = planets.find do |planet|\n planet.name.upcase == found.upcase\n end\n return found_planet\n\n end", "def find_planet_by_name(planet_name)\n\t\[email protected] {|planet| \n\t\t\tplanet.name.downcase.include? planet_name.downcase}\n\tend", "def filter_by_city(array_homes)\n\tcity_filtered = gets.chomp\n\tfiltered = array_homes.select do |hm|\n\t\thm.city == city_filtered\n\tend\n\tputs\n\tlist(filtered)\nend", "def find(keyword='')\n output_action_header(\"Find a joint\")\n if keyword\n restaurants = Restaurant.saved_restaurants\n found = restaurants.select do |restaurant|\n restaurant.name.downcase.include?(keyword.downcase) ||\n restaurant.cuisine.downcase.include?(keyword.downcase) ||\n restaurant.price.to_i <= keyword.to_i ||\n restaurant.location.downcase.include?(keyword.downcase)\n end\n output_restaurant_table(found)\n else\n puts 'Use a key phrase to find a joint from the list.'\n puts \"Example: 'find fufu', 'find pizza', 'find kokonte', 'find tuo zaafi', 'find Ghana jollof', etc\\n\\n\"\n end\n end", "def search(query)\n @all.each_with_object([]) do |record, matches|\n matches << record if ((record['866']['t'] == query) || (record['866']['s'] == query))\n end\n end", "def family_name_matches\n filtered_matches(ignore: [:first_name], partial_or_perfect: [:family_name], perfect: [:street, :city])\n end", "def partial_matches_for(input_string)\n # [\"aardvark\", \"apple\"]\n @word_list.select do |word|\n word.start_with?(input_string)\n end\n end", "def index\n @rentables = params[:q] ? Rentable.where(['LOWER(name) LIKE ?', \"%#{params[:q].downcase}%\"]) : Rentable.all\n end", "def action_search( contacts )\n puts\n pattern = ask \"Search for? \"\n puts\n contacts.each do |contact|\n\n #Patttern works on the first letter of first/sur name\n if contact[:name] =~ /\\b#{pattern}/i\n show ( contact )\n puts\n end\n end\nend", "def locations\n Location.all.select do |location|\n location.restaurant == self\n end\n end", "def search(term)\n # TODO: Select the Contact instances from the 'contacts.csv' file whose name or email attributes contain the search term.\n contents = CSV.read(\"contacts.csv\")\n arr = contents.select do |line|\n line[1].match(term)\n end\n arr\n end", "def index\n unless params['body']['search'].blank?\n @cities = City.where([\"name ILIKE ?\",\"%#{params['body']['search']}%\"])\n else\n @cities = City.order('created_at ASC')\n end\n end", "def search\n \n # Populate the @traveler variable\n get_traveler\n \n query = params[:query]\n query_str = query + \"%\"\n Rails.logger.debug query_str\n\n # This array will hold the list of matching places\n matches = [] \n # We create a unique index for mapping etc for each place we find\n counter = 0 \n \n # First search for matching names in my places\n rel = Place.arel_table[:name].matches(query_str)\n places = @traveler.places.active.where(rel)\n places.each do |place|\n matches << {\n \"index\" => counter,\n \"type\" => PLACES_TYPE,\n \"name\" => place.name,\n \"id\" => place.id,\n \"lat\" => place.location.first,\n \"lon\" => place.location.last,\n \"address\" => place.address,\n \"description\" => render_to_string(:partial => \"/shared/map_popup\", :locals => { :place => {:icon => 'icon-building', :name => place.name, :address => place.address} })\n }\n counter += 1\n end\n \n # Second search for matching address in trip_places. We manually filter these to find unique addresses\n rel = TripPlace.arel_table[:raw_address].matches(query_str)\n tps = @traveler.trip_places.where(rel).order(\"raw_address\")\n old_addr = \"\"\n tps.each do |tp|\n if old_addr != tp.raw_address\n matches << {\n \"index\" => counter,\n \"type\" => CACHED_ADDRESS_TYPE,\n \"name\" => tp.raw_address,\n \"id\" => tp.id,\n \"lat\" => tp.lat,\n \"lon\" => tp.lon,\n \"address\" => tp.raw_address,\n \"description\" => render_to_string(:partial => \"/shared/map_popup\", :locals => { :place => {:icon => 'icon-building', :name => tp.name, :address => tp.raw_address} })\n }\n counter += 1\n old_addr = tp.raw_address\n end \n end\n \n # Lastly search for matching names in the POI table\n rel = Poi.arel_table[:name].matches(query_str)\n pois = Poi.where(rel).limit(MAX_POIS_FOR_SEARCH)\n pois.each do |poi|\n matches << {\n \"index\" => counter,\n \"type\" => POI_TYPE,\n \"name\" => poi.name,\n \"id\" => poi.id,\n \"lat\" => poi.lat,\n \"lon\" => poi.lon,\n \"address\" => poi.address,\n \"description\" => render_to_string(:partial => \"/shared/map_popup\", :locals => { :place => {:icon => 'icon-building', :name => poi.name, :address => poi.address} })\n }\n counter += 1\n end\n \n respond_to do |format|\n format.js { render :json => matches.to_json }\n format.json { render :json => matches.to_json }\n end\n end", "def search_result\n freelancers = find_all FREELANCERS\n end", "def textField(textField, completions:somecompletions, forPartialWordRange:partialWordRange, indexOfSelectedItem:theIndexOfSelectedItem)\n matches = Entry.where(:title).contains(textField.stringValue,NSCaseInsensitivePredicateOption).map(&:title).uniq\n matches\n end", "def named_t\n array = [\"Taylor\", \"Francis\", \"Bella\", \"Tori\", \"Jay\"]\n array.select do |name|\n name.start_with?(\"T\")\n end\nend", "def find\n puts params[:search_string]\n @results = Clientworkout.where(client_name: params[:search_string])\n #@results = Clientworkout.where('lower(client_name)=?' params[:search_string])\n end", "def address_matches\n filtered_matches(ignore: [:first_name, :family_name], perfect: [:street, :city])\n end", "def matches? (search)\n if (search.nil? || search == \"\")\n return true\n end\n search = search.gsub(/[^0-9a-z ]/i, '').downcase\n searches = search.split(' ')\n \n searches.each do |word|\n word += ' '\n title = self.title.nil? ? ' ' : self.title.gsub(/[^0-9a-z ]/i, '').downcase + ' '\n description = self.description.nil? ? ' ' : self.description.gsub(/[^0-9a-z ]/i, '').downcase + ' '\n venue_name = self.venue.name.nil? ? ' ' : self.venue.name.gsub(/[^0-9a-z ]/i, '').downcase + ' '\n if !(title.include?(word) || description.include?(word) || venue_name.include?(word))\n return false\n end\n end\n\n return true\n end", "def find_surgery_term surgeryterm\n # Search the surgery terms\n Surgery.where(user_type: \"admin\").any_of({ :name => /^#{surgeryterm}/i }) \n end", "def find(query)\n @to_dos.each { |item| puts item if item.data.downcase.include?(query.downcase) }\n end", "def search(query, case_type: :smart)\n WWID.new.fuzzy_filter_items(self, query, case_type: case_type)\n end", "def restaurants\n Restaurant.all.select do |restuarant|\n restaurant_number.restaurantowner == self\n end\n end", "def find_a(arry)\n\n arry.select do |word|\n \"#{word}\".start_with?(\"a\")\n\n end\n # newlist\n end", "def results\n # @search_result = Recipe.where(\"name like ?\", \"%#{params[:search]}%\")\n\n @search_result = Recipe.joins(:food_items).joins(:directions).where(\"food_items.name ILIKE ? OR recipes.name ILIKE ? OR directions.instruction ILIKE ?\", \"%#{params[:search]}%\", \"%#{params[:search]}%\", \"%#{params[:search]}%\").distinct\n \n end", "def case_insensitive_match; end", "def ignore_theater name\n list = ['INDRP - El Campanil Theatre - Antioch, CA',\n 'PE - El Rey Theatre - Chico, CA',\n 'Castro',\n 'INDLF',\n 'EXSV - Highland Park 3 - Highland Park, CA',\n 'CFMY - Cinefamily@The Silent Movie Theatre - Los Angeles, CA',\n 'REL - Reel Cinema - Wofford Heights, CA',\n 'AR - Auditorium Rental, AS - Auditorium Screening, CW - Closed Weekdays, DP - Damaged Print, EF - Equipment Failure',\n 'FF - Film Festival, MC - Movie Canceled, NA - No Authorization, NB - No Bookings, ND - Called, No Data Available',\n 'NE - No Engagement, NP - No Patrons, PR - Pending Revenue, SS - Special Screening, TC - Temporarily Closed',\n 'INDRP - Downtown Independent - Los Angeles, CA',\n '21CC - Victory Theatre - Safford, AZ',\n 'EGYP - Egyptian - Hollywood, CA'\n ]\n list.each do |v|\n return true if name.include?(v)\n end\n return false\nend", "def autocomplete_book_author\n# re = Regexp.new(\"^#{params[:user][:favorite_language]}\" , \"i\" )\n # @books= Book.find_all do |book|\n # book.title.match re\n # end\n # render :layout=>false\n end", "def search_restaurants\n if validate_parameters?\n read_resto_data_from_file\n build_dishes unless @restro.empty?\n @restaurants\n else\n puts \"Invalid parameters! please provide argument like this ruby search_restro.rb sample.csv item1 item2\"\n end\n end", "def index\n @entities = Entity.any_of( { :title => /.*#{params[:search]}.*/i } )\n end", "def search_for_areas\n @towns = use_cache get_controller_action_key do\n Town.all.reject{|town| town.level != 1 }\n end\n\n respond_to do |format|\n q = params[:query].mb_chars.capitalize.to_s\n @towns = @towns.select{ |t| Regexp.new(\"^#{q}.*\") =~ t.title }\n format.json\n end\n\n end", "def bubble_up_exact_matches(affil_list:, term:)\n matches_at_beginning = []\n matches_within = []\n other_items = []\n match_term = term.downcase\n affil_list.each do |affil_item|\n name = affil_item[:name].downcase\n if name.start_with?(match_term)\n matches_at_beginning << affil_item\n elsif name.include?(match_term)\n matches_within << affil_item\n else\n other_items << affil_item\n end\n end\n matches_at_beginning + matches_within + other_items\n end", "def test_case_insensitivity\n data = JSON.parse(File.read(User::JSON_FILENAME))\n key = 'name'\n val = data[0]['name'].downcase\n results = User.new(key, val).search\n assert_block('The search must ignore string case while matching') { results.include?(data[0]) }\n end", "def search(term)\n # TODO: Select the Contact instances from the 'contacts.csv' file whose name or email attributes contain the search term.\n flag = false\n CSV.foreach('contacts.csv') do |csv|\n if term.downcase == csv[1].downcase\n flag = true\n puts \"ID #{csv[0]}: #{csv[1]} (#{csv[2]})\"\n break\n end\n end\n if flag == false\n puts \"This contact isn't listed.\"\n end\n end", "def search_by_ingredient(primary_ingredient)\n # API EXAMPLE: https://www.themealdb.com/api/json/v1/1/filter.php?i=chicken_breast\n url_end = \"filter.php?i=#{primary_ingredient}\"\n content = api_call(url_end)\n validate(content)\n content\n end", "def myfind (str)\n if str.match(/^[[:graph:]]+$/)\n Provider.where(\"lower(name) like ?\", \"%#{str}%\")\n end\n end", "def busca_receitas_por_nome(nome_busca)\n nome_busca = nome_busca.upcase\n receitas_encontradas = []\n\n receitas_encontradas = $receitas.select do |receita|\n receita.nome.upcase.include? nome_busca \n end\n\n receitas_encontradas\nend", "def search_for_towns_and_areas\n @towns = use_cache get_controller_action_key do\n Town.all.reject{|town| town.level != 13 && town.level != 1 }\n end\n\n respond_to do |format|\n q = params[:query].mb_chars.capitalize.to_s\n @towns = @towns.select{ |t| Regexp.new(\"^#{q}.*\") =~ t.title }\n format.json\n end\n\n end", "def linear_search(input)\n \n search_name = input.downcase.split(' ')\n search_name.each do |name_el|\n \n entries.each do |entry|\n \n name_array = entry.name.downcase.split(' ')\n \n if name_array.include?(name_el)\n return entry\n end\n end\n end\n return nil\n end", "def search_by_zip_code\n zip_codes = []\n if not (term = params[:term].to_s.strip).blank? and term.to_i > 0\n zip_codes = ZipCode.find(:all, :conditions => [\"code = ?\", term])\n zip_codes.compact!\n end\n render :json => format_suggested_cities_by_zip_code(zip_codes).to_json\n end", "def search_by_keyword(keyword)\n j = search(keyword)\n j['b'].collect { |e| e['Id'] }.map { |e| e.downcase }\n end", "def locality_matches\n filtered_matches(ignore: [:first_name, :street], partial_or_perfect: [:family_name], perfect: [:city])\n end", "def find_a(array)\n array.find_all do |words|\n words.start_with?(\"a\")\n end\nend", "def check_for_keyword(keyword)\n items_to_check = { job_description: job_description, skills: skills, job_title: job_title }\n items_to_check.each do |key,value|\n condition = case key\n when :skills\n \"does not\" unless value.grep keyword.capitalize \n else\n \"does not\" unless value.downcase.include? keyword.downcase\n end\n puts \"Freelancer\\'s #{name} #{key} #{condition} contains #{keyword}\"\n end\n end", "def check_contractor_by_keyword(keyword)\n match = @hash_contractor.find do |pair|\n pair.last.downcase.include? keyword.downcase\n end\n\n (match == nil) ? (puts \"#{@hash_contractor[:name]} dont have a #{keyword}\") : (puts \"The #{keyword} was include in #{match}, #{@hash_contractor[:name]}\")\n end", "def filter_students_by_initial(initial, student_names)\n student_name_array = extract_name(student_names)\n return (student_name_array.select{ |student_name| student_name[0] == initial.to_s.capitalize})\nend", "def my_array_finding_method(i_want_pets, thing_to_find)\n new_array = []\n i_want_pets.each do |word|\n range = word.to_s.downcase[0..-1]\n if range.include?(thing_to_find)\n new_array << word\n end\n end\n return new_array\nend", "def search\n # query_param = params[:query].downcase\n # @found_articles = Article.all.where(\"lower(title) LIKE :query\", query: query_param)\n # render \"search\"\n end", "def search\n query = {\n 'res_id' => params[:id]\n }\n @search = HTTParty.get('https://developers.zomato.com/api/v2.1/restaurant?', query: query, headers: headers)\n end", "def search(term)\n # TODO: Select the Contact instances from the 'contacts.csv' file whose name or email attributes contain the search term.\n @@conn.exec_params('SELECT name FROM contacts WHERE name LIKE $1', [\"%#{term}%\"])\n end", "def find_restaurant_loc\n puts \"Enter Restaurant: \" \n rest_name = gets.chomp\n x = Restaurant.find_by(name: rest_name)\n pp x.location\nend", "def index\n @books = params[:search] ? Book.select{|book| book.title.downcase.include?(params[:search].downcase)} : Book.all\n end", "def search(term=nil)\n return [] if term.nil? || term.empty?\n self.connection.exec(\"SELECT * FROM contacts WHERE name ILIKE '%#{term}%' OR email ILIKE '%#{term}%'\").values\n end", "def index\n @case_insensitives = CaseInsensitive.all\n end", "def index\n @market_places = case params[:business_line]\n when \"Products\", \"Services\", \"Food\"\n MarketPlace.where(\"business_line LIKE ?\", \"%#{params[:business_line]}%\")\n else\n MarketPlace.all\n end\n end", "def return_exact_results\n\t# make empty array that will contain all users whose first_name, last_name, or email exactly matches a given string\n\texact_search_results = []\n\n\tUser.all.each do |user|\n\t\tif user.first_name == user.search_term || user.last_name == search_term || user.email == search_term\n\t\t\texact_search_results.push user.id\n\t\telse\n\t\t\t# do nothing if search term is not exactly\n\t\tend\n\tend\n\texact_search_results\nend", "def auto_complete_for_ingredient_name\n value = params[:ingredient][:name]\n @ingredients = Ingredient.find(:all, \n :conditions => [ 'LOWER(name) LIKE ?',\n '%' + value.downcase + '%' ], \n :order => 'name ASC',\n :limit => 8)\n render :partial => 'ingredient_name_matches'\n end", "def city_name_search(city)\r\n\t\tcity_name = city\r\n\t\tunless city_name.nil?\r\n\t\t\tcity_name = \"San%20Jose\"\r\n\t\tend\r\n\t\t#replace white spaces.\r\n\t\tcity_name.gsub(\" \", \"%20\")\r\n\t\tapi_key = \"vr7UJMGlyK75TAnqbjZzLff4RzhNHEG2\" #Thao's key. Move this later to env section.\r\n\t\trsc_url = \"https://api.sandbox.amadeus.com/v1.2/points-of-interest/\"\r\n\t\trsc_url_api = \"yapq-search-text?apikey=#{api_key}\"\r\n\t\trsc_url_city = \"&city_name=#{city_name}\"\r\n\t\t#/v1.2/points-of-interest/yapq-search-text?apikey=vr7UJMGlyK75TAnqbjZzLff4RzhNHEG2&city_name=Boston\r\n\t\tget_url = \"#{rsc_url}#{rsc_url_api}#{rsc_url_city}\"\r\n\t\tresponse = Faraday.get get_url\r\n\tend", "def location_search # :nologin: :norobots:\n query = create_query(:Location, :pattern_search, :pattern => Location.user_name(@user, params[:pattern].to_s))\n show_selected_locations(query, :link_all_sorts => true)\n end", "def autocomplete_venue_name\n term = params[:term]\n if term && !term.empty?\n items = Venue.verified.select(\"name\").\n where(\"name like ?\", '%' + term.downcase + '%').\n limit(10).order(:name)\n else\n items = {}\n end\n render :json => json_for_autocomplete(items, :name)\n end", "def find_by_starts_with(name)\n return nil unless name.present?\n names.select {|e| e.starts_with?(name)}\n end", "def search_results\n @products = Product.where(\"name LIKE ?\", \"%#{params[:keywords]}%\")\n end", "def search\n\n end", "def lowercase_search_prefixes(data)\n _search_prefixes(data.downcase, LOWERCASE_SEARCHABLE)\n end", "def search(term)\n contacts = Contact.all\n person_data = nil\n contacts.each_with_index do |contact,index|\n if (contact.name.include? term) || (contact.email.include? term)\n person_data = []\n person_data[0] = index\n person_data[1] = contact \n end\n end\n person_data\n end", "def index\n @restaurants = Restaurant.where(\"name like ?\", \"%#{params[:q]}%\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @restaurants.map(&:attributes) }\n end\n end", "def find_recipe_by_title\n # view_recipe(Recipe.find_by(title: ask('Which recipe would you like to look for? >:'))) # ask for recipe title, search for it and display\n list_recipes(Recipe.where(\"title LIKE ?\", \"%\"+ ask('Which recipe would you like to look for? >:') + \"%\").order(:title))\n\n end", "def index\n unless params['body']['search'].blank?\n @amenities = Amenity.where([\"name ILIKE ?\",\"%#{params['body']['search']}%\"])\n else\n @amenities =Amenity.order('created_at ASC')\n end\n end", "def index\n unless params['body']['search'].blank?\n @countries = Country.where([\"name ILIKE ?\",\"%#{params['body']['search']}%\"])\n else\n @countries =Country.order('created_at ASC')\n end\n end", "def article_match? (query, article_title)\n found = false\n return true if query.empty?\n temp_article = article_title.downcase\n query.each do |kw|\n pattern = Regexp.new /.*#{kw.downcase}.*/\n found = true if temp_article =~ pattern\n end\n found\nend" ]
[ "0.6564779", "0.651378", "0.6485626", "0.6259089", "0.6254611", "0.62230504", "0.6203366", "0.61308646", "0.61245126", "0.61241776", "0.60357976", "0.60246795", "0.59598714", "0.5954278", "0.59240896", "0.59053296", "0.5895082", "0.58841884", "0.5857187", "0.5847564", "0.58324564", "0.5824898", "0.5822402", "0.58211267", "0.5819898", "0.58195925", "0.5810561", "0.5801425", "0.5797703", "0.57785505", "0.57573074", "0.5737668", "0.5735187", "0.5710409", "0.5695493", "0.56946814", "0.5686325", "0.5653383", "0.5646087", "0.56396914", "0.56214035", "0.5615299", "0.5608651", "0.55935526", "0.55902505", "0.5587828", "0.5586696", "0.5580128", "0.5572052", "0.5571521", "0.5569371", "0.55693", "0.5561993", "0.5554379", "0.55452985", "0.55376315", "0.55323267", "0.55308664", "0.55258447", "0.5525604", "0.552179", "0.55203456", "0.5520208", "0.5518569", "0.5516953", "0.55131453", "0.55129784", "0.5498926", "0.5481637", "0.54805946", "0.5478783", "0.5465458", "0.5461011", "0.54559374", "0.5455299", "0.5455211", "0.54540664", "0.5453607", "0.5450225", "0.5439562", "0.54179215", "0.54174334", "0.54160225", "0.54039305", "0.5392541", "0.5387852", "0.53858256", "0.5379069", "0.5372459", "0.5359411", "0.5348333", "0.5346283", "0.53407913", "0.53386915", "0.5337782", "0.5336091", "0.5332147", "0.5331098", "0.5330592", "0.53213584" ]
0.71452916
0
___________________________________________________ Find the top 3 movie genres with the most ratings.
def movie_data response = RestClient.get("critics.api.mks.io/movie-genres") JSON.parse(response) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def top_three_recipes\n recipe_cards.max_by(3) {|recipe_cards| recipe_cards.rating}\n end", "def top_three_recipes\n\t\trecipes.select { |recipe| recipe.rating }.sort_by { |recipe| recipe.rating }.last(3)\n\tend", "def top_three_recipes\n recipes_sorted_by_rating.reverse[0..2]\n end", "def top_three_recipes \n a = recipes.sort_by do |i| \n i.rating \n end \n a[-3..-1]\n end", "def top_three_recipes\n self.recipes.sort_by {|info| info.rating}.pop(3)\n end", "def top_three_recipes\n top_three = RecipeCard.all.select {|atr| atr.user == self}\n top_three.sort_by {|atr| atr.rating}.reverse\n top_three[0..2]\n end", "def top_three_recipes\n my_recipes = self.recipe_cards\n my_recipes.sort{|a, b| b.rating <=> a.rating }.slice(0,3)\n end", "def top_three_recipes\n self.find_user_recipe_cards.sort_by{|rcard| rcard.rating}.reverse![0..2]\n end", "def top_three_recipes\n top_three_cards = recipe_cards.sort_by { |card| card.rating}.reverse.slice(0, 3)\n top_three_cards.map { |c| c.recipe }\n end", "def top_three_recipes\n sorted_recipe_cards = self.recipe_cards.sort do |recipe_card|\n recipe_card.rating end\n if sorted_recipe_cards.length < 3\n sorted_recipe_cards\n else\n sorted_recipe_cards[-3,3]\n end\n end", "def top_three_rated_events\n self.highest_events_by_rating.first(3)\n end", "def how_orders_of_three_most_popular_books\n books_count.each {|title, times| puts \"The most popular books, '#{title}', ordered #{times}\" if times == books_count.values.max }\n end", "def top_3_comments\n comments.order(rating: :desc).limit(3)\n end", "def personal_top_three\n scores.max([scores.length, 3].min)\n end", "def top_three_rated_afterthoughts\n self.afterthoughts_by_rating.first(3)\n end", "def top_matches(n=3)\n \n scores = Array.new\n \n @prefs.each_pair do |key,value|\n if key != @person\n scores << [@similarity.compute(key),key]\n end\n end\n \n (scores.sort!.reverse!)[0..n]\n \n end", "def top_three_memes\n # Get top 3 rarity total scores\n top_rarities = Rarity.order('total_score DESC').limit(3)\n top_rarities.map do |rarity|\n Meme.find(rarity.meme_id)\n end\n end", "def popularity_list\n @movies.values.sort { |movie1, movie2| popularity(movie2.movie_id) <=> popularity(movie1.movie_id) }.map(&:movie_id)\n end", "def top_3\n freq_hash = each_with_object(Hash.new(0)) { |v, h| h[v] += 1 }\n freq_hash.sort_by { |k, v| -v }.first(3).map(&:first)\n end", "def genre_ratings(movies_to_rating)\n\t\tgenre_rating_hash = Hash.new {|hash, key| hash[key] = []} \n\n\t\tmovies_to_rating.each do |movie_id, rating|\n\t\t\t@all_movies[movie_id].genres.each do |genre|\n\t\t\t\tgenre_rating_hash[genre].push rating\n\t\t\tend\n\t\tend\n\t\tratings_hash = Hash.new\n\t\tgenre_rating_hash.map{|genre, ratings| ratings_hash[genre] = ratings.inject(&:+).to_f / ratings.count}\n\t\tratings_hash\n\tend", "def three_genres\n genres.limit(3).pluck(:name)\n end", "def popularity_list\n @movie_list.values.sort{|a,b| b.popularity <=> a.popularity}\n end", "def popularity_list\n averageRatingMoviesHash = {}\n @ratedMoviesHash.each {|movie, ratings| averageRatingMoviesHash[movie] = average(ratings) * (2 ** (@ratedMoviesHash[\"#{movie}\"].length / (@allUsersHash.keys.length).to_f)) - 1}\n ratedMoviesArray = averageRatingMoviesHash.sort_by { |movie, aveRating| -aveRating }\n popularityList = []\n ratedMoviesArray.each {|item| popularityList.push(item[0].to_i)} \n return popularityList\n\tend", "def most_reviews\n @top_five = Taxi.most_review_answers(current_user, params)\n end", "def popularity(movie_id)\n movie_id = movie_id.to_s\n @num_reviewers = @movie_database[movie_id].length.to_f\n @score_time = 0.0\n @temp_rating = 0.0\n \n @weight_users = 0.25\n @weight_rating = 0.25\n @weight_time = 0.50\n \n @movie_database[movie_id].each do |user, rating, time|\n #divided by 2 bil so that \"tim\" in UNIX seconds is less than 1\n @score_time += (time.to_f / 2000000000.0)\n @temp_rating += rating.to_f\n end\n \n @score_rating = (@temp_rating / @num_reviewers) * 20.0\n @score_time = (@score_time / @num_reviewers) * 100\n @score_reviewers = (@num_reviewers / @total_users) * 100.0\n \n @final_score = ( @weight_users * @score_reviewers + @weight_rating * @score_rating + @weight_time * @score_time)\n \n return @final_score \n end", "def most_similar(u)\n\t\tmSimilar= {}\n\t\treviews_hash.each {|user, moveis|\tmSimilar[user] = similarity(u,user)} #find the similarity with every other user\n\t\tm = mSimilar.sort_by {|a,b| b}.reverse.transpose[0] #sort according to similarities and then choose the first ten (exclude itself)\n\t\treturn m[1..10]\n\tend", "def movies(u)\r\n\t\treturn @training_set.user_ratings[u].keys.sort\r\n\tend", "def movies_genres_count\n @genres = Genre.joins(:movie).\n select('genre.genre_id, genre.name as name, count(*) as count').\n group('genre.genre_id').\n order('count DESC')\n end", "def biggest_stars\nMovieDatabase.execute(<<-SQL)\n SELECT\n a.name, COUNT(DISTINCT(m.id)) AS count\n FROM\n actor a\n JOIN\n casting c ON a.id = c.actorid\n JOIN \n movie m ON c.movieid = m.id\n WHERE\n c.ord = 1\n GROUP BY\n a.name\n HAVING\n COUNT(DISTINCT(m.id)) >= 30\n ORDER BY\n a.name;\nSQL\nend", "def top_matches(preferences, person, limit = 5)\n scores = preferences.map {|pref| [sim_pearson(preferences, person, pref[0]), pref[0]] unless pref[0] == person}.compact\n scores.sort! {|a,b| b[0] <=> a[0]}\n return scores[0...limit]\nend", "def top_five_artists(db, genre_name)\n db.execute \"SELECT artists.name, COUNT(*) as c\n FROM tracks\n JOIN albums ON albums.id = tracks.album_id\n JOIN artists ON artists.id = albums.artist_id\n JOIN genres ON tracks.genre.id = genres.id\n WHERE genres.name = '#{genre_name}'\n GROUP BY artists.name\n ORDER BY c DESC\n LIMIT 5\n \" # TODO: return list of top 5 rock artists\nend", "def most_commented\n @movies = Movie.joins(:comment).\n select('movie.movie_id, movie.title, count(movie.movie_id) as count').\n group('movie.movie_id').\n order('count DESC').take(10)\n end", "def most_popular\n @books.sort_by {|book| book.rate}\n end", "def popularity(movie_id)\n @movies[movie_id]\n end", "def top_10 (matches)\n matches.sort_by! { |match| match['score'] }.reverse[:10]\nend", "def popularity(movie_id)\n\t\t@movies[movie_id]\n\tend", "def biggest_stars\n MovieDatabase.execute(<<-SQL)\n SELECT \n actors.name,\n COUNT(*) AS count\n FROM\n actors\n INNER JOIN \n castings ON actors.id = castings.actor_id\n WHERE \n castings.ord = 1\n GROUP BY \n actors.name\n HAVING \n COUNT(*) >= 26;\n\n SQL\nend", "def index\n @most_played_artist = Song.most_played_artist\n @most_played_by_artist = Song.find_most_played_by_artist :limit => 3\n\n @most_played_players = User.find_players_of_artist(@most_played_artist, :limit => 4)\n\n @most_played_tags = Tag.find_top(:limit => 3, :conditions => {\n :taggable_type => 'song', :taggable_id => @most_played_by_artist.map(&:id)})\n\n @coolest_users = User.find_coolest :limit => 4\n @max_votes = @coolest_users.map(&:rating_count).max\n end", "def top_rentals\n return @badfruit.parse_movies_array(JSON.parse(@badfruit.get_lists_action(\"top_rentals\")))\n end", "def biggest_stars\n MovieDatabase.execute(<<-SQL)\n SELECT\n actors.name, count(*) AS 'count'\n FROM\n actors\n JOIN castings ON castings.actor_id = actors.id\n WHERE\n castings.ord = 1\n GROUP BY\n actors.name\n HAVING\n count(*) >= 26\n ORDER BY\n actors.name\n \nSQL\nend", "def popularity(movie_id)\n movie_id = movie_id.to_i\n unless(@data[:movie_id][movie_id][:popularity])\n factor = 1.1\n totRatings = @data[:movie_id][movie_id][:ratings].length\n aveRating = @data[:movie_id][movie_id][:ratings].inject(:+) / totRatings\n pop = ((1 - (1/(factor ** totRatings))) * aveRating) +\n (3/(factor ** totRatings))\n\n @data[:movie_id][movie_id][:popularity] = pop\n end\n\n @data[:movie_id][movie_id][:popularity]\n end", "def findTopMovies(actor, top_number=100) \r\n movie_array = []\r\n\r\n actor.film_actor_hash.each_key {|key| movie_array.push(key)}\r\n\r\n return movie_array.take(top_number)\r\nend", "def popularity(id_number)\n return temp_movie = @movie_list[id_number].popularity unless @movie_list[id_number] == nil\n return 0\n end", "def popularity_list\n @popularity_list=@movie_index.sort_by { |x| -x[1].size }.col(0) if @popularity_list.nil?\n @popularity_list\n end", "def movies u\n \tuser_ratings = @userdata[u.to_s.to_sym]\n \tsize = user_ratings.size\n \tmovies = []\n \tuser_ratings.each do |id, rating|\n \t\tmovies.push(id)\n \tend\n\n \t#puts size\n \t#puts movies.size\n \treturn movies\n end", "def most_similar(u_id,m_id=nil,count=25) \n #get all users watched movie m_id\n users=data.viewers(m_id) - [u_id]\n result=users.map {|u2| [u2,similarity(u_id,u2)]}.sort_by! { |x| -x[1]}\n count.nil? ? result : result.take(count)\n end", "def popularity(movie_id)\n @movie_index[movie_id].size\n end", "def max_sum_ratings\n @movies.map { |_, movie| movie.sum_ratings }.max\n end", "def index\n \t@ratings = Rating.includes(:user, beer: :brewery).all\n @top3Beers = topbeer @ratings, 3\n @top3Breweries = topbrewery @ratings, 3\n @top3Raters = User.top 3\n @top3Styles = topstyle @ratings, 3\n @recent = @ratings.order(created_at: :desc).limit(5)\n end", "def find_best_related_movies\n [].tap do |related_movies|\n sorted_movie_relation_ids.each_with_index do |movie_id, index|\n related_movies << Movie.find(movie_id) if movie_is_relevant?(movie_id, index)\n end\n end\n end", "def popularity(movie_id)\n\t\treturn movie_popularity_hash[movie_id]\n\tend", "def topMatches( prefs, person, n=5, scorefunc = :sim_pearson )\n scores = []\n for other in prefs.keys\n if scorefunc == :sim_pearson\n scores << [ sim_pearson(prefs,person,other), other] if other != person\n else\n scores << [ sim_distance(prefs,person,other), other] if other != person\n end\n end\n return scores.sort.reverse.slice(0,n)\n end", "def topMatches( prefs, person, n=5, scorefunc = :sim_pearson )\n scores = []\n for other in prefs.keys\n if scorefunc == :sim_pearson\n scores << [ sim_pearson(prefs,person,other), other] if other != person\n else\n scores << [sim_distance(prefs,person,other), other] if other != person\n end\n end\n return scores.sort.reverse.slice(0,n)\n end", "def top_matches(item_prefs, item, number=5)\n scores = []\n\n item_prefs.keys.each do |other|\n if other != item\n similarity = distance_similarity(item_prefs, item, other)\n\n if similarity > 0\n scores << [similarity, other]\n end\n end\n end\n\n scores = scores.sort_by { |score| -score[0] }\n\n return scores[0, number]\n end", "def highest_review \n\t\tself.reviews.sort_by{ |review| review.rating }.reverse.first\n\tend", "def highest_review \n\t\tself.reviews.sort_by{|review| review.rating }.reverse.first\n\tend", "def popularity(movie_id)\n #get all records which their movie_id is equal to the argument\n movie_data=@movies[movie_id] \n \n #return 0 if there is no such a movie in data\n if movie_data.size==0\n return 0\n end\n \n #calculate the average of all ratings for this movie id and return it\n sum=0.0\n movie_data.each do |movie|\n sum+=movie[2]\n end\n return (sum/movie_data.size) \n end", "def popularity(movie_id)\n\t\tsum=0\n\t\[email protected] do |key,info_list|\n\t\t\tinfo_list.each do |info|\n\t\t\t\tif info[0].to_i==movie_id.to_i\n\t\t\t\t\tsum+=info[1].to_i\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\treturn sum\n\tend", "def most_popular\n\n # Recipecard.all.select {|rc| rc.recipe ==self}\n # most_popular.map {|rc| rc.users}\n recipe_hash = {}\n RecipeCard.all.each do |recipecard|\n if recipe_hash[recipecard.name]==nil\n recipe_hash[recipecard.name]=1\n else\n recipe_hash[recipecard.name]+= 1\n end\n end\n recipe_hash.max_by{|k,v| v}[0]\n end", "def biggest_years_for_little_danny\n MovieDatabase.execute(<<-SQL)\n select movie.yr, count(movie.id) as count\n from movie\n join casting on movie.id = casting.movieid\n join actor on casting.actorid = actor.id\n where actor.name = 'Danny DeVito'\n group by movie.yr\n having count(movie.title) > 2\n SQL\nend", "def movies u\n @usr_rating[u].keys\n end", "def find_most_played_songs\n top_songs_with_play_count_pair = self.lib.songs.reject do |song|\n #this line is describing records it will get rid of\n (!song.metadata.has_key?('play_count')) or (song.metadata['play_count'] == nil)\n end\n\n top_songs_played_sorted = top_songs_with_play_count_pair.sort do |a, b| \n b.metadata['play_count'].to_i <=> a.metadata['play_count'].to_i\n end\n\n top_songs_played = top_songs_played_sorted.first(5)\n song_names_of_top_played = top_songs_played.collect {|song| song.metadata['name']} \n end", "def popularity(movieId)\n return \"ERROR: No such movie ID in the database\" if @ratedMoviesHash[\"#{movieId}\"].nil?\n return average(@ratedMoviesHash[\"#{movieId}\"]) + (2 ** (@ratedMoviesHash[\"#{movieId}\"].length / (@allUsersHash.keys.length).to_f)) - 1\n\tend", "def find_frequently_reviewed_restaurants(topic, reviewer)\n restaurants = reviewer.subscribed_restaurants.by_topic(topic.id)\n frequency_with_restaurants = {}\n restaurants.each do |restaurant|\n frequency_with_restaurants[restaurant] ||= 0\n frequency_with_restaurants[restaurant] += 1\n end\n\n sorted = frequency_with_restaurants.sort{|v1, v2| v2.last <=> v1.last}\n\n # Take top 5 restaurants\n sorted[0..5]\n end", "def top_five(db)\r\n\t \tputs \"\\t -- Top Five -- \"\r\n\t \tputs \" - - Title - - Rating - - Comments - - \"\r\n\t\tmovie = db.execute(\"SELECT * FROM movies WHERE rating = 10 ORDER BY title ASC LIMIT 5\")\r\n\t\tmovie.each do |mov|\r\n\t\t\tprintf \" * %-13s| %-4s| %-5s\\n\", \"#{mov['title']}\", \"#{mov['rating']}\", \"#{mov['comments']}\"\r\n\t\tend\r\n\t\tputs\"-\"*60\r\n\tend", "def top_songs(n = 3)\n top_list = @tracks.sort_by {|s| s.play_count}.reverse\n return top_list[0..n-1].compact\n end", "def popularity_list\r\n\t\tif @mov_pop_ar_hs.nil?\r\n\t\t\tputs \"data has not been loaded\"\r\n\t\t\treturn[]\r\n\t\telse\r\n\t\t\tmovie_avg_pop={}\r\n\t\t\tcount = 0\r\n\t\t\twhile count < @mov_pop_ar_hs.length\r\n\t\t\t\tmovie_avg_pop[count]=popularity(count)\r\n\t\t\t\tcount = count + 1\r\n\t\t\tend\r\n\t\t\t#sort from highest to lowest\r\n\r\n\t\t\treturn movie_avg_pop.sort_by {|movie, pop| pop}.reverse\r\n\t\tend\r\n\tend", "def top_5\n count = @sentence.blips.group(:body).distinct.count\n percent = count.each {|k, v| count[k] = v / @sentence.blips_count.to_f }\n statistics = percent.sort_by { |k, v| v }.reverse[0..4].flatten.each { |k, v| puts \"#{k}: #{v}\" }\n end", "def most_popular_profession_per_year\n sql = <<-SQL\n WITH mp AS (\n SELECT show_year,\n guest_occupation,\n \tCOUNT(id) as occupation_count\n FROM guest_appearances\n GROUP BY guest_occupation, show_year)\n SELECT show_year, guest_occupation, MAX(occupation_count) as frequency\n FROM mp\n GROUP BY show_year;\n SQL\n DB[:conn].execute(sql).each {|record| puts \"#{record[0]}: #{record[1]}, #{record[2]}.\"}\nend", "def top_review_movie\n @top_movie = Movie.where(:kind => \"a\").order(\"plays desc\").page\n end", "def get_5_positive_grain\n\t\tplaceholder_review = CriticMovie.new\n\t\tplaceholder_review.score = 0 \n\t\ttop_5 \t\t\t=\t[placeholder_review,placeholder_review,placeholder_review,placeholder_review,\n\t\t\tplaceholder_review,placeholder_review,placeholder_review,placeholder_review,placeholder_review,\n\t\t\tplaceholder_review]\n\t\tpositive_grain_array = []\n\t\tcritics_movies_hash = {}\n\t\tcritic_id = params[:id]\n\t\treviews = Critic.find(critic_id).critic_movies\n\n\t\t# create array of movies to pull batch from because it's super expensive to hit the database 1300 times per user request\n\t\tmovies_array = []\n\t\treviews.each do | review |\n\t\t\tmovies_array.push(review.movie_id)\n\t\tend\n\n\t\t# Get an array of movie objects that the critic has seen\n\t\tcritics_movies = Movie.find(movies_array)\n\t\t# [{some movie}, {some other movie}]\n\n\t\t# create a hash with movie id as key so we can grab the metacritic score to create our new object\n\t\tcritics_movies.each do | movie | \n\t\t\tcritics_movies_hash[movie.id] = {\"metacritic_score\": movie.metacritic_score, \"movie_name\": movie.title.titleize}\n\t\tend\n\n\t\t# Create the unsorted result\n\t\t# reviews are all the objects showing the critics id, the movies id, and the score of the critic\n\t\t# we iterate through each of those reviews\n\t\t# we assign the movie's id to a variable\n\t\t# we then print object from the critics_movie_hash showing metascore and movie name\n\t\t# we then store the metacritic score from that object into a variable named metascore\n\t\t# we then store the movie name from that has into a movie name variable\n\t\t# we then print the critic score, movie name, metascore, movie id, calculate the difference\n\t\t# for critic and meta and then create an object that we will then sort through to get the top or bottom\n\t\t# 5 to then return as JSON\n\t\treviews.each do | review |\n\t\t\tmovie_id \t\t= \treview.movie_id\n\t\t\tmovie_name \t\t= critics_movies_hash[movie_id][:movie_name]\n\t\t\tcritic_score \t= review.score\n\t\t\tmetascore \t\t= critics_movies_hash[movie_id][:metacritic_score]\n\n\t\t\t# If the review is less than two years ago, it can be evaluated for our top 5 \n\t\t\tif review.date >= 3.year.ago\n\t\t\t\t# get the lowest value index and compare the review against that\n\t\t\t\ttop_5.sort_by! { |k| k[:score]}\n\t\t\t\tif critic_score > top_5[0][:score]\n\t\t\t\t\tmovie_name \t\t= critics_movies_hash[movie_id][:movie_name]\n\t\t\t\t\tcritic_score \t= review.score\n\t\t\t\t\tmetascore \t\t= critics_movies_hash[movie_id][:metacritic_score]\n\t\t\t\t\trecommend_object = { \"movie_name\": movie_name, score: critic_score,\n\t\t\t\t\t\t\"metascore\": metascore }\n\t\t\t\t\ttop_5[0] = recommend_object\n\t\t\t\tend\n\t\t\tend\t\n\t\t\t# if the score is 0 then that means it was a TBD meaning not enough critic votes and it was converted to 0\n\t\t\t# we do not want this in our array because it will create artificially high or low against the grain scores that are false so\n\t\t\t# we skip this loop iteration and evaluate the next one\n\t\t\tif metascore == 0\n\t\t\t\tnext\n\t\t\tend\n\t\t\tdifference\t= critic_score - metascore \n\t\t\tsingle_movie = {\"movie_name\": movie_name, \"metascore\": metascore, \"critic_score\": critic_score, \"difference\": difference, }\n\t\t\tpositive_grain_array.push(single_movie)\n\t\t\t# {movie_id: 3, critic_score: 34, metascore: 50, difference: -16, }\n\t\tend\n\n\t\t# if there were not enough reviews to establish a metacritic score it's set to TBD which translates to 0 when it's scraped into the \n\t\t# \tint type. So if the review is 0 we reject it\n\t\ttop_5.reject! {| review | review[:score] == 0} \n\n\t\t# Sort the result, put it into an array and convert to json\n\t\tpositive_grain_array.sort_by! { |k| k[:difference]}\n\t\ttop_5.sort_by! { |k| k[:score]}.reverse!\n\t\tnegative_grain = positive_grain_array.first(5)\n\t\tnegative_grain.reverse!\n\t\tpositive_grain = positive_grain_array.pop(5)\n\t\tnegative_positive = positive_grain.reverse! + negative_grain.reverse! + top_5\n\t\tnegative_positive = negative_positive.to_json\n\n\n\t\trender :json => negative_positive\n\tend", "def popularity(movie_id)\n subdata = @data.select { |item| item[1].to_i == movie_id }.map { |item| item[2].to_i }\n subdata.reduce(:+) / subdata.length\n end", "def popularity(movieid)\n movielist = popularitylist\n position = movielist.index movieid.to_s.to_sym\n if position\n puts @moviedata.keys.size\n return @moviedata.keys.size - position\n else\n puts \"Movie not found\"\n return nil\n end \n end", "def top_readers\n readers_with_duplicates = []\n self.articles.each { |article| readers_with_duplicates << article.readers }\n\n readers_with_duplicates.flatten!\n readers = readers_with_duplicates.uniq\n frequency = Hash.new(0)\n readers_with_duplicates.each { |r| frequency[r] += 1 }\n array = frequency.sort_by { |key, value| value }\n return [array[-1], array[-2], array[-3]]\n\n end", "def most_popular_screening_film\n most_popular = nil\n unsold_tickets = 2 #max capacity of the cinema\n screenings = return_film_screenings\n screenings.each do |screening|\n if screening.tickets_left.to_i < unsold_tickets\n most_popular = screening\n end\n end\n return most_popular\n end", "def most_liked(n)\n QuestionLike.most_liked_questions(n)\n end", "def most_similar(u)\n mSimilar= {}\n reviews_hash.each do |user, moveis| \n if (s = similarity(u,user)) >= 0.8\n mSimilar[user] = s\n end \n end\n return mSimilar\n end", "def max_rating\n 10\n end", "def count_people_ordered_most_popular_books(count_of_popular_books)\n most_popular_books = most_popular\n people = Array.new\n most_popular_books[0..count_of_popular_books].each do |book|\n @readers.each do |name, value|\n value.orders.detect do |order|\n# p \"order.book=\"+order.book.to_s\n# p \"book=\"+book.title.to_s\n p \"Book.class= \"+order.book.class.to_s\n people << value if book == order.book\n end\n end \n end\n return people.size #maybe a good idea return all people?\n end", "def popularity(movieid)\n\t\tmovielist = popularitylist\n\t\tposition = movielist.index movieid.to_s.to_sym\n\t\tif position\n\t\t\tputs @moviedata.keys.size\n\t\t\treturn @moviedata.keys.size - position\n\t\telse\n\t\t\tputs \"Movie not found\"\n\t\t\treturn nil\n\t\tend \t\t\n\tend", "def popularity_list\n #pop_list is an array of all movie ids and their popularity ([movie_id,popularity])\n if @pop_list==nil \n @pop_list=Array.new\n @data.each do |itm|\n movie_id=itm[1]\n #if this movie id does not exist in the list, add it to the list\n if @pop_list.index{|x| x[0]==movie_id}==nil \n @pop_list.push([movie_id,popularity(movie_id)])\n end\n end\n #sort the pop_list array descending based on popularity (average rating)\n @pop_list.sort_by!{|item| -item[1]}\n end\n return @pop_list \n end", "def top_reviewers(p_topic, p_limit = 10)\n User.find(\n :all,\n :select => 'DISTINCT users.*',\n :joins => :reviews,\n :group => 'reviews.id',\n :order => 'count(reviews.id) DESC',\n :conditions => ['reviews.topic_id = ?', p_topic.id],\n :limit => p_limit\n )\n end", "def select_actors_greedy(k, r, n, actor_list)\n # pick the actor with the most movies as first actor\n result_a = [0]\n result_m = actor_list[0][1].clone\n result_q = result_m.length\n\n # store the indexes of actors that are still being considered\n actor_indexes = Array(1..n)\n\n # pick the remaining k-1 actors (since 1st has been picked)\n 1.upto(k-1) do |i|\n best_index = actor_indexes[0] # first actor still being considered\n best_q = result_q\n best_m = result_m.clone\n\n # examine all the actors still being considered\n for index in actor_indexes do\n # optimisation\n # don't go on if the remaining actors are too small to improve on\n # the currently found best quality\n break if result_q + actor_list[index][1].length < best_q\n\n # get all the movies that the actors are in (without duplicates)\n c_movies = best_m.clone | actor_list[index][1]\n\n # replace if better than previous solution\n if c_movies.length > best_q\n best_index = index\n best_q = c_movies.length\n best_m = c_movies\n end\n end\n\n # take the best found solution\n result_a << best_index\n result_q = best_q\n result_m = best_m\n actor_indexes.delete(best_index)\n end\n\n # convert actor ID to actor names\n return result_a.map { |i| actor_list[i][0] }\nend", "def list_ratings\n final_result = []\n # grab all of the rating attributes and counts and turn them into an array\n rating_results = rating.count_attributes.to_a\n \n # order the rating counts and attributes\n ordered_results = []\n ['one', 'two', 'three', 'four'].each do |order|\n rating_results.each do |result|\n if order == result[0]\n ordered_results << result\n end\n end\n end\n \n # add in the friendly name\n for i in 0...ordered_results.length\n final_result << [AppConstants::FRIENDLY_RATING_NAMES[i],ordered_results[i][0],(ordered_results[i][1].to_f/total_votes.to_f)*100]\n end\n \n final_result\n end", "def calculate_team_ratings(roster)\n ratings = Array.new\n roster.each do|player|\n if (player && player.profile && player.profile.rating)\n ratings.push(player.profile.rating.total)\n end\n end\n \n top_ratings = ratings.sort.reverse.take(10)\n top_ratings.sum\n end", "def most_similar(u)\n\t\tif (!@sim_set[u].nil?)\n\t\t\treturn @sim_set[u]\n\t\tend\n\t\tcommon_list = Array.new\n\t\t@user_set.keys.each do |user|\n\t\t\tcommon_list.push([similarity(u, user.to_i), user]) if (u != user && similarity(u, user.to_i) > 0)\n\t\tend\n\t\ttop_ratings = common_list.to_h.keys.sort.last(5)\n\t\tsim_users = Array.new\n\t\ttop_ratings.each do |key| sim_users.push(common_list.to_h[key]) end\n\t\tgenerate_relative_similarities(u, sim_users)\n\t\t\treturn sim_users\n\t\tend", "def best_movies\n doc.search('#BestFilmList a').map(&:text)\n end", "def third_greatest(arr)\n third_longest = arr.max_by(3, &:size).last\n arr.select { |word| word.size == third_longest.size }.last\nend", "def popularity_list2\n \n if @pop_list==nil \n #pop_map is a map that contains items with the key \"movie_id\" and value \"[rate_sum,count]\". \n pop_map=Hash.new\n @data.each do |itm|\n if !pop_map.has_key?(itm[1]) #if this movie id does not exist in the map, add it to the map\n pop_map[itm[1]]=[itm[2],1]\n else #if this movie id exist in the map, sum up the existing \"rate_sum\" with rating of the current item and increase \"count\" by 1.\n pop_map[itm[1]][0]+=itm[2]\n pop_map[itm[1]][1]+=1\n end\n end\n @pop_list=Array.new\n pop_map.each_pair do |key,value|\n #push each movie id and its average rating to the pop_list. average= rate_sum/count\n @pop_list.push([key,value[0].to_f/value[1]])\n end\n #sort the pop_list array descending based on popularity (average rating)\n @pop_list.sort_by!{|item| -item[1]}\n end\n return @pop_list \n end", "def filter_articles(articles)\n include PopularitySearch\n #this isn't fair to more recent articles\n popularity_cutoff = 300\n articles.each do |article|\n article[:twitter_pop] = twitter_popularity(article[:url])\n end\n articles.select do |article|\n article[:twitter_pop] > popularity_cutoff\n end\n articles = articles.sort_by{|article| article[:twitter_pop]}.reverse\n return articles[0..2] #only pick the top 3 if there's more than 3\nend", "def select_experiences_to_show_by_popularity(experiences)\n experiences_with_votes = []\n experiences_to_show = []\n experiences.each do |exp|\n experiences_with_votes << exp if exp.nb_votes\n end\n experiences_to_show = experiences_with_votes.sort_by { |e| e.nb_votes }\n experiences_to_show = experiences_to_show.reverse\n experiences.each do |exp|\n experiences_to_show << exp unless exp.nb_votes\n end\n experiences_to_show\n end", "def recommended_movies\n details.css('.rec-title').reject do |node|\n # reject movies that don't have a release year yet\n node.at('span').nil?\n end.reject do |node|\n # reject everything other than featured film\n /\\d{4}-\\d{4}/.match(node.at('span').text) ||\n /Series|Episode|Video|Documentary|Movie|Special|Short|Game|Unknown/.match(node.at('span').text)\n end.map do |node|\n imdb_id = node.at(\"a[href^='/title/tt']\")['href'].parse_imdb_id\n title = node.at('a').text.strip\n year = node.at('span').text.parse_year\n\n [imdb_id, title, year]\n end.map do |values|\n Spotlite::Movie.new(*values)\n end\n end", "def top_actors\n @top_actors ||= imdb_top_actors.sort_by { |actor, parameters| -parameters[:count] }\n \n logger.debug \"Top Actors: #{@top_actors.inspect}\"\n @top_actors\n end", "def top_3_rank_contributors\n top_3 = User.top_contributors_by_rank.select { |user| user.rank <= 3 }\n\n top_3.map do |user|\n {\n user_id: user.id,\n first_name: user.first_name,\n last_name: user.last_name,\n photo_url: user.photo_url,\n badges_sum: user.badges_sum,\n badges_count: user.badges_count,\n rank: user.rank,\n badges: {\n gold: user.gold.to_i,\n silver: user.silver.to_i,\n bronze: user.bronze.to_i\n }\n }\n end\n end", "def num_ratings \n 5\n end", "def get_top_10_movies_for_user(user_hash)\n Movie.get_top_10_movies_for_user(user_hash)\nend", "def top_review_tv\n @top_tv = Movie.where(:kind => \"b\").order(\"plays desc\").page\n end", "def who_ordered_best_book\n\t\tbooks = Hash.new(0)\n\t @orders.each { |order| books[order.book.title] += 1 }\n\t books = books.sort_by(&:last).take(3).map(&:first)\n\t readers = []\n\t @orders.each { |order| readers << order.name if books.include? order.book.title }\n\t readers.uniq.size\n\t end", "def bottom_three_rated_events\n self.lowest_events_by_rating.first(3)\n end", "def bookGenre\n\t\tarr =[]\n\t\tcurrent_user.reads.each do |f|\n\t\t\tarr.push(Book.find_by_id(f.book_id).genre)\n\t\tend\n\t\th = Hash.new(0)\n\t\t\tarr.each do |word|\n\t\t\th[word] += 1\n\t\tend\n\t\tgenre = h.sort_by{|word,count| count}\n\t\tgenre = genre.reverse # Hash highest the genre picked the most\n\n\t\tarr2 =[]\n\t\tgenre.each do |key,value|\n\t\t\tarr2.push(key)\n\t\tend\n\t\tif(arr2.size > 1)\n\t\t\t@popGenre = arr2.at(0)\n\t\telse\n\t\t\t@popGenre = \"Adventure\"\n\t\tend\n\tend", "def predict(user_id, movie_id)\n movie_average_rating = set.popularity(movie_id)\n #puts \"The popularity of movie #{movie_id} is #{movie_average_rating}\"\n\n most_similar_users_list_ratings = set.most_similar(user_id)[0..29].collect do |u, r|\n if rating(u, movie_id)!=0 then\n rating(u, movie_id)\n end\n end.compact[0..9]\n #puts \"Actual rating: #{rating(user_id, movie_id)}\"\n #puts \"most_similar_users_list_ratings: #{most_similar_users_list_ratings}\"\n #puts \"Prediction: #{take_average(most_similar_users_list_ratings)}\"\n\n if most_similar_users_list_ratings.size > 0\n avg_most_similar_users_ratings = take_average(most_similar_users_list_ratings)\n 0.3*avg_most_similar_users_ratings+0.7*movie_average_rating\n else\n movie_average_rating\n end\n end" ]
[ "0.7643522", "0.74959177", "0.72983307", "0.7244247", "0.72330576", "0.7233017", "0.7198264", "0.70142", "0.69856566", "0.6966169", "0.6727835", "0.6679263", "0.6637253", "0.65064687", "0.6476164", "0.6474964", "0.6453817", "0.645235", "0.64509267", "0.64451855", "0.64397365", "0.64394194", "0.63793856", "0.63743526", "0.6359259", "0.6313884", "0.6298856", "0.6279861", "0.62571776", "0.6221339", "0.6218876", "0.6178217", "0.6178215", "0.6151949", "0.6139261", "0.6124328", "0.60620606", "0.60521513", "0.60504234", "0.6028152", "0.60039604", "0.59618783", "0.59510225", "0.594722", "0.593962", "0.5931324", "0.5929289", "0.59286606", "0.58960545", "0.58944374", "0.58873916", "0.58477587", "0.58461505", "0.5842172", "0.58189356", "0.5813712", "0.5811558", "0.58093274", "0.5798631", "0.57929707", "0.5786157", "0.57752043", "0.57723886", "0.576447", "0.5759441", "0.57500637", "0.5736611", "0.57255787", "0.5725008", "0.57186633", "0.5715558", "0.5708157", "0.570014", "0.5684344", "0.568311", "0.56830543", "0.56804687", "0.5678032", "0.5657514", "0.56390834", "0.56252694", "0.5618558", "0.56179315", "0.56159", "0.55970216", "0.5585005", "0.5584964", "0.55742025", "0.55642706", "0.5553518", "0.5553155", "0.554836", "0.55455875", "0.55417013", "0.55415374", "0.55392987", "0.5537488", "0.55327237", "0.5515516", "0.55145085", "0.5512111" ]
0.0
-1
def after_sign_in_path_for(resource) root_url(:subdomain => current_user.username) sign_in(current_user) end
def theme_name if params[:action] == "home" @theme_name = ThemeOption.where(user_id: current_user.id).first.template.downcase else "application" end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def after_sign_in_path_for(resource)\n if resource.class == 'Group'\n # root_url(:subdomain => current_user.subdomain)\n root_url\n else\n root_url\n end\n end", "def after_sign_in_path_for(_resource)\n root_url\n end", "def after_sign_in_path_for(user)\n app_url(subdomain: current_company.subdomain)\n end", "def after_sign_in_path_for(resource)\n user_root_path(resource)\n end", "def after_sign_in_path_for(resource)\n authenticated_root_path\n end", "def after_sign_in_path_for(resource)\n root_path\n end", "def after_sign_in_path_for(resource)\n root_path\n end", "def after_sign_in_path_for(resource)\n root_path\n end", "def after_sign_in_path_for(resource)\n root_path\n end", "def after_sign_in_path_for(resource)\n root_path(resource)\n end", "def after_successful_sign_in_url\n root_path\n end", "def after_sign_in_path_for(resource)\n :root\n end", "def after_sign_in_path_for(_resource_or_scope)\n user_root_path\n end", "def after_sign_in_path_for(resource)\n\t root_path\n\tend", "def after_sign_in_path_for(resource)\n '/'\n end", "def after_sign_in_path_for(resource)\n case resource\n when User then\n #store session user for gmail style login\n session[:user_id] = current_user.id\n #remember to use url for changing subdomain\n #stored_location_for(resource) will store the last location b4 login\n request.env['omniauth.origin'] || stored_location_for(resource) || root_url(subdomain: resource.current_education.university.codename)\n when Admin then\n rails_admin_path\n end\n end", "def after_sign_in_path_for(resource)\n user_path(current_user.id)\n end", "def after_sign_in_path_for(resource_or_scope)\n root_path\n end", "def after_sign_in_path_for(resource)\n user_path(current_user)\n \tend", "def after_sign_in_path_for(resource)\n user_path(current_user)\n end", "def after_sign_in_path_for(_resource)\n root_path\n end", "def after_sign_in_path_for(resource)\n user_path(current_user)\n end", "def after_sign_in_path_for(resource)\r\n app_root + \"/welcome\"\r\n end", "def after_sign_in_path_for(resource)\n root_path\n end", "def after_sign_in_path_for(_resource)\n user_path(current_user.id)\n end", "def after_sign_in_path_for(resource)\n urls_path\n end", "def after_sign_in_path_for(resource)\n user_path(current_user)\n end", "def after_sign_in_path_for(resource)\n user_path(current_user)\n end", "def after_sign_in_path_for(resource)\n user_path(current_user)\n end", "def after_sign_in_path_for(resource)\n # # sign_in_url = new_user_session_url\n if user_signed_in? && @user.role == 0\n root_path resource\n else\n user_path resource\n end\n end", "def after_sign_in_path_for(resource)\n '/home'\n end", "def after_sign_in_path_for(user)\n user_url(user)\n end", "def after_sign_in_path_for(resource)\n hub_user_path resource\n end", "def after_sign_in_path_for(resource)\n \"/users/#{current_user.id}\"\n end", "def after_sign_in_path_for(resource)\n session[:user_return_to] || root_path\n end", "def after_sign_in_path_for(resource_or_scope)\n '/user'\n end", "def after_sign_in_path_for(resource_or_scope)\n home_path\n end", "def after_sign_in_path_for(_resource)\n auths_path\n end", "def after_sign_in_path_for(resource)\n user_path(current_user.id) # ログイン後に遷移するpathを設定\n end", "def after_sign_out_path_for(resource_or_scope)\n #remember to use url for changing subdomain\n new_user_session_url(subdomain: nil)\n end", "def after_sign_in_path_for(resource)\n if current_user.present?\n users_path\n else\n admin_root_path\n end\n end", "def after_sign_up_path_for(resource)\n after_sign_in_path_for(resource)\n root_path\n end", "def after_sign_in_path_for(resource_or_scope)\n company_root_path\n end", "def after_sign_in_path_for(resource)\n if @user\n user_path(current_user.id) \n end\n end", "def after_sign_in_path_for(resource)\n home_passthrough_path\n end", "def after_sign_in_path_for(_resource)\n user_path(current_user.id) # ログイン後に遷移するpathを設定\n end", "def after_sign_in_path_for(resource)\n session[\"user_return_to\"] || root_path\n end", "def after_sign_in_path_for(resource)\n session[\"user_return_to\"] || root_path\n end", "def after_sign_in_path_for(resource)\n session[\"user_return_to\"] || root_path\n end", "def after_sign_in_path_for(resource)\n (session[:usuario_return_to].nil?) ? \"/\" : session[:usuario_return_to].to_s\n end", "def after_sign_in_path_for(user)\n \tuser_path user\n \tend", "def after_sign_in_path_for(resource_or_scope)\n flash[:notice] = \"\"\n authenticated_root_url\n end", "def after_sign_in_path_for(resource)\n session[\"user_return_to\"] || dashboard_path\n end", "def after_sign_in_path_for(resource_or_scope); end", "def after_sign_in_path_for(resource)\n admin_root_path\n end", "def after_sign_in_path_for(resource)\n welcome_path\n end", "def after_sign_in_path_for(resource)\n welcome_path\n end", "def after_sign_in_path_for(resource)\n inside_path\n end", "def after_inactive_sign_in_path_for(resource)\n :root\n end", "def after_sign_in_path_for(user)\n \"/\"\n end", "def after_sign_in_path_for(resource)\n dashboard_path\n end", "def after_sign_in_path_for(resource)\n dashboard_path\n end", "def after_sign_in_path_for(resource)\n '/index'\n end", "def after_sign_in_path_for(resource)\n redirect_to_home(resource)\n end", "def after_sign_in_path_for(resource_or_scope)\n current_user # redirects to a user's show page\n end", "def after_sign_in_path_for(resource)\n dashboard_index_url\n end", "def after_sign_in_path_for(user)\n if resource_params[:uv_login].present?\n # Redirect to UserVoice with sso token\n user_voice_url(user)\n else\n # ..just redirect to the app\n app_url(subdomain: current_company.subdomain)\n end\n end", "def after_sign_in_path_for(resource)\n \"/signedinuserprofile\"\n end", "def after_sign_in_path_for(resource)\n #current_user_path\n \"/news\"\n end", "def after_sign_in_path_for(resource)\n # resource.admin? ? rails_admin.dashboard_path : root_path\n root_path\n end", "def after_sign_in_path_for(resource)\n dashboard_path\n end", "def after_sign_in_path_for(resource_or_scope)\n \"/users/#{current_user.id}\"\n end", "def after_sign_in_path_for(resource_or_scope)\n current_user\n end", "def after_sign_in_path_for(_resource)\n current_user.email? ? root_url : edit_user_registration_url\n end", "def after_sign_in_path_for(resource)\n dashboard_path(current_user.id)\n end", "def after_sign_in_path_for(resource)\n backend_index_path\n end", "def after_sign_in_path_for(resource)\n session[:requested_url] || myriorunner_path\n end", "def after_sign_in_path_for(resource_or_scope)\n case resource_or_scope.class.name\n when 'Venue'\n venue_root_url(:protocol => 'http')\n when 'Admin'\n admin_root_url(:protocol => 'http')\n else\n super\n end\n end", "def after_sign_in_path_for(_resource)\n '/dashboard'\n end", "def after_sign_in_path_for(resource)\n stored_location_for(resource) || root_path\n end", "def after_sign_in_path_for(resource)\n\t'/dashboard'\nend", "def after_sign_in_path_for(resource)\n if current_user.sign_in_count == 1 || current_user.username == \"demo\"\n new_site_path\n else\n dashboard_path\n end\n end", "def after_sign_in_path_for(_resource)\n home_index_path\n end", "def after_sign_out_path_for(resource_or_scope)\n root_url(subdomain: nil)\n end", "def after_sign_in_path_for(resource)\n session[:forwarding_url] || root_path\n end", "def after_sign_in_path_for(resource)\n dashboard_path || super\n end", "def after_sign_in_path_for(resource)\n sign_in_url = new_user_session_url\n if request.referer == sign_in_url\n super\n else\n stored_location_for(resource) || request.referrer || root_path\n end\n end", "def after_sign_in_path_for(_resource_or_scope)\n backend_dashboard_path\n end", "def after_sign_in_path_for(resource)\n sufia.dashboard_index_path\n end", "def after_sign_in_path_for(resource)\r\n stored_location_for(resource) || root_path\r\n end", "def after_sign_up_path_for(resource)\n root_path\n end", "def after_sign_up_path_for(resource)\n root_path\n end", "def after_sign_up_path_for(resource)\n root_path\n end", "def after_sign_up_path_for(resource)\n root_path\n end", "def after_sign_in_path_for(resource_or_scope)\n 'https://www.recharles.xyz/'\n end", "def after_sign_in_path_for(resource)\n if @is_admin\n admin_path\n else\n root_path\n end\n end", "def after_sign_in_path_for(resource_or_scope)\n user_path(current_user)\n end", "def after_sign_in_path_for(resource_or_scope)\n user_path(current_user)\n end", "def after_sign_in_path_for(resource)\n stored_location_for(resource) || user_dashboard_path(resource.id)\n end", "def after_sign_in_path_for(_resource)\n cookies[:login_type] = \"local\"\n return root_path unless parameter_set?\n dashboard_works_path\n end", "def after_sign_in_path_for(resource_or_scope)\n user_path(current_user.id)\n end" ]
[ "0.88923585", "0.88681173", "0.8711681", "0.8688577", "0.8663956", "0.8646047", "0.8646047", "0.8646047", "0.8646047", "0.85914606", "0.85708886", "0.8560032", "0.85392797", "0.8530426", "0.85133135", "0.8473088", "0.847228", "0.845709", "0.8456469", "0.83489984", "0.83483994", "0.834721", "0.8339646", "0.83382654", "0.8329275", "0.83213687", "0.831966", "0.831966", "0.831966", "0.8300034", "0.8290491", "0.82815707", "0.8276529", "0.8266115", "0.8224175", "0.81977564", "0.81934375", "0.8189159", "0.8187729", "0.8186858", "0.8170347", "0.81635237", "0.81629235", "0.8161341", "0.8152751", "0.8149274", "0.81455916", "0.81455916", "0.81455916", "0.8142947", "0.81372035", "0.81356025", "0.81342006", "0.8122895", "0.81210583", "0.8091325", "0.8091325", "0.8084423", "0.8066094", "0.8064863", "0.8063894", "0.8063894", "0.8051559", "0.80476683", "0.8041328", "0.80331624", "0.8016111", "0.8003113", "0.8002746", "0.79953164", "0.79923296", "0.7987223", "0.79862595", "0.7980348", "0.79756546", "0.79740924", "0.7970316", "0.79661125", "0.7965939", "0.7964027", "0.7963795", "0.7957917", "0.795023", "0.79465526", "0.79440486", "0.7942614", "0.7940991", "0.79396635", "0.79345", "0.7925211", "0.79232556", "0.79232556", "0.79232556", "0.79232556", "0.7922135", "0.7918439", "0.79184324", "0.79184324", "0.79163176", "0.79155356", "0.7915191" ]
0.0
-1
Generate a contact URL
def to_url scheme = case phone_number_type when 'phone' then 'tel' when 'mobile' then 'tel' when 'fax' then 'fax' when 'email' then 'mailto' end return unless scheme "#{scheme}:#{number}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def url() \n\t #'http://' << ENV['DOMAIN'] << \n\t '/' << self.author.username.to_s << '/' << self.name.to_s\n end", "def account_with_url_for(contact)\n contact.account ? link_to(h(contact.account.name), account_path(contact.account)) : \"\"\n end", "def _url\n URI.join(domain, path_gen.for_uri)\n end", "def generate_url(template); end", "def create_url\n #we trim away all periods and break apart the name by spaces to use to acquire the url of the poet in the Poetry Foundation website\n name_no_periods = @name.tr(\".\", \"\")\n name_no_periods = name_no_periods.split(\" \")\n\n #we use name_no_periods to generate the url for the poet (example url: \"https://www.poetryfoundation.org/poets/ben-jonson\")\n url = \"https://www.poetryfoundation.org/poets/\"\n name_no_periods.each { |part| url = \"#{url}#{part}-\"}\n\n #this leaves an extra hyphen at the end, but we can just cut that off in the return.\n url = url.chop\n end", "def generate_url\n\t\tself.url ||= name.parameterize\n\tend", "def create_url (type,permalink,page)\n\t\tbase_url = \"http://api.crunchbase.com/v/2/\"\n\t\tuser_key = \"2f9f86ebf459116f9b1a6e86f24ba34b\" # This's Isabel's key\n\t\tuser_key2 = \"411490520ad9db1b432e77f1a25735a8\" # This's David's Key\n\t\tif permalink == \"\" then\n\t\t\tif @random_key == 1\n\t\t\t\turl = \"#{base_url}#{type}?page=#{page}&user_key=#{user_key}\"\n\t\t\t\t@random_key = 2\n\t\t\telsif @random_key == 2\n\t\t\t\turl = \"#{base_url}#{type}?page=#{page}&user_key=#{user_key2}\"\n\t\t\t\t@random_key = 1\n\t\t\tend\n\t\telse\n\t\t\tif @random_key == 1\n\t\t\t\turl = \"#{base_url}#{type}/#{permalink}?page=#{page}&user_key=#{user_key}\"\n\t\t\t\t@random_key = 2\n\t\t\telsif @random_key == 2\n\t\t\t\turl = \"#{base_url}#{type}/#{permalink}?page=#{page}&user_key=#{user_key2}\"\n\t\t\t\t@random_key = 1\n\t\t\tend\n\t\tend \n\t\treturn url \n\tend", "def build_call_url(word)\r\n\t\t\tURI.parse(URI.escape(base_url + word))\r\n\t\tend", "def create_url\n uri = Addressable::URI.new\n uri.query_values = properties\n \"#{ BASE_URI }#{ Hubspotter.configuration.portal_id }#{ create_endpoint }#{ uri.query }\"\n end", "def to_url\n\t\t\tto_uri.to_s\n\t\tend", "def email_link\n \"<a href='mailto:#{contact_email}'>Contact</a>\"\n end", "def campaign_url(address=nil)\n \"#{@mailgun.base_url}/#{@domain}/campaigns#{'/' + address.to_s if address}\"\n end", "def generate_url\n api_key = WavecellOtpAndSms.configuration.api_key\n sub_account = WavecellOtpAndSms.configuration.sub_account\n details = [uid, code]\n parameters = {\n uid: uid,\n code: code\n }\n query_string = parameters.to_a.map { |x| \"#{x[0]}=#{x[1]}\" }.join(\"&\")\n url = \"https://api.wavecell.com/otp/v1/#{sub_account}/#{uid}?code=#{code}\"\n HTTParty.get(url.to_str,\n :body => parameters.to_json,\n :headers => {\n \"Content-Type\" => \"application/json\",\n \"Authorization\" => \"Bearer #{api_key}\"\n })\n end", "def gen_url url, text\n scheme, url, = parse_url url\n\n \"[#{text.sub(%r{^#{scheme}:/*}i, '')}](#{url})\"\n end", "def send\n generate_url\n end", "def send\n generate_url\n end", "def facebook_url; \"https://facebook.com/#{facebook}\" end", "def url(email, format = nil)\n argument(email) { should be_a(String) }\n argument(format) { should be_one_of(:json, :xml) } if format\n\n uri = URI.parse('https://www.gravatar.com/')\n uri.path = '/' + email.to_md5\n uri.path += '.' + format.to_s if format\n uri.to_s\n end", "def build_url(host)\n host.protocol + host.url\n end", "def make_url\n # This works for most of the twitter calls\n \"http://ws.audioscrobbler.com/2.0/?method=#{resource_path}&artist=#{identifier}&limit=100&page=#{page}&api_key=#{api_key}&format=json\"\n end", "def build_url(input)\n url = \"#{GOOGLE_BOOKS_API_BASE_URL}#{input}\"\n url\nend", "def url\n case subject_type\n when USER, 'user'\n user_pretty_url( subject )\n when ALBUM, 'album'\n album_pretty_url( subject )\n when PHOTO, 'photo'\n photo_pretty_url( subject )\n else\n 'http://www.zangzing.com'\n end\n end", "def create_url\n\t\tif self.url.blank?\n\t\t\tself.url = self.title.downcase.gsub(/[^a-zA-Z0-9]+/, \"-\").chomp(\"-\")\n\t\tend\t\n\tend", "def to_url\n to_uri.to_s\n end", "def generate_url\n api_key = WavecellOtpAndSms.configuration.api_key\n sub_account = WavecellOtpAndSms.configuration.sub_account\n puts `curl -X POST https://api.wavecell.com/sms/v1/#{sub_account}/single -H \"Authorization: Bearer #{api_key}\" -H \"Content-Type: application/json\" -d $'{ \"source\": \"#{source}\", \"destination\": \"+63#{destination}\", \"text\": \"#{text}\", \"encoding\": \"#{encoding}\" }'`\n end", "def build_url(url)\n # this will remove any of the blank spaces. There is no reason for blank space in the url or brake lines\n url = url.gsub(\" \", \"\").gsub(/\\n/, \"\").gsub(/\\r/, \"\")\n \n \n # Step one tells me that the uri does have a http or a https to use\n one = url.slice(/(https|http)/)\n if one.nil?\n request_response = \"http://\"\n uri_split = url.split(\".\")\n else\n request_response = url.split(\"//\")[0] + \"//\"\n uri_split = url.split(\"//\")[1].split(\".\")\n end\n \n # Step two and three check for the .com and www at the begging. \n # The count is to make sure that is it missing something and not just taking the place of a sub domain.\n if uri_split.count <= 2\n two = url.slice(/(com|gov|org|net|mobi)/)\n three = url.slice(/(www)/)\n # don't add if the thing is there\n if three.nil?\n uri_split.unshift(\"www\")\n end\n if two.nil?\n uri_split << \"com\"\n end\n end\n path_seperator = uri_split[uri_split.length - 1].split(/\\//)\n if path_seperator && path_seperator.length <= 1\n uri_split[uri_split.length - 1] = path_seperator\n end\n string = uri_split.map{ |split| split }.join(\".\").to_s\n # I can't figure this part out but it sucks\n path_thing = string.split(/\\//) \n unless url.blank?\n url = request_response + string\n end\n end", "def complaint_url(address=nil)\n \"#{@mailgun.base_url}/#{@domain}/complaints#{'/' + address if address}\"\n end", "def cc_url(curation_concern)\n # if curation_concern.is_a? ::Collection\n # curation_concern.collection_url\n # else\n # Rails.application.routes.url_helpers.polymorphic_url(curation_concern)\n # end\n ::Deepblue::EmailHelper.curation_concern_url( curation_concern: curation_concern )\n end", "def cobot_url(subdomain = 'www', *path_options)\n path = path_options.first.is_a?(String) ? path_options.first : '/'\n options = path_options.find{|p| p.is_a?(Hash)} || {}\n\n url = URI.parse(CobotClient::UrlHelper.site)\n url.host = url.host.split('.').tap{|parts| parts[0] = subdomain}.join('.')\n url.path = path\n url.query = URI.encode_www_form(options[:params]) if options[:params] && options[:params].any?\n\n url.to_s\n end", "def contact\n # STUB\n end", "def contact_link\n begin\n require 'open-uri'\n require 'hpricot'\n api_url = \"http://www.api.sunlightlabs.com/people.getDataCondition.php?BioGuide_ID=#{bioguideid}&output=xml\"\n response = Hpricot.XML(open(api_url))\n entry = (response/:entity_id).first.inner_html\n api_person_url = \"http://api.sunlightlabs.com/people.getDataItem.php?id=#{entry}&code=webform&output=xml\"\n person_response = Hpricot.XML(open(api_person_url))\n webform = (person_response/:webform).first.inner_html\n return webform \n catch Exception\n return false\n end\n end", "def partner_ref_url(resource)\n uri = URI.parse(root_url)\n uri.query = URI.encode_www_form(partner: resource.name)\n uri.to_s\n end", "def googleplus_url; \"https://plus.google.com/#{googleplus}\" end", "def construct_url(uri)\n \"#{uri.scheme}://#{uri.host}#{uri.path}\"\n end", "def email_formatted_urls\n \n # Go through the 3 urls in the record and retrieve the urls for the \n # caller\n urls = []\n 1.upto(3) do |i|\n url = self.send(\"url#{i}\")\n break if url == ''\n urls << url\n end\n \n url_string = ''\n if urls.size > 0\n url_string = 'REFERENCES: '\n url_string += urls.join(\"\\n \")\n url_string += \"\\n--------------------------------------------------------------------------------\"\n end\n \n return url_string\n \n end", "def full_uri company\n uri = company.website\n uri =~ %r(https?://) ? uri : \"http://#{uri}\"\n end", "def full_uri company\n uri = company.website\n uri =~ %r(https?://) ? uri : \"http://#{uri}\"\n end", "def build_request_url\n \"http://snipr.com/site/snip?r=simple&link=#{ensure_http}\"\n end", "def generate_tracking_url\n self.tracking_url ||=\n courier.generate_tracking_url(\n consignment: consignment_number,\n postcode: postcode,\n order_number: order_number\n )\n end", "def contact\n end", "def contact\n end", "def contact\n end", "def contact\n end", "def contact\n end", "def contact\n end", "def contact\n end", "def contact\n end", "def contact\n end", "def contact\n end", "def contact\n end", "def contact\n end", "def contact\n end", "def contact\n end", "def fake_url\n protocol = rand(10) > 8 ? \"http\" : \"https\"\n domain = (rand(3)+2).times.map{ rand(2 ** 12).to_s(32) }.join(\".\")\n path = words(rand(5)).join(\"/\")\n \n \"#{protocol}://#{domain}/#{path}\"\nend", "def contact\n\n end", "def contact\n\n end", "def format_url\n self.url.chomp\n if self.url.match(\"https://\") || self.url.match(\"http://\")\n else self.url = \"http://\" + url\n end\n self.url\n end", "def full_url\n if school_site.start_with? 'http://'\n school_site\n else\n \"http://#{school_site}\"\n end\n end", "def fullurl\n if Rails.env == 'development'\n 'http://localhost:3000' + object.url.to_s\n else\n 'http://signlab-rails.herokuapp.com' + object.url.to_s\n end\n end", "def generate_url(url, params = {})\n uri = URI(url)\n\n res = \"#{uri.scheme}://#{uri.host}\"\n res += \":#{uri.port}\" if (uri.port and uri.port != 80 and uri.port != 443)\n res += \"#{uri.path}#\" if uri.path\n res += \"#{uri.fragment}\" if uri.fragment\n res += \"?#{params.to_query}\"\n\n return res\n end", "def gen_url(url, text)\n if url =~ /([A-Za-z]+):(.*)/ then\n type = $1\n path = $2\n else\n type = \"http\"\n path = url\n url = \"http://#{url}\"\n end\n\n if type == \"link\" then\n url = if path[0, 1] == '#' then # is this meaningful?\n path\n else\n self.class.gen_relative_url @from_path, path\n end\n end\n\n if (type == \"http\" or type == \"link\") and\n url =~ /\\.(gif|png|jpg|jpeg|bmp)$/ then\n \"<img src=\\\"#{url}\\\" />\"\n else\n \"<a href=\\\"#{url}\\\">#{text.sub(%r{^#{type}:/*}, '')}</a>\"\n end\n end", "def to_s; @url; end", "def build_url(product, options = nil)\n \"#{BASE_URL}#{product}#{build_query_string(options)}\"\n end", "def build_as_url\n URI(build_as_string)\n rescue Urb::InvalidUrl => e\n URI('/')\n end", "def generated_url; end", "def twitter_url; \"https://twitter.com/#{twitter}\" end", "def url\n connection.build_url(url_chunk, params).to_s\n end", "def contact; end", "def generate_uri(url, options)\n uri = API_URL + url\n options.each do |key,value|\n uri += uri.include?(\"?\") ? \"&#{key}=#{value}\" : \"?#{key}=#{value}\"\n end\n URI.parse uri\n end", "def generate_url(url, params = {})\n uri = URI(url)\n\n res = \"#{uri.scheme}://#{uri.host}\"\n res += \":#{uri.port}\" if (uri.port and uri.port != 80 and uri.port != 443)\n res += \"#{uri.path}\" if uri.path\n res += \"#{uri.fragment}\" if uri.fragment\n res += \"?#{params.to_query}\"\n\n return res\n end", "def create_url\n\t\tif self.url.blank?\n\t\t\tself.dev_stage.blank? ? dev_stage_string = \"\" : dev_stage_string = \"-\" + self.dev_stage + \"-\"\n\t\t\tcomponent_string = self.component.downcase.gsub(/[^a-zA-Z0-9]+/, \"-\").chomp(\"-\")\n\t\t\tversion_string = self.maj_version.to_s + \"-\" + self.min_version.to_s\n\t\t\tself.url = component_string + dev_stage_string + version_string\n\t\tend\n\tend", "def to_uri\n build_uri\n end", "def contact \n\n end", "def formatted_website_url\n first_url = self.webaddr.is_a?(Array) ? self.webaddr.first : self.webaddr\n Addressable::URI.heuristic_parse(first_url).to_s\n end", "def generate_host\n uri = Addressable::URI.parse(self.url)\n self.site = uri.site\n self.domain_tld = [uri.domain,uri.tld].join('.')\n end", "def generate_url(url, params = {})\n uri = URI(url)\n if Settings.get_params_char == '#'\n uri.fragment = params.to_query\n else\n uri.query = params.to_query\n end\n uri.to_s\n end", "def url_to(*args, **options)\n\t\t\t\tpath = build_path_for_url(*args, **options)\n\t\t\t\tAddressable::URI.join(request.base_url, path).to_s\n\t\t\tend", "def build_url(url)\n return url unless http_auth\n\n protocol, uri = detect_protocol(url)\n username, password = [:username, :password].map { |part| CGI.escape http_auth[part] }\n \"#{protocol}#{username}:#{password}@#{uri}\"\n end", "def to_s\n u = uri\n u = u.gsub(/^mailto: */i, '')\n\n if cn.length > 0\n \"#{cn.inspect} <#{uri}>\"\n else\n uri\n end\n end", "def generate_url(url, params = {})\n uri = URI(url)\n uri.query = params.to_query\n uri.to_s\n end", "def create_link(url, campaign_token=nil)\n uri = URI.parse(url)\n uri.query = [uri.query, \"at=#{ItunesAffiliateLink.config.affiliate_token}\"].compact.join('&')\n unless campaign_token.nil?\n uri.query = [uri.query, \"ct=#{campaign_token}\"].compact.join('&')\n end\n return uri.to_s\n end", "def build_url(action)\n \"#{@base_url}#{action}\"\n end", "def make_url(string)\n puts \"not implemented\"\nend", "def build_url(options)\n protocol = options.include?(:certificate) ? 'drbssl' : 'druby'\n \"#{protocol}://#{options[:host]}:#{options[:port]}\"\n end", "def build_url(tnum, pageNum)\r\n\t\tserver = \"http://www.actuarialoutpost.com/\"\r\n \ttbase = \"actuarial_discussion_forum/showthread.php?t=\"\r\n \turl = server + tbase + tnum.to_s\r\n \turl = url + \"&pp=40&page=\" + pageNum.to_s\r\n \treturn url\r\n\tend", "def gen_url url, text\n scheme, url, id = parse_url url\n\n if %w[http https link].include?(scheme) and\n url =~ /\\.(gif|png|jpg|jpeg|bmp)$/ then\n \"<img src=\\\"#{url}\\\" />\"\n else\n if scheme != 'link' and %r%\\A((?!https?:)(?:[^/#]*/)*+)([^/#]+)\\.(rb|rdoc|md)(?=\\z|#)%i =~ url\n url = \"#$1#{$2.tr('.', '_')}_#$3.html#$'\"\n end\n\n text = text.sub %r%^#{scheme}:/*%i, ''\n text = text.sub %r%^[*\\^](\\d+)$%, '\\1'\n\n link = \"<a#{id} href=\\\"#{url}\\\">#{text}</a>\"\n\n link = \"<sup>#{link}</sup>\" if /\"foot/ =~ id\n\n link\n end\n end", "def gen_url(url, appended_val, test)\n\n\t\tif(!url.include? 'http')\n \t\turl = \"http://\" + url\n ht_flag = \"T\" #Added to check if there is an http added automatically to a vanity/pixel url\n\t\tend\n\n\t\t# Generate the URI Objects\n\t\turl_uri = URI.parse(URI.encode(url.to_s.strip))\n\t\tappend_uri = URI.parse(URI.encode(appended_val.to_s.strip.gsub(/^(&)/,'?')))\n\n\t\turl_query = url_uri.query\n\t\tappend_query = append_uri.query\n \n\n\t\t# Get the parameters from each\n\t\turl_parameters = CGI.parse(url_query) if(url_query)\n\t\tappend_parameters = CGI.parse(append_query) if(append_query)\n\n\t\t# merge the parameters\n\t\tparameters = {}\n\t\tparameters.merge!(url_parameters) if(url_parameters)\n\t\tparameters.merge!(append_parameters) if(append_parameters)\n\n\t\t# add test value if needed\n\t\tif(test)\n\t\t\tparameters.merge!({\"mmcore.gm\" => [\"2\"]})\n\t\tend\n\n\t\t# change hash to string format\n\t\tquery_string = hash_to_querystring(parameters)\n\n\n\t\t# clean out spare '/' marks\n\t\tpath_url = url_uri.path\n\t\tpath_append = append_uri.path\n \n\t\t# combine everything back into URI\n\t\tpath_url = '' if(path_url == '/')\n\t\tpath_append = '' if(path_append == '/')\n \n\t\t#url_uri.query = query_string \n \n\t\tcombine_path = path_url + path_append\n\t\tcombine_path = '/' if combine_path[0] != '/'\n\n url_uri.path = combine_path\n url_uri.query = nil\n final_url = url_uri.to_s\n\t\tfinal_url = [url_uri.to_s, query_string].join('?') if(!query_string.empty?)\n\t\t# return the URI as string\n # Adding to remove an extra http added to the vanity url, linked to 41, here from 88-93\n if (ht_flag != 'T')\n return final_url.to_s.gsub('%7C','|').gsub('%23','#').gsub('%25','%') \n else\n return final_url.to_s.gsub('%7C','|').gsub('%23','#').gsub('%25','%').gsub('http://','')\n end\n #return final_url.to_s.gsub('%7C','|').gsub('%23','#').gsub('%25','%')\n\tend", "def gardener_url\n (ENV['SUT_SCHEME'] || 'https') + \"://\" + gardener_fqhn()\n end", "def create_uri\n end", "def make_url(dav_uri, mailbox)\n \"#{dav_uri}/#{mailbox}/\"\n end", "def person_url(id)\n 'https://swapi.co/api/people/' + id.to_s\nend", "def dinero_mail_url(path, options = {})\n options[:https] = true if options[:https].nil?\n options[:country] ||= 'argentina'\n protocol = (options[:https] == true) ? 'https' : 'http'\n \"#{protocol}://#{options[:country]}.dineromail.com#{path}\"\nend", "def post_url\n address\n end", "def comment_url\n BLOG.email.to_url(name, File.join(BLOG.url, url))\n end", "def build_uri_for(provider, args={})\n args = args.inject('?'){ |res, hash| res += \"#{hash[0]}=#{hash[1]}&\" }\n case provider\n when 'CF'\n URI.parse(\"https://api.commissionfactory.com.au/V1/Affiliate/DataFeeds/#{args}apiKey=7fec5f11e26a493a8360175035c0014e\")\n end\n end", "def create_short_url\n rand_url = ('a'..'z').to_a.shuffle[0..5].join\n self.short_url = \"#{rand_url}\"\n end", "def build_url(action, query=nil)\n url = URI.parse($base_url).merge(action).to_s\n url = OpenID::Util.append_args(url, query) unless query.nil?\n return url\n end", "def format_url(url_params)\n url_base = \"https://agencyrecruiting.apihealthcare.com/UAM2/index.cfm\"\n args = format_arguments(url_params)\n url = \"#{url_base}?#{args}\"\n return url\n end", "def link\n \"<a href='http://www.mailgun.com/'>Mailgun</a>\"\n end", "def contactus\r\n end" ]
[ "0.67568463", "0.64634526", "0.64476496", "0.6391681", "0.63866526", "0.63783854", "0.62463033", "0.62447625", "0.6205008", "0.61767936", "0.61588985", "0.6157849", "0.6157501", "0.6153585", "0.61139053", "0.61139053", "0.6104737", "0.60916466", "0.60846806", "0.6042832", "0.60392827", "0.6034505", "0.60128623", "0.6007521", "0.59884125", "0.59881514", "0.5974572", "0.5973487", "0.5964559", "0.59526116", "0.5950742", "0.595073", "0.5934498", "0.5926269", "0.59257716", "0.592048", "0.592048", "0.5917893", "0.59160215", "0.5898336", "0.5898336", "0.5898336", "0.5898336", "0.5898336", "0.5898336", "0.5898336", "0.5898336", "0.5898336", "0.5898336", "0.5898336", "0.5898336", "0.5898336", "0.5898336", "0.5893107", "0.5889086", "0.5889086", "0.58877134", "0.5878599", "0.58671206", "0.5860186", "0.5856601", "0.58538496", "0.5852093", "0.585182", "0.5847138", "0.5841455", "0.58387893", "0.58346164", "0.5824223", "0.5820577", "0.58190167", "0.5812969", "0.5810542", "0.58089435", "0.58087754", "0.58055556", "0.5796209", "0.5796032", "0.57948005", "0.57880145", "0.57835454", "0.57795215", "0.57771206", "0.57750475", "0.5772698", "0.57584625", "0.57558817", "0.57517433", "0.5748985", "0.57476556", "0.5746828", "0.5743144", "0.57422185", "0.57413274", "0.5726888", "0.57257926", "0.57147956", "0.5713561", "0.57124627", "0.571008" ]
0.7144989
0
PATCH/PUT /makrana_marbles/1 PATCH/PUT /makrana_marbles/1.json
def update respond_to do |format| if @makrana_marble.update(makrana_marble_params) format.html { redirect_to @makrana_marble, notice: 'Marble product was successfully updated.' } format.json { head :no_content } else format.html { render action: 'edit' } format.json { render json: @makrana_marble.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @kishangarh_marble.update(kishangarh_marble_params)\n format.html { redirect_to @kishangarh_marble, notice: 'Kishangarh marble was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @kishangarh_marble.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @mueble.update(mueble_params)\n format.html { redirect_to @mueble, notice: 'Mueble was successfully updated.' }\n format.json { render :show, status: :ok, location: @mueble }\n else\n format.html { render :edit }\n format.json { render json: @mueble.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @mario.update(mario_params)\n format.html { redirect_to @mario, notice: 'Mario was successfully updated.' }\n format.json { render :show, status: :ok, location: @mario }\n else\n format.html { render :edit }\n format.json { render json: @mario.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @moose = Moose.find(params[:id])\n\n respond_to do |format|\n if @moose.update_attributes(params[:moose])\n format.html { redirect_to @moose, notice: 'Moose was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @moose.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @musing.update(musing_params)\n format.html { redirect_to @musing, notice: 'Musing was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @musing.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @monkey = Monkey.find(params[:id])\n\n respond_to do |format|\n if @monkey.update_attributes(params[:monkey])\n format.html { redirect_to @monkey, notice: 'Monkey was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @monkey.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @manga = Manga.find(params[:id])\n\n respond_to do |format|\n if @manga.update_attributes(params[:manga])\n format.html { redirect_to @manga, notice: 'Manga was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @manga.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @metodo = Metodo.find(params[:id])\n\n respond_to do |format|\n if @metodo.update_attributes(params[:metodo])\n format.html { redirect_to metodos_url }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @metodo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n animal = Animal.find(params[:id])\n\n if validate_params(animal_params)\n animal.update(animal_params)\n render json: animal, status: 200, location: [:api, animal]\n else\n render json: { errors: animal.errors }, status: 422\n end\n end", "def update\n respond_to do |format|\n if @mile.update(mile_params)\n format.html { redirect_to @mile, notice: 'Mile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @mile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @bowl = Bowl.find(params[:id])\n \n # set bowl modify time\n @bowl.modified = Time.now\n \n respond_to do |format|\n if @bowl.update_attributes(params[:bowl])\n \n Rails.logger.info \"Updating Bowl Contents\"\n \n # remove all contents for this bowl and add new\n @bowl.contents.delete_all(\"bowl_id=\" + @bowl.id)\n \n params.keys.each do |param|\n if param.start_with?(\"input_\") and (params[param] != \"\") \n @bowl.contents.create(:bowl_id => @bowl.id, :dryfruit_id => param[6, 2], :quantity => params[param]) \n end\n end\n\n format.html { redirect_to bowls_path, :notice => 'Bowl was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @bowl.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @my_ministry = MyMinistry.find(params[:id])\n\n respond_to do |format|\n if @my_ministry.update_attributes(params[:my_ministry])\n format.html { redirect_to @my_ministry, notice: 'My ministry was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @my_ministry.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @problema.update(problema_params)\n format.html { redirect_to @problema, notice: 'Problema was successfully updated.' }\n format.json { render :show, status: :ok, location: @problema }\n else\n format.html { render :edit }\n format.json { render json: @problema.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @manpack = Manpack.find(params[:id])\n\n respond_to do |format|\n if @manpack.update_attributes(params[:manpack])\n format.html { redirect_to @manpack, notice: 'Manpack was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @manpack.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @moresmalltrial = Moresmalltrial.find(params[:id])\n\n respond_to do |format|\n if @moresmalltrial.update_attributes(params[:moresmalltrial])\n format.html { redirect_to @moresmalltrial, notice: 'Moresmalltrial was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @moresmalltrial.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @momsg = Momsg.find(params[:id])\n\n respond_to do |format|\n if @momsg.update_attributes(params[:momsg])\n format.html { redirect_to @momsg, notice: 'Momsg was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @momsg.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @manga.update(manga_params)\n format.html { redirect_to @manga, notice: 'Manga was successfully updated.' }\n format.json { render :show, status: :ok, location: @manga }\n else\n format.html { render :edit }\n format.json { render json: @manga.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n dream = Dream.find params[:id]\n dream.update dream_params\n render json: {dream: dream}\n end", "def update\n @mate = Mate.find(params[:id])\n\n respond_to do |format|\n if @mate.update_attributes(params[:mate])\n format.html { redirect_to @mate, notice: 'Mate was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: {errors: @mate.errors}, status: :unprocessable_entity }\n end\n end\n end", "def update\n @banana = Banana.find(params[:id])\n\n respond_to do |format|\n if @banana.update_attributes(params[:banana])\n format.html { redirect_to @banana, :notice => 'Banana was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @banana.errors, :status => :unprocessable_entity }\n end\n end\n end", "def patch!\n request! :patch\n end", "def update\n @alumno = Alumno.find(params[:id])\n\n respond_to do |format|\n if @alumno.update_attributes(params[:alumno])\n head :no_content\n else\n render json: @alumno.errors, status: :unprocessable_entity\n end\n end\n end", "def update\n @jamaat = Jamaat.find(params[:id])\n\n respond_to do |format|\n if @jamaat.update_attributes(params[:jamaat])\n format.html { redirect_to @jamaat, notice: 'Jamaat was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @jamaat.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @municao.update(municao_params)\n format.html { redirect_to @municao, notice: 'A Munição foi editada com sucesso!' }\n format.json { render :show, status: :ok, location: @municao }\n else\n format.html { render :edit }\n format.json { render json: @municao.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @m1.update(m1_params)\n format.html { redirect_to @m1, notice: 'M1 was successfully updated.' }\n format.json { render :show, status: :ok, location: @m1 }\n else\n format.html { render :edit }\n format.json { render json: @m1.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @mensagem.update(mensagem_params)\n format.html { redirect_to @mensagem, notice: 'Mensagem was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @mensagem.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @metum = Metum.find(params[:id])\n\n respond_to do |format|\n if @metum.update_attributes(params[:metum])\n format.html { redirect_to @metum, notice: 'Metum was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @metum.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @meat.update(meat_params)\n format.html { redirect_to @meat, notice: 'Meat was successfully updated.' }\n format.json { render :show, status: :ok, location: @meat }\n else\n format.html { render :edit }\n format.json { render json: @meat.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @bla = Bla.find(params[:id])\n\n respond_to do |format|\n if @bla.update_attributes(params[:bla])\n format.html { redirect_to @bla, :notice => 'Bla was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @bla.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @metum.update(metum_params)\n format.html { redirect_to @metum, notice: 'Metum was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @metum.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @mapeamento = Mapeamento.find(params[:id])\n\n respond_to do |format|\n if @mapeamento.update_attributes(params[:mapeamento])\n format.html { redirect_to @mapeamento, notice: 'Mapeamento was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mapeamento.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @prueba_json.update(prueba_json_params)\n format.html { redirect_to @prueba_json, notice: 'Prueba json was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @prueba_json.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @animal.update(animal_params)\n respond_with(@shelter)\n end", "def update\n respond_to do |format|\n if @test_metum.update(test_metum_params)\n format.html { redirect_to @test_metum, notice: 'Test metum was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @test_metum.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @mar.update(mar_params)\n format.html { redirect_to @mar, notice: 'Mar was successfully updated.' }\n format.json { render :show, status: :ok, location: @mar }\n else\n format.html { render :edit }\n format.json { render json: @mar.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @minuman.update(minuman_params)\n format.html { redirect_to @minuman, notice: 'Minuman was successfully updated.' }\n format.json { render :show, status: :ok, location: @minuman }\n else\n format.html { render :edit }\n format.json { render json: @minuman.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @mood.update_attributes(mood_params)\n format.html { redirect_to moods_path, notice: 'Mood was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mood.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n animal = Animal.find(params[:id])\n animal.update(animal_params)\n if animal.valid?\n render json: animal\n else\n render json: animal.errors\n end\n end", "def update\n @monel = Monel.find(params[:id])\n\n respond_to do |format|\n if @monel.update_attributes(params[:monel])\n format.html { redirect_to @monel, notice: 'Monel was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @monel.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end", "def update\n respond_to do |format|\n if @mata_matum.update(mata_matum_params)\n format.html { redirect_to @mata_matum, notice: 'Mata matum was successfully updated.' }\n format.json { render :show, status: :ok, location: @mata_matum }\n else\n format.html { render :edit }\n format.json { render json: @mata_matum.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @prospecto_marca.update(prospecto_marca_params)\n format.html { redirect_to @prospecto_marca, notice: 'Prospecto marca was successfully updated.' }\n format.json { render :show, status: :ok, location: @prospecto_marca }\n else\n format.html { render :edit }\n format.json { render json: @prospecto_marca.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @mill = Mill.find(params[:id])\n\n respond_to do |format|\n if @mill.update_attributes(params[:mill])\n format.html { redirect_to @mill, notice: 'Mill was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mill.errors, status: :unprocessable_entity }\n end\n end\n end", "def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end", "def update\n respond_to do |format|\n if @moon.update(moon_params)\n format.html { redirect_to @moon, notice: 'Moon was successfully updated.' }\n format.json { render :show, status: :ok, location: @moon }\n else\n format.html { render :edit }\n format.json { render json: @moon.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @persona = Persona.find(params[:id])\n \n respond_to do |format|\n if @persona.update_attributes(params[:persona])\n format.json { head :ok }\n else\n format.json { render :json => @persona.errors,\n :status => :unprocessable_entity }\n end\n end\n end", "def update\n @todo = Todo.find(params[:id])\n if @todo.update_attributes(todo_params)\n render json: @todo, status: :ok\n else\n render json: @todo.errors, status: 422\n end\n end", "def update\n respond_to do |format|\n if @mae.update(mae_params)\n format.html { redirect_to @mae, notice: 'Mae was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @mae.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @mattch.update(mattch_params)\n format.html { redirect_to @mattch, notice: 'Mattch was successfully updated.' }\n format.json { render :show, status: :ok, location: @mattch }\n else\n format.html { render :edit }\n format.json { render json: @mattch.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @mariage.update(mariage_params)\n format.html { redirect_to @mariage, notice: 'Mariage was successfully updated.' }\n format.json { render :show, status: :ok, location: @mariage }\n else\n format.html { render :edit }\n format.json { render json: @mariage.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end", "def update\n @plate = Plate.find(params[:id])\n\n if @plate.update(params[:plate])\n head :no_content\n else\n render json: @plate.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @mamal.update(mamal_params)\n format.html { redirect_to @mamal, notice: 'Mamal was successfully updated.' }\n format.json { render :show, status: :ok, location: @mamal }\n else\n format.html { render :edit }\n format.json { render json: @mamal.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n authorize! :update, @user, :message => t('errors.messages.not_authorized_as_manager')\n @marina = Marina.find(params[:id])\n\n respond_to do |format|\n if @marina.update_attributes(params[:marina])\n format.html { redirect_to @marina, notice: 'Marina was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @marina.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @marca.update(marca_params)\n format.html { redirect_to @marca, notice: \"Marca was successfully updated.\" }\n format.json { render :show, status: :ok, location: @marca }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @marca.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @mood.update(mood_params)\n format.html { redirect_to @mood, notice: 'Mood was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @mood.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @micrrapost = Micrrapost.find(params[:id])\n\n respond_to do |format|\n if @micrrapost.update_attributes(params[:micrrapost])\n format.html { redirect_to @micrrapost, notice: 'Micrrapost was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @micrrapost.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @serving = Serving.find(params[:id])\n\n respond_to do |format|\n if @serving.update_attributes(params[:serving])\n format.html { redirect_to @serving, notice: 'Serving was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @serving.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @mrj = Mrj.find(params[:id])\n\n respond_to do |format|\n if @mrj.update_attributes(params[:mrj])\n format.html { redirect_to @mrj, notice: 'Mrj was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mrj.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @monit = Monit.find(params[:id])\n\n respond_to do |format|\n if @monit.update_attributes(params[:monit])\n format.html { redirect_to @monit, notice: 'Monit was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @monit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @monnaie = Monnaie.find(params[:id])\n\n respond_to do |format|\n if @monnaie.update_attributes(params[:monnaie])\n format.html { redirect_to @monnaie, notice: 'Monnaie was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @monnaie.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @aroma = Aroma.find(params[:id])\n\n respond_to do |format|\n if @aroma.update_attributes(params[:aroma])\n format.html { redirect_to @aroma, notice: 'Aroma was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @aroma.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @merk_lensa.update(merk_lensa_params)\n format.html { redirect_to @merk_lensa, notice: 'Merk lensa was successfully updated.' }\n format.json { render :show, status: :ok, location: @merk_lensa }\n else\n format.html { render :edit }\n format.json { render json: @merk_lensa.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @mugshot = Mugshot.find(params[:id])\n\n respond_to do |format|\n if @mugshot.update_attributes(params[:mugshot])\n format.html { redirect_to @mugshot, notice: 'Mugshot was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mugshot.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @marmita = Marmita.find(params[:id])\n\n respond_to do |format|\n if @marmita.update_attributes(params[:marmita])\n format.html { redirect_to(@marmita, :notice => 'Marmita was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @marmita.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @mood = Mood.find(params[:id])\n @user = User.find(params[:user_id])\n\n respond_to do |format|\n if @mood.update_attributes(params[:mood])\n format.json { head :ok }\n else\n format.json { render :xml => @mood.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @mutacao = Mutacao.find(params[:id])\n\n respond_to do |format|\n if @mutacao.update_attributes(params[:mutacao])\n format.html { redirect_to @mutacao, notice: 'Mutacao was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mutacao.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @metodologia.update(metodologia_params)\n format.html { redirect_to @metodologia, notice: 'Metodologia was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @metodologia.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @todo = Todo.find(params[:id])\n @todo.update_attributes(params[:todo])\n render :json => @todo\n end", "def update\n ingredient.update(ingredient_params)\n render json: ingredient\n end", "def update_attr\n #sanity checks \n @persona = current_persona\n @mediaset = @persona.mediasets.find(params[:id])\n \n respond_to do |format|\n @mediaset.update_attributes( params[:mediaset] )\n format.json{ respond_with_bip(@mediaset) }\n end\n end", "def update\n respond_to do |format|\n if @malarium.update(malarium_params)\n format.html { redirect_to @malarium, notice: 'Malarium was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @malarium.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @matthew.update(matthew_params)\n format.html { redirect_to @matthew, notice: 'Matthew was successfully updated.' }\n format.json { render :show, status: :ok, location: @matthew }\n else\n format.html { render :edit }\n format.json { render json: @matthew.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @responsavel = Responsavel.find(params[:id])\n\n if @responsavel.update(responsavel_params)\n head :no_content\n else\n render json: @responsavel.errors, status: :unprocessable_entity\n end\n end", "def update\n animal = Animal.find(params[:id])\n animal.update(animal_params)\n\n # if animal can be validated and updated then render the json\n if animal.valid?\n render json: animal\n else\n render json: animal.errors\n end\n end", "def update\n respond_to do |format|\n if @kota_stone.update(kota_stone_params)\n format.html { redirect_to kota_stones_url, notice: 'Kota stone was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @kota_stone.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @slam = Slam.find(params[:id])\n \n respond_to do |format|\n if @slam.update_attributes(params[:slam])\n format.html { redirect_to @slam, notice: 'Fixed up!' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @slam.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @mall = Mall.find(params[:id])\n\n respond_to do |format|\n if @mall.update_attributes(params[:mall])\n format.html { redirect_to @mall, notice: 'Mall was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mall.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @boat.update(boat_params)\n head :no_content\n else\n render json: @boat.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @maritalinfo.update(maritalinfo_params)\n format.html { redirect_to @maritalinfo, notice: 'Maritalinfo was successfully updated.' }\n format.json { render :show, status: :ok, location: @maritalinfo }\n else\n format.html { render :edit }\n format.json { render json: @maritalinfo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @mbracket.update(mbracket_params)\n format.html { redirect_to @mbracket, notice: 'Mbracket was successfully updated.' }\n format.json { render :show, status: :ok, location: @mbracket }\n else\n format.html { render :edit }\n format.json { render json: @mbracket.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @basico_marca.update(basico_marca_params)\n format.html { redirect_to @basico_marca, notice: 'Marca was successfully updated.' }\n format.json { render :show, status: :ok, location: @basico_marca }\n else\n format.html { render :edit }\n format.json { render json: @basico_marca.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @campeonato.update(campeonato_params)\n format.html { redirect_to @campeonato, notice: 'Campeonato was successfully updated.' }\n format.json { render :show, status: :ok, location: @campeonato }\n else\n format.html { render :edit }\n format.json { render json: @campeonato.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @moresmallarmorinfo = Moresmallarmorinfo.find(params[:id])\n\n respond_to do |format|\n if @moresmallarmorinfo.update_attributes(params[:moresmallarmorinfo])\n format.html { redirect_to @moresmallarmorinfo, notice: 'Moresmallarmorinfo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @moresmallarmorinfo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @scrobble = Scrobble.find(params[:id])\n\n respond_to do |format|\n if @scrobble.update_attributes(params[:scrobble])\n format.html { redirect_to @scrobble, notice: 'Scrobble was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @scrobble.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @ministerio = Ministerio.find(params[:id])\n\n respond_to do |format|\n if @ministerio.update_attributes(params[:ministerio])\n format.html { redirect_to @ministerio, notice: 'Ministerio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ministerio.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @kela.update(kela_params)\n format.html { redirect_to @kela, notice: 'Kela was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @kela.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @person.seat\n render json: {errors: 'Cannot update a seated person'}, status: 422\n else\n @person.update person_params\n render json: @person\n end\n end", "def update\n respond_to do |format|\n if @moodboard.update(moodboard_params)\n format.html { redirect_to @moodboard, notice: 'Moodboard was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @moodboard.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @gym_rat.update(gym_rat_params)\n format.html { redirect_to @gym_rat, notice: \"Gym rat was successfully updated.\" }\n format.json { render :show, status: :ok, location: @gym_rat }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @gym_rat.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @appman.update(appman_params)\n format.html { redirect_to @appman, notice: 'Appman was successfully updated.' }\n format.json { render :show, status: :ok, location: @appman }\n else\n format.html { render :edit }\n format.json { render json: @appman.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @mercado_metum = MercadoMetum.find(params[:id])\n\n respond_to do |format|\n if @mercado_metum.update_attributes(params[:mercado_metum])\n format.html { redirect_to @mercado_metum, notice: 'Mercado metum was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mercado_metum.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @mou.update(mou_params)\n format.html { redirect_to @mou, notice: 'Mou was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @mou.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\r\n respond_to do |format|\r\n if @muscle_mass.update(muscle_mass_params)\r\n format.html { redirect_to @muscle_mass, notice: 'Muscle mass was successfully updated.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: 'edit' }\r\n format.json { render json: @muscle_mass.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def update\n respond_to do |format|\n if @json.update(json_params)\n format.html { redirect_to @json, notice: 'Json was successfully updated.' }\n format.json { render :show, status: :ok, location: @json }\n else\n format.html { render :edit }\n format.json { render json: @json.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @json.update(json_params)\n format.html { redirect_to @json, notice: 'Json was successfully updated.' }\n format.json { render :show, status: :ok, location: @json }\n else\n format.html { render :edit }\n format.json { render json: @json.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @kumo.update(kumo_params)\n format.html { redirect_to kumos_path, notice: 'Kumo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @kumo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @remito = Remito.find(params[:id])\n\n respond_to do |format|\n if @remito.update_attributes(params[:remito])\n format.html { redirect_to @remito, notice: 'Remito was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @remito.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @patrimony.update(patrimony_params)\n format.html { redirect_to @patrimony, notice: 'Patrimony was successfully updated.' }\n format.json { render :show, status: :ok, location: @patrimony }\n else\n format.html { render :edit }\n format.json { render json: @patrimony.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @patrimony.update(patrimony_params)\n format.html { redirect_to @patrimony, notice: 'Patrimony was successfully updated.' }\n format.json { render :show, status: :ok, location: @patrimony }\n else\n format.html { render :edit }\n format.json { render json: @patrimony.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.68325347", "0.67135483", "0.6319726", "0.6281906", "0.6270078", "0.6261033", "0.6241598", "0.62310785", "0.61893684", "0.61508656", "0.61154914", "0.6107125", "0.6099364", "0.60980546", "0.6081795", "0.6070554", "0.6070099", "0.6065881", "0.60485613", "0.60464025", "0.60387176", "0.60386384", "0.6029464", "0.6008283", "0.6000807", "0.5999794", "0.59974325", "0.5996934", "0.5987148", "0.5985436", "0.5983573", "0.598315", "0.5983024", "0.5975291", "0.59742856", "0.5960787", "0.59566826", "0.59540796", "0.5952154", "0.59511656", "0.59504277", "0.59503305", "0.5949871", "0.5949254", "0.59436536", "0.594326", "0.59410006", "0.5935652", "0.5933207", "0.5930522", "0.592989", "0.5926711", "0.5924427", "0.5915349", "0.5914844", "0.5914347", "0.59105945", "0.5909886", "0.59078366", "0.5907232", "0.5900813", "0.5900785", "0.58988357", "0.58976704", "0.58975405", "0.5896377", "0.58950114", "0.58917344", "0.58914304", "0.5885134", "0.58813745", "0.58792365", "0.58762944", "0.5875809", "0.5875034", "0.5874781", "0.58730847", "0.58730066", "0.58719176", "0.5870002", "0.5869169", "0.5869021", "0.58670056", "0.58656764", "0.58653367", "0.58638525", "0.58615744", "0.5860902", "0.5855262", "0.5854941", "0.5854191", "0.5852002", "0.58519197", "0.5850949", "0.58507", "0.58507", "0.5849864", "0.58469045", "0.5842998", "0.5842998" ]
0.71258426
0
DELETE /makrana_marbles/1 DELETE /makrana_marbles/1.json
def destroy @makrana_marble.destroy respond_to do |format| format.html { redirect_to makrana_marbles_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @kishangarh_marble.destroy\n respond_to do |format|\n format.html { redirect_to kishangarh_marbles_url }\n format.json { head :no_content }\n end\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def delete_json(path)\n url = [base_url, path].join\n resp = HTTParty.delete(url, headers: standard_headers)\n parse_json(url, resp)\n end", "def destroy\n @mueble.destroy\n respond_to do |format|\n format.html { redirect_to muebles_url, notice: 'Mueble was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @kota_stone.destroy\n respond_to do |format|\n format.html { redirect_to kota_stones_url }\n format.json { head :no_content }\n end\n end", "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "def destroy\n @manga = Manga.find(params[:id])\n @manga.destroy\n\n respond_to do |format|\n format.html { redirect_to mangas_url }\n format.json { head :no_content }\n end\n end", "def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_response.body\n\n delete \"/traces/#{id}\"\n assert last_response.ok?\n\n get \"/traces/#{id}\"\n\n contents = JSON.parse last_response.body\n assert_kind_of(Hash, contents, 'Response contents is not a hash')\n assert contents.key? 'description'\n assert(!last_response.ok?)\n end", "def destroy\n @malarium.destroy\n respond_to do |format|\n format.html { redirect_to malaria_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @monkey = Monkey.find(params[:id])\n @monkey.destroy\n\n respond_to do |format|\n format.html { redirect_to monkeys_url }\n format.json { head :no_content }\n end\n end", "def delete\n render json: Alien.delete(params[\"id\"])\n end", "def destroy\n @moresmalltrial = Moresmalltrial.find(params[:id])\n @moresmalltrial.destroy\n\n respond_to do |format|\n format.html { redirect_to moresmalltrials_url }\n format.json { head :no_content }\n end\n end", "def delete\n client.delete(url)\n @deleted = true\nend", "def destroy\n @farmacium.destroy\n respond_to do |format|\n msg = { :status => \"ok\", :message => \"Eliminado!\" }\n format.json { render :json => msg }\n end\n end", "def delete\n render json: Item.delete(params[\"id\"])\n end", "def destroy\n @baton = Baton.find(params[:id])\n @baton.destroy\n\n respond_to do |format|\n format.html { redirect_to batons_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @jamaat = Jamaat.find(params[:id])\n @jamaat.destroy\n\n respond_to do |format|\n format.html { redirect_to jamaats_url }\n format.json { head :ok }\n end\n end", "def destroy\n return if new_record?\n \n @api.delete \"/items/#{shortcode_url}.json\"\n end", "def delete(path)\n RestClient.delete request_base+path\n end", "def destroy\n @json.destroy\n respond_to do |format|\n format.html { redirect_to jsons_url, notice: 'Json was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @json.destroy\n respond_to do |format|\n format.html { redirect_to jsons_url, notice: 'Json was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @prueba_json.destroy\n respond_to do |format|\n format.html { redirect_to prueba_jsons_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @adocao_animal = AdocaoAnimal.find(params[:id])\n @adocao_animal.destroy\n\n respond_to do |format|\n format.html { redirect_to adocao_animals_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @miscellaneou.destroy\n respond_to do |format|\n format.html { redirect_to miscellaneous_url, notice: 'Accessory was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @mae.destroy\n respond_to do |format|\n format.html { redirect_to maes_url }\n format.json { head :no_content }\n end\n end", "def delete\n url = prefix + \"delete\"\n return response(url)\n end", "def delete\n url = prefix + \"delete\"\n return response(url)\n end", "def destroy\n @mata_matum.destroy\n respond_to do |format|\n format.html { redirect_to mata_mata_url, notice: 'Mata matum was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @remito = Remito.find(params[:id])\n @remito.destroy\n\n respond_to do |format|\n format.html { redirect_to remitos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @mario.destroy\n respond_to do |format|\n format.html { redirect_to marios_url, notice: 'Mario was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @m1.destroy\n respond_to do |format|\n format.html { redirect_to m1s_url, notice: 'M1 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n animal = Animal.find(params[:id])\n animal.destroy\n head 204\n end", "def borrar \n\n fiesta.destroy\n render json: fiesta \n end", "def destroy\n @asignatura.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def delete path\n make_request(path, \"delete\", {})\n end", "def destroy\n @metodo = Metodo.find(params[:id])\n @metodo.destroy\n\n respond_to do |format|\n format.html { redirect_to metodos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @mercadorium.destroy\n respond_to do |format|\n format.html { redirect_to mercadoria_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @banana = Banana.find(params[:id])\n @banana.destroy\n\n respond_to do |format|\n format.html { redirect_to bananas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @mall.put_to_trash\n respond_to do |format|\n format.html { redirect_to director_malls_path, notice: 'Mall was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @mou.destroy\n respond_to do |format|\n format.html { redirect_to mous_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @mensagem = Mensagem.find(params[:id])\n api_client.delete_object(@mensagem.post_id)\n @mensagem.destroy\n\n respond_to do |format|\n format.xml { head :ok }\n format.js { head :ok }\n end\n end", "def destroy\n @mile.destroy\n respond_to do |format|\n format.html { redirect_to miles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @aquarium = Aquarium.find(params[:id])\n @aquarium.destroy\n\n respond_to do |format|\n format.html { redirect_to aquaria_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @status_animal = StatusAnimal.find(params[:id])\n @status_animal.destroy\n\n respond_to do |format|\n format.html { redirect_to status_animais_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @api_v1_item.destroy\n render json: {message: 'deletado com sucesso'}\n end", "def destroy\n @humanidades1 = Humanidades1.find(params[:id])\n @humanidades1.destroy\n\n respond_to do |format|\n format.html { redirect_to humanidades1s_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @moonwalk.destroy\n respond_to do |format|\n format.html { redirect_to moonwalks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @manga.destroy\n respond_to do |format|\n format.html { redirect_to mangas_url, notice: 'Manga was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @manga.destroy\n respond_to do |format|\n format.html { redirect_to mangas_url, notice: 'Manga was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete\n render json: Post.delete(params[\"id\"])\n end", "def destroy\n @musing.destroy\n respond_to do |format|\n format.html { redirect_to musings_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @drama.destroy\n respond_to do |format|\n format.html { redirect_to dramas_url, notice: 'Drama was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def destroy\n @mate = Mate.find(params[:id])\n @mate.destroy\n\n respond_to do |format|\n format.html { redirect_to mates_url }\n format.json { head :no_content }\n end\n end", "def delete\n res = HTTParty.get URL, headers: HEADERS\n message = JSON.parse res.body, symbolize_names: true\n if res.code == 200\n numSubs = message[:data].count\n if numSubs > 0\n message[:data].each do |sub|\n id = sub[:id]\n delRes = HTTParty.delete \"#{URL}/#{id}\", headers: HEADERS\n #TODO handle status codes\n end\n end\n end\n end", "def destroy\r\n @muscle_mass.destroy\r\n respond_to do |format|\r\n format.html { redirect_to muscle_masses_url }\r\n format.json { head :no_content }\r\n end\r\n end", "def destroy\n @animal.destroy\n\n respond_to do |format|\n format.html { redirect_to animals_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @ambit.destroy\n respond_to do |format|\n format.html { redirect_to ambits_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @mood.destroy\n\n respond_to do |format|\n format.html { redirect_to moods_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @database = Database.find(params[:id])\n path = @database.path\n delete = %x[rm -R #{path}]\n @database.destroy\n\n respond_to do |format|\n format.html { redirect_to databases_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @moodboard.destroy\n respond_to do |format|\n format.html { redirect_to moodboards_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @mood.destroy\n respond_to do |format|\n format.html { redirect_to moods_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @aucrecord.destroy\n respond_to do |format|\n format.html { redirect_to aucrecords_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @unidade_metrica = UnidadeMetrica.find(params[:id])\n @unidade_metrica.destroy\n\n respond_to do |format|\n format.html { redirect_to unidade_metricas_url }\n format.json { head :no_content }\n end\n end", "def delete(object)\n full_name = extract_full_name object\n post 'api/del', :id => full_name\n end", "def destroy\n @razmer_go = RazmerGo.find(params[:id])\n @razmer_go.destroy\n\n respond_to do |format|\n format.html { redirect_to razmer_gos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @persona = Persona.find(params[:id])\n @persona.destroy\n\n respond_to do |format|\n format.json { head :ok }\n end\n \n end", "def destroy\n @respuesta = Respuesta.find(params[:id])\n @respuesta.destroy\n\n respond_to do |format|\n format.html { redirect_to respuestas_url }\n format.json { head :no_content }\n end\n end", "def delete\n url = prefix + \"delete\" + id_param\n return response(url)\n end", "def destroy\n @animal.destroy\n respond_to do |format|\n format.html { redirect(person_animals_url, :delete, 'animal') }\n format.json { head :no_content }\n end\n end", "def delete\n request(:delete)\n end", "def destroy\n @monnaie = Monnaie.find(params[:id])\n @monnaie.destroy\n\n respond_to do |format|\n format.html { redirect_to monnaies_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @adotando_animal = AdotandoAnimal.find(params[:id])\n @adotando_animal.destroy\n\n respond_to do |format|\n format.html { redirect_to adotando_animais_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @animal = Animal.find(params[:id])\n @animal.destroy\n render json: { message: \"Congrats youve won\"}\n end", "def destroy\n @apertura_moneda.destroy\n respond_to do |format|\n format.html { redirect_to apertura_monedas_url, notice: 'Apertura moneda was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @musica.audios.purge\n @musica.destroy\n respond_to do |format|\n format.html { redirect_to musicas_url, notice: 'Álbum apagado com sucesso!' }\n format.json { head :no_content }\n end\n end", "def destroy\n @odeme_akademist = Odeme::Akademist.find(params[:id])\n @odeme_akademist.destroy\n\n respond_to do |format|\n format.html { redirect_to odeme_akademists_url }\n format.json { head :no_content }\n end\n end", "def destroy\n \n respond_to do |format|\n RestClient.delete 'localhost:3001/colores/'[email protected]_s, {:Authorization => 'admin irizREhyoG6Ejwr4AcjsQME9'}\n format.html { redirect_to colors_url, notice: \"Color was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @line_item1 = LineItem1.find(params[:id])\n @line_item1.destroy\n\n respond_to do |format|\n format.html { redirect_to line_item1s_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @doador_animal = DoadorAnimal.find(params[:id])\n @doador_animal.destroy\n\n respond_to do |format|\n format.html { redirect_to doador_animais_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @mattch.destroy\n respond_to do |format|\n format.html { redirect_to mattches_url, notice: 'Mattch was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @kumo.destroy\n respond_to do |format|\n format.html { redirect_to kumos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @humanidades3 = Humanidades3.find(params[:id])\n @humanidades3.destroy\n\n respond_to do |format|\n format.html { redirect_to humanidades3s_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @dish_mood.destroy\n respond_to do |format|\n format.html { redirect_to dish_moods_url }\n format.json { head :no_content }\n end\n end", "def cmd_delete argv\n setup argv\n uuid = @hash['uuid']\n response = @api.delete(uuid)\n msg response\n return response\n end", "def destroy\n @nominee.destroy\n respond_to do |format|\n format.html { redirect_to nominees_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @midia.destroy\n\n respond_to do |format|\n format.html { redirect_to midias_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @repuestum = Repuestum.find(params[:id])\n @repuestum.destroy\n\n respond_to do |format|\n format.html { redirect_to repuesta_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @mill = Mill.find(params[:id])\n @mill.destroy\n\n respond_to do |format|\n format.html { redirect_to mills_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @arma = Arma.find(params[:id])\n @arma.destroy\n\n respond_to do |format|\n format.html { redirect_to armas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @item.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @receita_medica = ReceitaMedica.find(params[:id])\n @receita_medica.destroy\n\n respond_to do |format|\n format.html { redirect_to receita_medicas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n client=Client.find_by_id(params[:id])\n if client != nil\n if client.destroy\n head 204\n end\n else\n head 404\n end\n end", "def destroy\n @remedio = Remedio.find(params[:id])\n @remedio.destroy\n\n respond_to do |format|\n format.html { redirect_to remedios_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @animal = Animal.find(params[:id])\n @animal.destroy\n\n respond_to do |format|\n format.html { redirect_to zoo_animals_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @agronomiaquimica = Agronomiaquimica.find(params[:id])\n @agronomiaquimica.destroy\n\n respond_to do |format|\n format.html { redirect_to agronomiaquimicas_url }\n format.json { head :no_content }\n end\n end", "def destroy\r\n @imobiliaria = Imobiliaria.find(params[:id])\r\n @imobiliaria.destroy\r\n\r\n respond_to do |format|\r\n format.json { head :no_content }\r\n end\r\n end", "def destroy\n resource.destroy\n render json: {success: true}, status: :ok\n end", "def destroy\n resource.destroy\n render json: {success: true}, status: :ok\n end", "def destroy\n @monit = Monit.find(params[:id])\n @monit.destroy\n\n respond_to do |format|\n format.html { redirect_to monits_url }\n format.json { head :no_content }\n end\n end" ]
[ "0.72362965", "0.7136852", "0.6954969", "0.6891273", "0.67966425", "0.6787778", "0.67567784", "0.67492473", "0.67388994", "0.67384666", "0.67368287", "0.66873384", "0.66721946", "0.6668189", "0.6651261", "0.66480166", "0.66339207", "0.6626199", "0.66252387", "0.66237104", "0.66237104", "0.6617099", "0.66136116", "0.6611465", "0.66090643", "0.6607446", "0.6607446", "0.6598129", "0.65912426", "0.65896934", "0.6589504", "0.65870976", "0.6585557", "0.6583389", "0.6574492", "0.6572025", "0.6564292", "0.65582", "0.65581346", "0.6555693", "0.6553817", "0.6553672", "0.65517867", "0.65508413", "0.65487593", "0.6548232", "0.65449", "0.6544519", "0.6544519", "0.6542891", "0.6542342", "0.65404207", "0.653495", "0.65348023", "0.653457", "0.6529759", "0.652893", "0.65267783", "0.65253747", "0.6524662", "0.6524643", "0.6520927", "0.6518975", "0.65156287", "0.65124476", "0.6511831", "0.65116626", "0.6510123", "0.65085226", "0.6507747", "0.6504855", "0.65011674", "0.64966947", "0.64959407", "0.6495021", "0.6494087", "0.6493739", "0.6493451", "0.64890397", "0.6488845", "0.6488801", "0.64878494", "0.64827377", "0.64796597", "0.6479454", "0.6479083", "0.64789486", "0.647733", "0.64744925", "0.64743483", "0.647341", "0.64707625", "0.64678895", "0.6466821", "0.6466507", "0.64657944", "0.6465519", "0.646549", "0.646549", "0.6464701" ]
0.74664295
0
Use callbacks to share common setup or constraints between actions.
def set_makrana_marble @makrana_marble = MakranaMarble.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "def add_actions; end", "def callbacks; end", "def callbacks; end", "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "def define_action_helpers; end", "def post_setup\n end", "def action_methods; end", "def action_methods; end", "def action_methods; end", "def before_setup; end", "def action_run\n end", "def execute(setup)\n @action.call(setup)\n end", "def define_action_helpers?; end", "def set_actions\n actions :all\n end", "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "def setup_handler\n end", "def before_actions(*logic)\n self.before_actions = logic\n end", "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "def action; end", "def action; end", "def action; end", "def action; end", "def action; end", "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "def workflow\n end", "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "def process_action(...)\n send_action(...)\n end", "def before_dispatch(env); end", "def setup\n # override and do something appropriate\n end", "def after_actions(*logic)\n self.after_actions = logic\n end", "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "def setup(_context)\n end", "def setup(resources) ; end", "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "def determine_valid_action\n\n end", "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "def startcompany(action)\n @done = true\n action.setup\n end", "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "def setup(&block)\n define_method(:setup, &block)\n end", "def setup\n transition_to(:setup)\n end", "def setup\n transition_to(:setup)\n end", "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "def action\n end", "def config(action, *args); end", "def setup\n @setup_proc.call(self) if @setup_proc\n end", "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "def before_action \n end", "def action\n end", "def setup\n # override this if needed\n end", "def matt_custom_action_begin(label); end", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "def after(action)\n invoke_callbacks *options_for(action).after\n end", "def pre_task\n end", "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "def setup_signals; end", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "def initialize(*args)\n super\n @action = :set\nend", "def after_set_callback; end", "def setup\n #implement in subclass;\n end", "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "def lookup_action; end", "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "def around_hooks; end", "def release_actions; end", "def setup(easy)\n super\n easy.customrequest = @verb\n end", "def save_action; end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "def action_target()\n \n end", "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "def before_setup\n # do nothing by default\n end", "def setup(&blk)\n @setup_block = blk\n end", "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "def default_action; end", "def callback_phase\n super\n end", "def advice\n end", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "def _handle_action_missing(*args); end", "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend", "def call\n setup_context\n super\n end", "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end" ]
[ "0.6163443", "0.604317", "0.5943409", "0.59143174", "0.5887026", "0.58335453", "0.57738566", "0.5701527", "0.5701527", "0.56534666", "0.5618685", "0.54237175", "0.5407991", "0.5407991", "0.5407991", "0.5394463", "0.5376582", "0.5355932", "0.53376216", "0.5337122", "0.5329516", "0.5311442", "0.52963835", "0.52955836", "0.5295297", "0.5258503", "0.52442217", "0.5235414", "0.5235414", "0.5235414", "0.5235414", "0.5235414", "0.5234908", "0.5230927", "0.52263695", "0.5222485", "0.5216462", "0.52128595", "0.52070963", "0.520529", "0.517586", "0.5174021", "0.5172379", "0.5165636", "0.5161574", "0.51556087", "0.5153217", "0.5152898", "0.5151238", "0.5144674", "0.51387095", "0.51342636", "0.5113545", "0.51131564", "0.51131564", "0.5107665", "0.5107052", "0.50908124", "0.5089785", "0.50814754", "0.50807786", "0.5064482", "0.5053022", "0.50526255", "0.5050246", "0.5050246", "0.50329554", "0.5023997", "0.5021236", "0.5014815", "0.5014393", "0.4999298", "0.49990913", "0.4997733", "0.49884573", "0.49884573", "0.49840933", "0.49786162", "0.49784446", "0.49782816", "0.49659815", "0.49655175", "0.4956222", "0.49543875", "0.49536037", "0.495265", "0.4951427", "0.49438462", "0.49436793", "0.49335384", "0.49321616", "0.49264926", "0.49247074", "0.49246994", "0.49226475", "0.49194494", "0.49152806", "0.49149707", "0.49149227", "0.49144953", "0.49141943" ]
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def makrana_marble_params params.require(:makrana_marble).permit(:name, :price,:makrana_marble_pics,:category,:zoom_image) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def param_whitelist\n [:role, :title]\n end", "def expected_permitted_parameter_names; end", "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def param_whitelist\n [:rating, :review]\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "def valid_params_request?; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def permitted_params\n []\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "def safe_params\n params.require(:user).permit(:name)\n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def check_params; true; end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def quote_params\n params.permit!\n end", "def valid_params?; end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "def filtered_parameters; end", "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "def filtering_params\n params.permit(:email, :name)\n end", "def check_params\n true\n end", "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "def active_code_params\n params[:active_code].permit\n end", "def filtering_params\n params.permit(:email)\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "def list_params\n params.permit(:name)\n end", "def filter_parameters; end", "def filter_parameters; end", "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def url_whitelist; end", "def admin_social_network_params\n params.require(:social_network).permit!\n end", "def filter_params\n params.require(:filters).permit(:letters)\n end", "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "def sensitive_params=(params)\n @sensitive_params = params\n end", "def permit_request_params\n params.permit(:address)\n end", "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end", "def secure_params\n params.require(:location).permit(:name)\n end", "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end", "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end", "def url_params\n params[:url].permit(:full)\n end", "def backend_user_params\n params.permit!\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end", "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end", "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end", "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end", "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end", "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end", "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end" ]
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076", "0.62894756", "0.6283177", "0.6242471", "0.62382483", "0.6217549", "0.6214457", "0.6209053", "0.6193042", "0.6177802", "0.6174604", "0.61714715", "0.6161512", "0.6151757", "0.6150663", "0.61461", "0.61213595", "0.611406", "0.6106206", "0.6105114", "0.6089039", "0.6081015", "0.6071004", "0.60620916", "0.6019971", "0.601788", "0.6011056", "0.6010898", "0.6005122", "0.6005122", "0.6001556", "0.6001049", "0.59943926", "0.5992201", "0.59909594", "0.5990628", "0.5980841", "0.59669393", "0.59589154", "0.5958826", "0.5957911", "0.5957385", "0.5953072", "0.59526145", "0.5943361", "0.59386164", "0.59375334", "0.59375334", "0.5933856", "0.59292704", "0.59254247", "0.5924164", "0.59167904", "0.59088355", "0.5907542", "0.59064597", "0.5906243", "0.5898226", "0.589687", "0.5896091", "0.5894501", "0.5894289", "0.5891739", "0.58860534", "0.5882406", "0.587974", "0.58738774", "0.5869024", "0.58679986", "0.5867561", "0.5865932", "0.5864461", "0.58639693", "0.58617616", "0.5861436", "0.5860451", "0.58602303", "0.5854586", "0.58537364", "0.5850427", "0.5850199" ]
0.0
-1
add custom methods below
def show file_name = CamaleonCms::Post.find(params[:id]).decorate.the_field('downloads_file') f_path = CamaleonCmsLocalUploader::private_file_path(file_name, current_site) if File.exist?(f_path) Download.create({ user_id: current_user.id, post_id: params[:id], metadata: { ip: request.ip, user_agent: request.user_agent, file_name: file_name } }) send_file f_path, disposition: 'inline' else raise ActionController::RoutingError, 'File not found' end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def methods() end", "def custom; end", "def custom; end", "def methods; end", "def methods; end", "def methods; end", "def methods; end", "def methods\n super + DELEGATED_METHODS\n end", "def method; end", "def method; end", "def method; end", "def method; end", "def method; end", "def method; end", "def method; end", "def method; end", "def method; end", "def method; end", "def method; end", "def method; end", "def method_added(*) end", "def overrides; end", "def extended(*) end", "def method\n\t\t# code code\n\tend", "def set_functions\n super\n end", "def add_actions; end", "def operations; end", "def operations; end", "def extra; end", "def process_custom_method\n # da implementare per eventuali estensioni\n end", "def delegating_method; end", "def method_added(name); end", "def method_added(name); end", "def implementation; end", "def implementation; end", "def _add_method\n :\"_add_#{singularize(self[:name])}\"\n end", "def methods=(_arg0); end", "def method_missing(method_name, *args)\n if method_name.to_s.start_with?('add_')\n extend method_name.slice(4..-1).camelize.constantize\n else\n super\n end\n end", "def special\n override\n end", "def internal_methods; end", "def functions\n\n end", "def add(new_custom_methods)\n raise ArgumentError if new_custom_methods.nil?\n @custom_methods.merge!(new_custom_methods)\n end", "def initialize(*)\n super\n if as != :button_to\n extend NfgUi::Components::Utilities::Methodable\n end\n end", "def add_method(name)\n self.push_literal name\n self.push_context\n self.send :__add_method__, 2\n end", "def helpers; end", "def helpers; end", "def helpers; end", "def super_method; end", "def method_added(name)\n\n# if new method is an alias method of some method then no need to alias it again\n if /hook/.match(name.to_s) or method_defined?(\"#{name}_without_hook\") or [\"before_method\",\"after_method\"].include?(name.to_s)\n return\n end \n\n call_bef = find_except(name,:before) #finds function which should be called before/after this fuction\n call_aft = find_except(name,:after)\n if call_bef.length == 0 && call_aft.length == 0 \n return\n end \n\n if call_bef.include?(name.to_s) or call_aft.include?(name.to_s) #To avoid infinite loop\n return\n end\n\n# define new method\n hook = %{\n def #{name}_hook\n call_bef = self.class.find_except(\\\"#{name}\\\",:before)\n call_bef.each{|elem| send elem}\n #{name}_without_hook()\n call_aft = self.class.find_except(\\\"#{name}\\\",:after)\n call_aft.each{|elem| send elem}\n end\n }\n\n self.class_eval(hook)\n a1 = \"alias #{name}_without_hook #{name}\"\n self.class_eval(a1)\n a2 = \"alias #{name} #{name}_hook\"\n self.class_eval(a2)\n\n end", "def method2() end", "def add_method\n :\"add_#{singularize(self[:name])}\"\n end", "def method\r\nend", "def method_missing(method, *args, &block)\n\t add_symbol = ('add_' + method.to_s).to_sym\n\t if @sketch.respond_to? add_symbol\n\t\[email protected](add_symbol, *args, &block)\n\t elsif @sketch.respond_to? method\n\t\[email protected] method, *args, &block\n\t elsif @self_before_instance_eval.respond_to? method\n\t\t@self_before_instance_eval.send method, *args, &block\n\t else\n\t\tsuper if defined?(super)\n\t end\n\tend", "def tag; raise 'Override this method'; end", "def add_methods(item)\n item.meths(inherited: false).each do |meth|\n next if @hide_private && meth.visibility == :private\n count_method\n\n # If the method is an alias, skip it so we don't define it as a\n # separate method.\n if meth.is_alias?\n next\n end\n\n # If the method is an attribute, it'll be handled by add_attributes\n if meth.is_attribute?\n next\n end\n\n # If the method has YARD's \"@overload\" tags, the information of the\n # first one is merged into meth object\n # NOTE: This code does not handle the second and subsequent @overload tags\n if meth.tag(\"overload\")\n meth.parameters = meth.tag(\"overload\").parameters\n meth.tag(\"overload\").tags.each { |tag| meth.add_tag(tag) }\n meth.docstring += meth.tag(\"overload\").docstring\n end\n \n # Sort parameters\n meth.parameters.reverse.sort! { |pair1, pair2| sort_params(pair1, pair2) }\n\n # This is better than iterating over YARD's \"@param\" tags directly\n # because it includes parameters without documentation\n # (The gsubs allow for better splat-argument compatibility)\n parameter_names_and_defaults_to_tags = meth.parameters.map do |name, default|\n [[name, fix_default_if_unary_minus(default)], method_tags(meth, 'param')\n .find { |p| p.name&.gsub('*', '')&.gsub(':', '') == name.gsub('*', '').gsub(':', '') }]\n end.to_h\n\n # Add block param if there is no named param but YARD tags are present\n if !parameter_names_and_defaults_to_tags.any? { |((name, _), _)| name.start_with? '&' } \\\n && (method_tags(meth, 'yieldparam').any? || method_tag(meth, 'yieldreturn'))\n parameter_names_and_defaults_to_tags[['&blk']] = nil\n end\n\n parameter_types = parameter_names_and_defaults_to_tags.map do |name_and_default, tag|\n name = name_and_default.first\n\n if tag\n TypeConverter.yard_to_parlour(tag.types, meth, @type_converter_config)\n elsif name.start_with? '&'\n # Find yieldparams and yieldreturn\n yieldparams = method_tags(meth, 'yieldparam')\n yieldreturn = method_tag(meth, 'yieldreturn')&.types\n yieldreturn = nil if yieldreturn&.length == 1 &&\n yieldreturn&.first&.downcase == 'void'\n\n # Create strings\n params = yieldparams.map.with_index do |param, i|\n Parlour::Types::Proc::Parameter.new(\n param.name&.gsub('*', '') || \"arg#{i}\",\n TypeConverter.yard_to_parlour(param.types, meth, @type_converter_config)\n )\n end\n returns = TypeConverter.yard_to_parlour(yieldreturn, meth, @type_converter_config)\n\n # Create proc types, if possible\n if yieldparams.empty? && yieldreturn.nil?\n Parlour::Types::Untyped.new\n else\n Parlour::Types::Proc.new(params, yieldreturn.nil? ? nil : returns)\n end\n elsif meth.path.end_with? '='\n # Look for the matching getter method\n getter_path = meth.path[0...-1]\n getter = item.meths.find { |m| m.path == getter_path }\n\n unless getter\n if parameter_names_and_defaults_to_tags.length == 1 \\\n && method_tags(meth, 'param').length == 1 \\\n && method_tag(meth, 'param').types\n\n Logging.infer(\"argument name in single @param inferred as #{parameter_names_and_defaults_to_tags.first.first.first.inspect}\", meth)\n next TypeConverter.yard_to_parlour(method_tag(meth, 'param').types, meth, @type_converter_config)\n else\n Logging.omit(\"no YARD type given for #{name.inspect}, using untyped\", meth)\n next Parlour::Types::Untyped.new\n end\n end\n\n return_types = method_tags(getter, 'return').flat_map(&:types)\n unless return_types.any?\n Logging.omit(\"no YARD type given for #{name.inspect}, using untyped\", meth)\n next Parlour::Types::Untyped.new\n end\n inferred_type = TypeConverter.yard_to_parlour(\n return_types, meth, @type_converter_config)\n\n Logging.infer(\"inferred type of parameter #{name.inspect} as #{inferred_type.describe} using getter's return type\", meth)\n inferred_type\n else\n # Is this the only argument, and was a @param specified without an\n # argument name? If so, infer it\n if parameter_names_and_defaults_to_tags.length == 1 \\\n && method_tags(meth, 'param').length == 1 \\\n && method_tag(meth, 'param').types\n\n Logging.infer(\"argument name in single @param inferred as #{parameter_names_and_defaults_to_tags.first.first.first.inspect}\", meth)\n TypeConverter.yard_to_parlour(method_tag(meth, 'param').types, meth, @type_converter_config)\n else\n Logging.omit(\"no YARD type given for #{name.inspect}, using untyped\", meth)\n Parlour::Types::Untyped.new\n end\n end\n end\n\n return_tags = method_tags(meth, 'return')\n returns = if meth.name == :initialize && !@use_original_initialize_return\n nil\n elsif return_tags.length == 0\n Logging.omit(\"no YARD return type given, using untyped\", meth)\n Parlour::Types::Untyped.new\n elsif return_tags.length == 1 && %w{void nil}.include?(return_tags&.first&.types&.first&.downcase)\n nil\n else\n TypeConverter.yard_to_parlour(method_tag(meth, 'return').types, meth, @type_converter_config)\n end\n\n rbs_block = nil\n parlour_params = parameter_names_and_defaults_to_tags\n .zip(parameter_types)\n .map do |((name, default), _), type|\n # If the default is \"nil\" but the type is not nilable, then it\n # should become nilable\n # (T.untyped can include nil, so don't alter that)\n type = Parlour::Types::Nilable.new(type) \\\n if default == 'nil' && !type.is_a?(Parlour::Types::Nilable) && !type.is_a?(Parlour::Types::Untyped)\n\n case @mode\n when :rbi\n Parlour::RbiGenerator::Parameter.new(\n name.to_s,\n type: type,\n default: default\n )\n when :rbs\n if name.start_with?('&')\n rbs_block = type\n nil\n else\n Parlour::RbsGenerator::Parameter.new(\n name.to_s,\n type: type,\n required: default.nil?\n )\n end\n end\n end\n .compact\n\n if @exclude_untyped && parlour_params.all? { |p| p.type.is_a?(Parlour::Types::Untyped) } && returns.is_a?(Parlour::Types::Untyped)\n Logging.omit(\"excluding untyped\", meth, immediate: true)\n next\n end\n\n case @mode\n when :rbi\n @current_object.create_method(\n meth.name.to_s,\n parameters: parlour_params,\n returns: returns,\n class_method: meth.scope == :class\n ) do |m|\n add_comments(meth, m)\n end\n when :rbs\n @current_object.create_method(\n meth.name.to_s,\n [Parlour::RbsGenerator::MethodSignature.new(\n parlour_params, returns, block: rbs_block && !rbs_block.is_a?(Parlour::Types::Untyped) \\\n ? Parlour::RbsGenerator::Block.new(rbs_block, false)\n : nil\n )],\n class_method: meth.scope == :class\n ) do |m|\n add_comments(meth, m)\n end\n end\n end\n end", "def helper_method(*methods); end", "def instance_methods(include_super=true) end", "def private; end", "def add_method(method)\n @display.print_method method\n end", "def modify\n super\n end", "def original_method; end", "def add_method\n :\"add_#{self[:name].to_s.singularize}\"\n end", "def method_one\n end", "def method_one\n end", "def method_missing(meth, *args)\n meth = meth.to_s\n meth.sub!(/^high_five:/, '')\n # if (!meth.match(/:/))\n # meth = \"high_five:#{meth}\"\n # end\n super meth, *args\n end", "def method_missing(method, *args, &block)\n custom_tmls = Origen.interface.send(:custom_tmls)\n if custom_tmls[method]\n tml = CustomTml.new(self, custom_tmls[method])\n instance_variable_set \"@#{method}\", tml\n define_singleton_method method do\n instance_variable_get(\"@#{method}\")\n end\n send(method)\n else\n super\n end\n end", "def content_methods; end", "def method_added(method_name) #:doc:\n super\n\n if ! Apipie.active_dsl? || ! Apipie.apipie_provided?\n Apipie.clear_last\n return\n end\n\n begin\n # remove method description if exists and create new one\n Apipie.remove_method_description(self, Apipie.last_dsl_data[:api_versions], method_name)\n description = Apipie.define_method_description(self, method_name, Apipie.last_dsl_data[:api_versions])\n ensure\n Apipie.clear_last\n end\n\n # redefine method only if validation is turned on\n if description && Apipie.configuration.validate == true\n\n old_method = instance_method(method_name)\n\n define_method(method_name) do |*args|\n\n if Apipie.configuration.validate == true\n description.params.each do |_, param|\n\n # check if required parameters are present\n if param.required && !params.has_key?(param.name)\n raise ParamMissing.new(param.name)\n end\n\n # params validations\n if params.has_key?(param.name)\n param.validate(params[:\"#{param.name}\"])\n end\n\n end\n end\n\n # run the original method code\n old_method.bind(self).call(*args)\n end\n\n end\n end", "def subcommands() __subcommands__ end", "def wrapper; end", "def acts_as_msfte\n extend ClassMethods\n end", "def method_name; end", "def method_name; end", "def method_name; end", "def method_name; end", "def method_name; end", "def method_name; end", "def method_name; end", "def method_name; end", "def method_name; end", "def method_name; end", "def method_name; end", "def method_name; end", "def method_added(name)\n super\n return unless public_method_defined?(name)\n\n unless @hidden || @all_hidden\n if documentation.respond_to?(:add_method)\n documentation.add_method(name.to_s)\n end\n end\n\n @hidden = false\n end", "def method_one; end", "def method_missing(meth, *args, &blk)\n if args.length > 0\n self.class.add_custom_attribute meth\n send meth, *args, &blk\n else\n super meth, *args, &blk\n end\n end", "def special_handler method, *args, &block\n # Sublevel markers, e.g. “ •” is level 2 line-item\n if level(method) > 0 && self.class::REGULAR_TAGS.keys.include?(m = (canonize method))\n self.class.class_eval \"alias_method :#{method}, :#{m}\"\n send method, args, block\n elsif self.class.instance_methods.include?(m = (normalize method))\n send(m, args) { yield if block_given? ; method.to_s }\n else\n [method, args].flatten\n end\n end", "def method_builder; end", "def methods(*args)\n super | rpc_methods\n end", "def add_options; end", "def method_missing(method_name, *args)\n (args && args.size > 0) ? super(method_name, *args) : before_method(method_name)\n end", "def set_functions\n super\n # Current Item Functions - Pass a (1-based) numerical position to refer to a specific item line.\n # (Defaults to 1.)\n function(:item_selector) {|which = 1| b.checkbox(:id => \"checkId_line#{which-1}_control\")}\n function(:item_barcode_link) {|which = 1| b.div(:id => \"Barcode_line#{which-1}\").a}\n function(:item_title) {|which = 1| b.span(:id => \"title_line#{which-1}_control\")}\n function(:item_author) {|which = 1| b.span(:id => \"author_line#{which-1}_control\")}\n function(:item_location) {|which = 1| b.span(:id => \"itemLocation_line#{which-1}_control\")}\n function(:item_call_number) {|which = 1| b.span(:id => \"itemCallNumber_line#{which-1}_control\")}\n function(:item_number_of_renewals) {|which = 1| b.span(:id => \"currentNoOfrenew_line#{which-1}_control\")}\n function(:item_due_date) {|which = 1| b.span(:id => \"loanDueDate_line#{which-1}_control\")}\n function(:item_claims_return_note) {|which = 1| b.span(:id => \"claimsReturnNote_line#{which-1}_control\")}\n function(:item_claims_return_date) {|which = 1| b.span(:id => \"claimsReturnDate_line#{which-1}_control\")}\n # Checked Out Items Functions - Pass a (1-based) numerical position to refer to a specific item line.\n # (Defaults to 1.)\n function(:co_item_selector) {|which = 1| b.checkbox(:id => \"checkIdRenewal_line#{which-1}_control\")}\n function(:co_item_barcode_link) {|which = 1| b.div(:id => \"BarcodeRenewal_line#{which-1}\").a}\n function(:co_item_title) {|which = 1| b.span(:id => \"titleRenewal_line#{which-1}_control\")}\n function(:co_item_author) {|which = 1| b.span(:id => \"authorRenewal_line#{which-1}_control\")}\n function(:co_item_location) {|which = 1| b.span(:id => \"itemLocationRenewal_line#{which-1}_control\")}\n function(:co_item_call_number) {|which = 1| b.span(:id => \"itemCallNumberRenewal_line#{which-1}_control\")}\n function(:co_item_number_of_renewals) {|which = 1| b.span(:id => \"previousNoOfrenew_line#{which-1}_control\")}\n function(:co_item_due_date) {|which = 1| b.span(:id => \"loanDueDateRenewal_line#{which-1}_control\")}\n function(:co_item_claims_return_note) {|which = 1| b.span(:id => \"claimsReturnNoteRenewal_line#{which-1}_control\")}\n function(:co_item_claims_return_date) {|which = 1| b.span(:id => \"claimsReturnDateRenewal_line#{which-1}_control\")}\n end", "def add_writer_tags(klass, new_method, member); end", "def operation; end", "def method_missing(name, *args)\n words = name.to_s.split(\"_\")\n return super(name, *args) unless words.shift == 'add'\n words.each do |word|\n next if word == 'and'\n add_cd if word == 'cd'\n add_dvd if word == 'dvd'\n add_hard_disk(100000) if word == 'harddisk'\n turbo if word == 'turbo'\n end \n end", "def method_missing(meth,*a,&block)\n (methods[meth] ||= []) << a\n methods[meth].flatten!\n end", "def extract_method_details; end", "def add_reader_tags(klass, new_method, member); end", "def public_instance_methods(include_super=true) end", "def add_method(method)\n object_class.record_location self\n return method unless @document_self\n object_class.add_method method\n end", "def method_731(base); end" ]
[ "0.7734749", "0.7614756", "0.7614756", "0.74777895", "0.74777895", "0.74777895", "0.74777895", "0.6926938", "0.6921097", "0.6921097", "0.6921097", "0.6921097", "0.6921097", "0.6921097", "0.6921097", "0.6921097", "0.6921097", "0.6921097", "0.6921097", "0.6921097", "0.68819135", "0.68427837", "0.67010254", "0.66665256", "0.6662312", "0.6575647", "0.65474296", "0.65474296", "0.65417266", "0.64559114", "0.645543", "0.6448378", "0.6448378", "0.64469635", "0.64469635", "0.6399567", "0.63870823", "0.63786834", "0.6322163", "0.619265", "0.61814517", "0.6180111", "0.6170653", "0.61679864", "0.61542076", "0.61542076", "0.61542076", "0.6141007", "0.61219025", "0.61137843", "0.608955", "0.6080903", "0.6071451", "0.60707325", "0.60547507", "0.6042284", "0.60395086", "0.60392153", "0.6038901", "0.6035186", "0.60342157", "0.6006087", "0.5967906", "0.5967906", "0.5965713", "0.5959179", "0.594468", "0.59316134", "0.59135085", "0.5907271", "0.5905851", "0.5903712", "0.5903712", "0.5903712", "0.5903712", "0.5903712", "0.5903712", "0.5903712", "0.5903712", "0.5903712", "0.5903712", "0.5903712", "0.5903712", "0.590024", "0.5900121", "0.58812004", "0.5873124", "0.58729607", "0.5866556", "0.5861674", "0.584944", "0.58472115", "0.58471286", "0.5847008", "0.5842994", "0.5834337", "0.58338857", "0.5824638", "0.58243334", "0.5819944", "0.5819938" ]
0.0
-1
We only allow the contingency planner to extract the cards that have been used only once. We only want to display the event cards as discarded if they have been discarded and not picked up by the contingency planer. To do that, we find all the cards that have not been discarded more than once (This scenario can happen when the contingency planer played an event card he previously picked up). We then remove the cards that the contingency planer has in his inventory (If the event card is both discarded and in the contingency planer's inventory, it must have been picked up in a previous action).
def call event_staticids.map do |staticid| SpecialCard.find(staticid) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def discard(card)\n discard_pile << card\n end", "def remove_card_row_cards\n card_row.each do |gc|\n gc.discard! if gc && gc.position < self.card_row_discard_size\n end\n end", "def available_cards(correct_card_ids)\n # Exclude cards that have already been successfully answered\n self.cards.reject do |card|\n puts \"correct_card_ids = #{correct_card_ids}\"\n correct_card_ids.include?(card.id)\n end\n end", "def remove_card\n cards.shift\n return cards\n end", "def cards_left_to_collect\n card_ids = UserCard.select {|card| card[\"user_id\"] == self.id}\n remaining = Card.all.count - card_ids.map { |card| card[\"card_id\"] }.uniq.count\n if remaining == 0\n puts \"=====================================================================\"\n puts \"Congratulations, you have completed the Superhero card album!!\"\n puts \"=====================================================================\"\n else\n puts \"=====================================================================\"\n puts \"You still have #{remaining} cards left to collect...\"\n puts \"=====================================================================\"\n end\n end", "def use_card\n waiting_to_confirm_placement = true\n waiting_to_use_card = true\n invalid_usage = nil\n invalid_confirmation = nil\n remind_cannot_discard = nil\n \n while waiting_to_confirm_placement\n while waiting_to_use_card\n DisplayManager.prepare_ingame_display\n show_state\n puts \"Newest Card: #{@selected_card.to_s} #{'* you cannot discard this card' if @drew_from_discard}\" unless @selected_card.nil?\n puts \"You cannot discard this card because you drew it from the discard pile.\" if remind_cannot_discard\n remind_cannot_discard = false\n \n @card_to_replace = nil\n @card_to_discard = nil\n\n puts InputManager.input_options({ negative: 'Discard this Card', rack_positions: 'Switch With Card at Position' }, invalid_usage)\n invalid_usage = nil\n\n @placement_response = InputManager.get\n\n # If player chooses a location in their rack\n # Get ready to exchange those cards\n if InputManager::INPUTS[:rack_positions].include?(@placement_response)\n prep_place_card_in_rack(@placement_response)\n waiting_to_use_card = false\n\n # If player chooses to discard their card\n # get ready to discard their card\n # Disallow discard if card was drawn from the discard pile\n elsif InputManager.negative?(@placement_response)\n if @drew_from_discard\n remind_cannot_discard = true\n else\n prep_discard_drawn_card\n waiting_to_use_card = false\n end\n else\n invalid_usage = @placement_response\n end\n end\n\n DisplayManager.prepare_ingame_display\n show_state\n puts \"Newest Card: #{@selected_card.to_s}\"\n\n if @card_to_replace\n puts \"You want to exchange #{@card_to_replace.to_s} with #{@selected_card.to_s}.\"\n else\n puts \"You do not want to use #{@selected_card.to_s}.\"\n end\n\n puts \"You are discarding #{@card_to_discard.to_s}.\"\n\n puts InputManager.input_options({ affirmative: 'Save and Complete Turn', negative: 'Do Something Different' }, invalid_confirmation)\n invalid_confirmation = nil\n confirm_response = InputManager.get\n\n # If player confirms their decision\n # persist their decision\n if InputManager.affirmative?(confirm_response)\n save_and_discard(@placement_response)\n waiting_to_confirm_placement = false\n \n # If player changes their mind\n # allow them to choose how to use their card again \n elsif InputManager.negative?(confirm_response)\n waiting_to_use_card = true\n else\n invalid_confirmation = confirm_response\n end\n end\n end", "def remaining_cards\r\n @deck_of_cards.each do |card|\r\n card.output_card\r\n end\r\n end", "def deal_cards\n MAX_CARDS.times do |d|\n @player_manager.players.each do |player| \n player.rack.add_card(@decks_manager.draw_pile.draw_card)\n end\n end\n\n # prep the discard pile with one card from the top of the draw pile\n @decks_manager.discard_top_card\n end", "def all_discards(done)\n discard_list = done.discards.map{|squad|\n squad.list_of_cards\n }.flatten\n \n fighter_list = done.attacks.map{|attack|\n attack.fighter.list_of_cards\n }.flatten\n\n bomber_list = done.attacks.map{|attack|\n attack.bomber.list_of_cards\n }.flatten\n \n played_cards = discard_list + fighter_list + bomber_list + [done.card]\n played_cards.sort\n end", "def check_discards_removed_from_hand?(player, turn, done)\n played_cards = all_discards(done)\n\n player_hand = player.player_hand.hand_to_list\n\n played_cards.each{|card|\n if player_hand.include?(card)\n raise Cheating, \"Player is not discarding the cards he/she is playing!\"\n end\n }\n true\n end", "def remove_cards\n\t\[email protected]!(0,2)\n\tend", "def reset_discard_pile(deck)\n @cards = []\n @cards << deck.take_card\n while @cards[0].color == 'Wild' || @cards[0].number.is_a?(String)\n deck.cards.unshift(@cards.pop)\n @cards << deck.take_card\n end\n @cards\n end", "def unplayed_cards\n player_cards.select { |c| c.unplayed? }\n end", "def filter_cards(cards)\n cards = Array(cards) unless cards.respond_to?(:count) \n return cards.select { |card| Card.get(card.id).nil? } #TODO: move this to method\n end", "def remove_card\n @cards.shift\n end", "def non_trump_cards\n @cards.select {|c| c.suit != @trump_suit}\n end", "def discard_card(player)\n if player.player_hand.size == 0\n return nil\n elsif player.player_hand.size == 1\n return player.player_hand.hand_to_list.first\n else\n rand_index = rand(player.player_hand.size)\n return player.player_hand.hand_to_list.fetch(rand_index)\n end\n end", "def remove_card(card)\n @all_cards.delete(card)\n end", "def remove_card\n @cards.shift\n\n end", "def discard_card(player)\n if player.player_hand.size == 0\n return nil\n elsif player.player_hand.size == 1\n return player.player_hand.hand_to_list.first\n elsif player.player_hand.wildcards.size > 0\n wildcards = player.player_hand.wildcards\n rand_index = rand(wildcards.size)\n return wildcards.fetch(rand_index)\n else\n rand_index = rand(player.player_hand.size)\n return player.player_hand.hand_to_list.fetch(rand_index)\n end\n end", "def remove remove_card\r\n @card_list.remove remove_card\r\n end", "def subtractSet(chosenCards)\n @cardsOnTable.each { |c|\n if c = chosenCards[0]\n @cardsOnTable.delete_at(0)\n elsif c = chosencards[1]\n @cardsOnTable.delete_at(1)\n elsif c = chosenCards[2]\n @cardsOnTable.delete_at(2)\n end\n }\n end", "def remove remove_card\n @card_list.remove remove_card\n end", "def duplicated_cards\n Cache.hash_get_all(\"#{@batch_id}_duplicated_cards\").presence || {}\n end", "def find_unseen\n unseen.replace(full_deck)\n (my_hand + op_hand + my_lands.values +\n op_lands.values + discards.values).flatten.each do |c|\n i = unseen.index(c) or next\n unseen.delete_at(i)\n end\n end", "def receiveInfo( playerIndex, card )\n if(playerIndex == -1 && card == nil)\n puts \"No one could answer. \"\n else\n # since the computer player doesn't make bad guess, \n # we delete the card just showed by other players from the lists of potential right cards.\n if( card.type == :person )\n i = 0\n while( i < @listOfAllSuspects.length )\n if(@listOfAllSuspects[i].value == card.value)\n @listOfAllSuspects.delete_at(i)\n else\n i = i + 1\n end\n end\n elsif( card.type == :place )\n i = 0\n while( i < @listOfAllLocations.length )\n if(@listOfAllLocations[i] == card)\n @listOfAllLocations.delete_at(i)\n else\n i = i + 1\n end\n end\n elsif( card.type == :weapon )\n i = 0\n while( i < @listOfAllWeapons.length )\n if(@listOfAllWeapons[i] == card)\n @listOfAllWeapons.delete_at(i)\n else\n i = i + 1\n end\n end\n end\n end #if\n end", "def reset_unused!\n @cards += @used\n @used = []\n end", "def remove_cards_forAI(cardToRemove1, cardToRemove2, cardToRemove3)\n\t\[email protected](cardToRemove1)\n\t\[email protected](cardToRemove2)\n\t\[email protected](cardToRemove3)\n\tend", "def discard\n\n # organize hand into sorted array of cards\n #### METHOD\n\n puts \"here is your hand #{hand}\"\n\n puts 'what cards? you can only discard 3.'\n\n #the player returns [2,3]\n ##### METHOD\n\n # find hand[2], hand[3] and remove from hand\n ##### METHOD\n\n # hand currently has 3 cards\n\n # hand << deck.deal(2)\n\n #RETURNS new hand\n\n\n #....player1.hand = the new hand\n end", "def trump_cards\n @cards.select {|c| c.suit == @trump_suit}\n end", "def deal_cards(deck, playing_cards)\n return if deck.length == 0\n\n #initializing deck.\n if playing_cards.length == 0\n for count in 0...12\n card = deck.delete_at(rand(deck.length))\n card.set_id($card_count)\n $card_count += 1\n playing_cards.push(card)\n end\n return\n end\n\n if (valid_table(playing_cards)).length == 0\n #continually adds cards until there is a set or there are no more cards.\n while ((valid_table(playing_cards)).length == 0) && deck.length > 0\n #print(\"\\n Empty: #{(valid_table(playingCards)).length == 0} \\n\")\n for count in 0...3\n card = deck.delete_at(rand(deck.length))\n card.set_id($card_count)\n $card_count += 1\n playing_cards.push(card)\n end\n end\n elsif playing_cards.length < 12\n # Adds cards if there is a set but less than 12 playing cards.\n for count in 0...3\n card = deck.delete_at(rand(deck.length))\n card.set_id($card_count)\n $card_count += 1\n playing_cards.push(card)\n end\n\n end\n\nend", "def remove remove_card\n @cards.each_with_index do |card, i|\n if card.to_string == remove_card.to_string\n @cards.delete_at(i)\n return true\n end\n end\n false\n end", "def hit(deck)\n rand_card = deck.sample # pulls a random card from the playing deck.\n deck.delete(rand_card)\nend", "def remove_cards(to_remove)\n to_remove.each { |num| @cards.delete_at(num - 1) }\n end", "def discard(card)\n hand.transfer!(card: card, to: discard_pile)\n end", "def removeCard(card)\n @cards.delete(card)\n end", "def check_discards_in_hand?(player, turn, done)\n expected_hand = expected_hand(player, turn)\n\n discard_list = done.discards.map{|squad|\n squad.list_of_cards\n }.flatten\n \n if !discard_list.all?{|card| expected_hand.include?(card)}\n raise Cheating, \"Player is discarding cards not in his/her hand!\"\n else\n true\n end\n end", "def remove_card\n @cards.delete_at(0)\n end", "def check_cards_for_warnings\n # Check for two or more cards with the same name\n duplicate_names = card_templates.select(:name).group(:name).count.select { |name, count| count > 1 }.map(&:first)\n add_warning_on_cards('duplicate_cards', duplicate_names.sort)\n end", "def remove_card_from_deck (card)\n\t\t@deck -= [card]\n\tend", "def return\n @cards += @discard\n @discard.clear\n @cards.shuffle\n end", "def pop_cards(num_pops)\r\n #p @deck_todisp.size\r\n num_pops.times{|ix| @deck_todisp.pop}\r\n if @briscola and @card_briscola_todisp and @deck_todisp.size == 0\r\n #if @card_briscola_todisp and @realgame_num_cards == 0\r\n # no more cards on deck, pick the briscola\r\n @card_briscola_todisp.visible = false\r\n end\r\n #p @deck_todisp.size\r\n end", "def deal_card\n @deck.remove(:front)\n end", "def discard_card(player)\n if player.player_hand.size == 0\n nil\n else\n rand_index = rand(5)\n rand_index += 1\n Keepem.new(Image.new(\"keepem.gif\"), rand_index)\n end\n end", "def draw_card(cards)\n card = cards.to_a.sample(1).flatten\n cards.delete(card[0])\n card\nend", "def deal_card\n if @cards.length > 0 then\n return @cards.slice!(0)\n else\n raise StandardError, \"No cards left in shoe; please use can_play\"\n end\n end", "def play_card(discard_pile, color, number)\n @cards.length.times do |i|\n unless @cards[i].color == color && @cards[i].number == number\n next\n end\n\n discard_pile.cards << @cards[i]\n @last_action = number\n if number == \"Pickup 2\"\n discard_pile.pickup_2_count += 2\n end\n if number == \"Pickup 4\"\n discard_pile.pickup_4_count += 4\n end\n @cards.delete_at(i)\n return true\n end\n puts \"unexpected error, didn't play card\" # given validation, this should not be seen\n self\n end", "def remove_card\n self.cards.delete_at(0)\n end", "def test_reshuffle_discard_into_draw\n # drain the draw pile into the discard pile\n while [email protected]_pile.is_empty?\n @manager.discard_top_card\n end\n assert_equal([], @manager.draw_pile.cards)\n assert_not_equal([], @manager.discard_pile.cards)\n\n @manager.reshuffle_discard_into_draw\n\n # draw pile should have cards and discard pile should be empty again\n assert_equal([], @manager.discard_pile.cards)\n assert_not_equal([], @manager.draw_pile.cards)\n end", "def affordable_cards\n answer = Array.new()\n (@game.all_displayed_cards + @player.tableau.reserved_cards).each do |card|\n @cost = @player.tableau.tokens_required(card)\n answer << card if !@cost==false\n end\n answer\n end", "def deal_a_card(from_the_deck)\n #delete any empty hashes from the deck array otherwise there will be an error because it will be picking a nil result\n if from_the_deck.include?({})\n from_the_deck.delete({})\n end\n \n deck_chosen_from = from_the_deck.sample\n key_chosen_from_deck = deck_chosen_from.keys.sample\n value_chosen_from_deck = deck_chosen_from[key_chosen_from_deck].sample\n \n remove_from_deck(deck_chosen_from, key_chosen_from_deck, value_chosen_from_deck)\n\n #delete any hash key with an empty array value otherwise there will be an error because it will be picking a nil result\n if deck_chosen_from[key_chosen_from_deck].empty?\n deck_chosen_from.delete(key_chosen_from_deck)\n end\n\n picked_card = [key_chosen_from_deck, value_chosen_from_deck]\nend", "def take_card\n raise OutOfCardsError if empty?\n @cards.pop\n end", "def flush_cards(cards)\n\t\thsh = {}\n\t\tcards.each {|c| hsh[c.suit] ||= []; hsh[c.suit] << c}\n\t\tret = []\n\t\thsh.each {|suit, suit_cards| ret = suit_cards if suit_cards.size > ret.size}\n\t\tret.sort_by {|x| x.sort_value}\n\tend", "def select_card(dck)\n # sample the deck array, returns a suit return the value obj and sample\n dck.sample.each_with_object({}) do |suit, obj|\n crd = suit[1].to_a.sample\n suit = suit[0]\n obj[suit] = { crd[0] => crd[1] }\n # remove card from deck\n dck = dck.each do |val|\n val.each do |k, v|\n if k == suit\n # mutate the deck\n v.reject! { |key, _| key == crd[0] }\n end\n end\n end\n end\nend", "def card_elleven_or_one(cards, card_spot)\n new_players_cards = cards.collect{|x| x}\n old_cards = new_players_cards[card_spot]\n old_cards = old_cards.delete_at(0)\n new_cards = []\n new_cards.push(old_cards)\n new_cards.push(1)\n end", "def discard_effect\n @game.discard_pile_cards << \"lock_down\"\n end", "def hit \n card = self.cards_deck.pop\n return card\n end", "def discard\n player.hand.first\n end", "def collect_cards\n card = detect_in(@areas, :card) { |card| card.hit?(@mouse_pos) }\n return card unless card\n\n n = @pile.size - @pile.cards.index(card)\n tail_cards = @pile.cards.last(n)\n Hash[*tail_cards.map { |card| [card, card.pos] }.flatten]\n end", "def drawCards!(n)\n\t\treturn @cards.pop(n)\n end", "def process_events(events)\n @card_events = events.select(&:card?) \n events \n end", "def deal_card\r\n\t\tcards.pop\r\n\tend", "def show_top_card\n self.discard(draw)\n end", "def flush\n my_hand.group_by(&:suit).select { |_, hand_of_suit| hand_of_suit.count == 5 }.values.flatten\n end", "def deal_cards\n Print.heading('Dealing initial cards')\n deal_card_to_players\n dealer_card_to_dealer(false) #false to hide first dealer card\n deal_card_to_players\n dealer_card_to_dealer(true)\n end", "def deal_card\n @deck.pop\n end", "def card_value_one(cards)\n card_spot = cards.index{ |x, y| y == 11 }\n card_elleven_or_one_save = card_elleven_or_one(ards, card_spot)\n cards.delete_at(card_spot)\n cards = cards.push(card_elleven_or_one_save)\n end", "def deal()\n card = self.cards.shift()\n raise \"Cannot deal more than 52 cards.\" unless card\n return card\n end", "def full_dance_card\n\t\tif @card.length > 5\n\t\t\tputs \"Your dance card is full! You have to dance with #{@card[0]} before you can add #{@card[-1]}\"\n\t\t\[email protected]_at(-1)\n\t\tend\n\t\t@card\n\tend", "def out_of_cards\n display(\"---Dealer ran out of cards this round!---\\n\\n\")\n end", "def random_remaining_card\n correct_guesses_array = self.guesses.where(correctness: true)\n correct_guess_id_array = correct_guesses_array.map do |guess|\n guess.card_id\n end\n if correct_guess_id_array == []\n cards = self.deck.cards\n else\n cards = self.deck.cards.where('id not in (?)', correct_guess_id_array)\n end\n cards.sample\n end", "def play_like_a_dummy\r\n # very brutal algorithm , always play the first card\r\n card = @cards_on_hand.pop\r\n return card\r\n end", "def deal_cards(old_deck, num_cards)\n hand = old_deck.sample(num_cards)\n new_deck = old_deck - hand\n return [hand, new_deck]\nend", "def make_discards(player, list_of_allies, list_of_axis)\n complete_squads = player.player_hand.completes\n complement_squads = player.player_hand.complementable\n wildcards = player.player_hand.wildcards\n\n # We need to make sure that we don't make attacks with squadrons that have already been used\n complete_squads = player.remove_used_squads(complete_squads, list_of_allies, list_of_axis)\n complement_squads = player.remove_used_squads(complement_squads, list_of_allies, list_of_axis)\n\n # Look through complement squadrons and go ahead and add\n # WildCards to them. If we don't have enough WildCards, well then\n # just make some up.\n complement_squads.each{|squadron|\n if wildcards.size > 0\n if wildcards.size >= 2 && squadron.list_of_cards.size == 1\n squadron.push!(wildcards.shift)\n squadron.push!(wildcards.shift)\n elsif wildcards.size > 1 && squadron.list_of_cards.size == 2\n squadron.push!(wildcards.shift)\n else\n squadron.push!(Keepem.new(Image.new(\"keepem.gif\"), rand(5)+1))\n end\n end\n }\n \n # Combine the two lists of Squadrons\n all_squads = complete_squads.dup.concat(complement_squads)\n\n # Now we go through and make sure all the Squadrons\n # are complete.\n all_squads.find_all {|squadron| squadron.squadron_complete? }\n end", "def setCard( newCard )\n @cardsInHand.push(newCard)\n \n # since the computer player doesn't make bad guess, \n # we delete the card just received from the lists of potential right cards.\n i = 0\n while( i < @listOfAllSuspects.length )\n if( @listOfAllSuspects[i].value == newCard.value && @listOfAllSuspects[i].type == newCard.type )\n @listOfAllSuspects.delete_at(i)\n else\n i = i + 1\n end\n end\n \n i = 0\n while( i < @listOfAllLocations.length )\n if( @listOfAllLocations[i].type == newCard.type && @listOfAllLocations[i].value == newCard.value )\n @listOfAllLocations.delete_at(i)\n else\n i = i + 1\n end\n end\n \n i = 0\n while( i < @listOfAllWeapons.length )\n if( @listOfAllWeapons[i].type == newCard.type && @listOfAllWeapons[i].value == newCard.value )\n @listOfAllWeapons.delete_at(i)\n else\n i = i + 1\n end\n end\n end", "def deal\r\n @deck_of_cards.shift\r\n end", "def all_play_a_card\n @players.each do |p|\n @hand_played << p.try(:cards).try(:first) if p.has_cards?\n @cards_on_table << p.try(:cards).try(:shift) if p.has_cards?\n end\n end", "def make_discards(player, list_of_allies, list_of_axis)\n complete_squads = player.player_hand.completes\n\n # We need to make sure that we don't make attacks with squadrons that have already been used\n complete_squads = player.remove_used_squads(complete_squads, list_of_allies, list_of_axis)\n end", "def remove_set_from_hand(card)\n\t\[email protected](card)\n\tend", "def card_from_user(hand, cards_played)\n next_card_prompt(hand)\n\n puts \"What card would you like to play?\"\n card = get_card_following_suit(hand, cards_played)\n\n puts \"You picked #{card}\"\n hand.delete(card)\n\n card\n end", "def deal_card(game_deck,player)\n card = game_deck.deck.pop\n ace_checker(card,player)\n player.hand.push(card)\n puts\"#{player.player_name} received #{card.identify}\"\n puts \"Current hand: #{player.display_hand}\"\n win_or_bust(player)\n hit_or_stay(player)\nend", "def the_draw_card(deck_value, deck_card_name, cards, cards_value, random)\n cards = cards[random]\n deck_card_name.delete_at(random.to_i)\n return cards\n end", "def deal_card\n @cards.pop\n end", "def test_discard_top_card\n top_card = @manager.draw_pile.cards[0]\n assert_not_equal(top_card, @manager.discard_pile.cards[0])\n @manager.discard_top_card\n assert_equal(top_card, @manager.discard_pile.cards[0])\n end", "def pull(card)\n card = self.cards.delete(card)\n raise \"Cannot find card. May already have been dealt\" unless card\n return card\n end", "def pile_cards\n players = [@player1, @player2]\n if type == :basic\n players.each do |player|\n @spoils_of_war << player.deck.cards[0]\n player.deck.remove_card\n end\n elsif type == :war\n players.each do |player|\n @spoils_of_war << player.deck.cards[0..2]\n 3.times do\n player.deck.remove_card\n end\n @spoils_of_war = @spoils_of_war.flatten\n end\n elsif type == :mutually_assured_destruction\n players.each do |player|\n 3.times do\n player.deck.remove_card\n end\n end\n # replace 'No Winner' with nil so it can be tested in award_spoils\n @turn_winner = nil\n end\n end", "def npc_card_dispose(npc_cards, init_cards)\n temp_npc = []\n\n npc_cards.each do |card|\n init_cards.each_with_index do |row, index|\n # Calculate difference between each npc_card to each init_card\n temp_npc.push(init_card: row.values[0].last[:num], npc_card: card[:num], diff: card[:num] - row.values[0].last[:num])\n end\n end\n\n negative_arr = []\n arr_1_20 = []\n arr_over_20 = []\n npc_will_choose_card = []\n\n # Iterate through array and categorize the cards\n temp_npc.each do |card|\n if card[:diff] < 0\n negative_arr << card\n elsif card[:diff] > 0 && card[:diff] <= 20\n arr_1_20 << card\n else\n arr_over_20 << card\n end\n end\n\n add_random_card(npc_will_choose_card, negative_arr)\n add_random_card(npc_will_choose_card, arr_1_20)\n add_random_card(npc_will_choose_card, arr_over_20)\n\n return get_num(npc_will_choose_card)\n end", "def check_only_play_once?(player, turn, done)\n played_cards = all_discards(done)\n\n valid_discards = played_cards.uniq\n\n if played_cards != valid_discards\n raise Cheating, \"Player is using cards more than once!\"\n else\n true\n end\n end", "def flush(hand)\n suits = hand.map { |card| card[1] }\n return suits.uniq.one?\nend", "def determine_playable_cards\n playable_cards = []\n hand.each do |card_in_hand|\n if card_in_hand[\"cost\"] <= @mana_available\n playable_cards.push(card_in_hand)\n end \n end\n if mana_available >= 2\n playable_cards.push(\"hero ablity\")\n end\n playable_cards\n end", "def convert_deck(arr_of_cards)\n arr_of_cards.each do |card|\n # Remove the \"Your Cards:\" from the first element\n if arr_of_cards.index(card) == 0\n card.slice!(0, 12)\n end\n end\n end", "def deal_one\n cards.pop\n end", "def deal_card\n random = rand(@playable_cards.size)\n @playable_cards.delete_at(random)\n end", "def flush?\n cards_by_suit.any? {|_, v| v.count >= cards_needed}\n end", "def card_in_game\n (2..14).each {|r| (1..4).each { |i| @pack_of_card << [i, r] }}\n @cards = @pack_of_card.shuffle.take(7)\n # @hash_7_card is hash prepared for analyze combinations and the highest combination to win\n $hash_7_card = array_suit_rank\n end", "def play_like_a_dummy\r\n # very brutal algorithm , always play the first card\r\n #card = @cards_on_hand.pop\r\n #p @cards_on_hand.size\r\n card = @cards_on_hand[0]\r\n if card\r\n # check if the played card take something\r\n #@table_cards\r\n \r\n #@log.debug \"Alg: cards on table #{@table_cards}\"\r\n list = @core_game.which_cards_pick(card, @table_cards)\r\n #p \"which cards pick: card #{card}, table #{@table_cards.join(\",\")}, list #{list.size}\"\r\n result = [card, list[0]].flatten\r\n return result\r\n end\r\n raise \"Error cards on hand #{@cards_on_hand.join(',')}\" \r\n end", "def dealCards\n @players.times do |p|\n c=p + 1\n tmp = []\n puts \"#{$dm} Dealing #{c} of #{cardsDealt} Cards for player #{c} of #{players}\" if $debug\n while c <= cardsNeeded do\n puts \"#{$dm} INSIDE While #{c} up to #{cardsNeeded}\" if $debug\n #d=c-1 # This is ugly... :( Needed to start at array 0 beginning\n tmp.push(@deckOfCards[@deckA[c-1]])\n c += @players\n end\n @playersCards[(p+1)] = tmp\n end\n end", "def show\n cards = @deck.cards\n cards = cards.where(is_disabled: false)\n @cards = cards.shuffle\n end", "def add_card_without_revealing_details(card)\n player.add_card_to_hand(card)\n message = \"#{player.name} drew a card from the center.\"\n game.players.each {|player| player.send_message_to_user(message)}\n end", "def deal\n # pack cards past the default 12 into the begining\n if @cards.length > 12\n # cards still in play past the standard 12 positions\n extra = @cards.last(@cards.length - 12).compact\n # move what can be moved into the standard 12 positions\n @cards = @cards.take(12).map! { |c| c || extra.pop }\n # hopefully extra is empty now, but maybe not\n @cards += extra\n end\n\n # sets is still valid as we haven't modified the combinaion of cards in play\n # do we need to expand the cards in play?\n if(@sets && @sets.none?)\n @cards += Array.new(3)\n end\n \n ## fill any gaps from the deck\n @cards.map! { |x| x || @deck.pop }\n\n # recompute sets\n #@sets = []\n @sets = IsASet.sets @cards.compact\n end", "def all_not_wild\n result = []\n for card in @cards\n result << card unless card.wild? \n end\n return result\n end" ]
[ "0.70546097", "0.68158215", "0.66413677", "0.65970707", "0.6490939", "0.64872676", "0.6465819", "0.64166903", "0.6410046", "0.63794386", "0.6371314", "0.63552016", "0.6347802", "0.6307221", "0.6299493", "0.62940675", "0.623763", "0.6223697", "0.6221691", "0.62139463", "0.6206974", "0.6206567", "0.6198141", "0.6129259", "0.6109815", "0.6109031", "0.60916066", "0.60719067", "0.60664576", "0.6058866", "0.60445535", "0.60271466", "0.60180676", "0.60175896", "0.60063124", "0.5986782", "0.5957492", "0.59512544", "0.5946882", "0.59132904", "0.5909486", "0.5903749", "0.589676", "0.5883646", "0.58771056", "0.58603895", "0.58599806", "0.5842621", "0.5841989", "0.5821933", "0.5819197", "0.5817957", "0.5804909", "0.5786051", "0.5778719", "0.57765293", "0.5768201", "0.57524043", "0.5730324", "0.5729444", "0.5726243", "0.57210505", "0.57160896", "0.5711287", "0.57101333", "0.57064664", "0.5700737", "0.5697784", "0.56808376", "0.5679803", "0.5674441", "0.56685084", "0.5667827", "0.5662072", "0.56594455", "0.5654394", "0.5648826", "0.56449", "0.56442255", "0.5642224", "0.56415886", "0.56353664", "0.5633843", "0.5633612", "0.5633367", "0.5630559", "0.5628747", "0.56255025", "0.56221694", "0.5615648", "0.5613945", "0.56061494", "0.56054944", "0.5597568", "0.5596652", "0.5595109", "0.559398", "0.55900455", "0.5587481", "0.557398", "0.5573742" ]
0.0
-1
rubocop:disable LineLength rubocop:disable AbcSize
def write_index html = HtmlHelpers.build do |b| content = b.jumbotron(b.title(@config[:index_title], 'title')) content += b.title(RESOURCES_TEXT) content += b.unordered_list(resources.keys) content += b.link("#{ERROR_CODE_URL}.html", b.subtitle(ERROR_CODE_TEXT)) unless error_codes.empty? container = b.container(b.row(content)) b.html_header(header_title, container, @config[:inline_css]) end write_to_file("#{output_dir}/index.html", html) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def private; end", "def big_bad; end", "def private_method\n end", "def implementation; end", "def implementation; end", "def probers; end", "def my_size\n 1\n end", "def size=(_); end", "def size=(_); end", "def schubert; end", "def size; end", "def size; end", "def size; end", "def size; end", "def size; end", "def size; end", "def size; end", "def size; end", "def size; end", "def size; end", "def size; end", "def size; end", "def size; end", "def size; end", "def size; end", "def size; end", "def size; end", "def size; end", "def size; end", "def size; end", "def size; end", "def size\n super\n end", "def size\n super\n end", "def extra; end", "def code_of_conduct; end", "def used?; end", "def custom; end", "def custom; end", "def suivre; end", "def default_tire_size\n raise NotImplementedError, \n \"This #{self.class.to_s} can not respond_to :: #{__method__.to_s}\"\n end", "def default_tire_size\n raise NotImplementedError, \n \"This #{self.class.to_s} can not respond_to :: #{__method__.to_s}\"\n end", "def specie; end", "def specie; end", "def specie; end", "def specie; end", "def kex_byte_requirement; end", "def size(*) end", "def size(*) end", "def arg_size; end", "def get_size\n\t\tend", "def internal; end", "def intensifier; end", "def size()\n #This is a stub, used for indexing\n end", "def celebration; end", "def length_override; end", "def refutal()\n end", "def initialize \n\t\tsuper(SIZE)\n\tend", "def public; end", "def public; end", "def size\n end", "def size\n end", "def size\n end", "def size\n end", "def size\n end", "def size\n end", "def size\n end", "def offences_by; end", "def length\n super\n end", "def requirements; end", "def requirements; end", "def requirements; end", "def requirements; end", "def size\n\t\t#puts \"size of #{name}: #{super()}\"\n\t\t103\n\tend", "def bs; end", "def default_tire_size\n raise NotImplementedError, \"This #{self.class} cannot respond to:\"\n end", "def operations; end", "def operations; end", "def length()\n #This is a stub, used for indexing\n end", "def isolated; end", "def isolated; end", "def size\n raise Exception.new(\"This should be subclassed.\")\n end", "def villian; end", "def initialize # rubocop:disable Lint/UselessMethodDefinition\n super()\n end", "def initialize # rubocop:disable Lint/UselessMethodDefinition\n super()\n end", "def initialize # rubocop:disable Lint/UselessMethodDefinition\n super()\n end", "def memsize\n end", "def engine_size; end", "def public_method; end", "def memos; end", "def memos; end", "def size\n @size \n end", "def size\n @size \n end", "def appraisals; end", "def appraisals; end", "def size\n 4\n end", "def initialize; end", "def initialize; end", "def initialize; end", "def initialize; end", "def initialize; end", "def initialize; end" ]
[ "0.73306245", "0.5994333", "0.5860821", "0.5855429", "0.5855429", "0.58265376", "0.57856655", "0.5726234", "0.5726234", "0.570183", "0.56900364", "0.56900364", "0.56900364", "0.56900364", "0.56900364", "0.56900364", "0.56900364", "0.56900364", "0.56900364", "0.56900364", "0.56900364", "0.56900364", "0.56900364", "0.56900364", "0.56900364", "0.56900364", "0.56900364", "0.56900364", "0.56900364", "0.56900364", "0.56900364", "0.568093", "0.568093", "0.567688", "0.56169486", "0.560271", "0.5600598", "0.5600598", "0.5570102", "0.5562467", "0.5562467", "0.55585706", "0.55585706", "0.55585706", "0.55585706", "0.5534795", "0.5528903", "0.5528903", "0.550967", "0.5499981", "0.5491989", "0.54692537", "0.54584855", "0.54501957", "0.54402775", "0.54153645", "0.54111", "0.54070127", "0.54070127", "0.5405391", "0.5405391", "0.5405391", "0.5405391", "0.5405391", "0.5405391", "0.5405391", "0.54019034", "0.5395673", "0.5390002", "0.5390002", "0.5390002", "0.5390002", "0.5387459", "0.5387236", "0.53834474", "0.53795743", "0.53795743", "0.5366392", "0.53654027", "0.53654027", "0.5359835", "0.5351215", "0.53508043", "0.53508043", "0.53508043", "0.53469837", "0.5345461", "0.5344006", "0.53395206", "0.53395206", "0.5335301", "0.5335301", "0.53318834", "0.53318834", "0.53103966", "0.5303483", "0.5303483", "0.5303483", "0.5303483", "0.5303483", "0.5303483" ]
0.0
-1
Requests a connection object from the connection pool. connection = pool.connection_for('domain.com') connection.request(Net::HTTP::Get.new('/index.html')) connection.request(Net::HTTP::Get.new('/about.html')) same thing in block form pool.connection_for('domain.com') do |connection| connection.request(Net::HTTP::Get.new('/index.html')) connection.request(Net::HTTP::Get.new('/about.html')) end Because the pool manages HTTP sessions you do not have to worry about closing a connection or returning a connection to the pool. Every time you call request on a connection object, a HTTP session received from the pool and returned after the request is complete.
def connection_for host, options = {}, &block connection = Connection.new(self, host, options) yield(connection) if block_given? connection end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def request(req = nil, options = {}, &block)\n @pool.with_connection do |connection|\n begin\n connection.request req, options, &block\n rescue Exception => e\n @pool.remove(connection)\n raise\n end\n end\n end", "def conn\n @conn ||= connect\n if block_given?\n yield @conn\n else\n @conn\n end\n rescue *HttpExceptions\n @conn = connect\n return if defined?(once)\n once = true && retry\n end", "def connection_pool(options = {}, &block)\n options = valid_options.merge(options)\n initialize_connection_pool(options) unless defined?(@connection_pool)\n\n if block_given?\n @connection_pool.with(&block)\n else\n @connection_pool\n end\n end", "def connect( &block )\n conn = @conn_pool.get_conn\n yield conn\n ensure\n @conn_pool.release_conn( conn )\n end", "def connect\n @connection_pool.get_connection\n end", "def with_connection_pooling\n # Verify active connections and remove and disconnect connections\n # associated with stale threads.\n ActiveRecord::Base.verify_active_connections!\n\n yield\n\n # This code checks in the connection being used by the current thread back\n # into the connection pool. It repeats this if you are using multiple\n # connection pools. It will not disconnect the connection.\n #\n # Returns any connections in use by the current thread back to the pool,\n # and also returns connections to the pool cached by threads that are no\n # longer alive.\n ActiveRecord::Base.clear_active_connections!\n\n end", "def pool\n pool_connection = ConnectionPool.new(size: 10, timeout: 5) do \n Redis.new :db=> redis_db_index, :password=> redis_instance.password, :host=> redis_instance.host, :port=> redis_instance.port\n end \n return pool_connection \n end", "def session(&block)\n @pool.with_connection &block\n end", "def handle request, response\n\n options = {}\n options[:port] = request.port\n options[:ssl] = request.use_ssl?\n options[:proxy_uri] = request.proxy_uri\n options[:ssl_verify_peer] = request.ssl_verify_peer?\n options[:ssl_ca_file] = request.ssl_ca_file if request.ssl_ca_file\n options[:ssl_ca_path] = request.ssl_ca_path if request.ssl_ca_path\n\n connection = pool.connection_for(request.host, options)\n connection.read_timeout = request.read_timeout\n\n begin\n http_response = connection.request(build_net_http_request(request))\n response.body = http_response.body\n response.status = http_response.code.to_i\n response.headers = http_response.to_hash\n rescue Timeout::Error, Errno::ETIMEDOUT => e\n response.timeout = true\n end\n nil\n\n end", "def http_connection\n if @in_session\n establish_shared_connection\n else\n create_http_connection\n end\n end", "def with_connection(&block)\n base_model.connection_pool.with_connection(&block)\n end", "def yield_connection\n response = begin\n resource = @connection_pool.resource\n yield resource\n ensure\n resource.close if resource\n end\n\n if @convert_objects\n convert(response)\n else\n response\n end\n end", "def connection\n @connection_pool\n end", "def with_connection\n ActiveRecord::Base.connection_pool.with_connection do |conn|\n yield conn\n end\n end", "def connect(uri, options: {}, &block)\n start = Time.now\n verifier = nil\n connected = false\n\n site = Puppet::HTTP::Site.from_uri(uri)\n if site.use_ssl?\n ssl_context = options.fetch(:ssl_context, nil)\n include_system_store = options.fetch(:include_system_store, false)\n ctx = resolve_ssl_context(ssl_context, include_system_store)\n verifier = Puppet::SSL::Verifier.new(site.host, ctx)\n end\n\n @pool.with_connection(site, verifier) do |http|\n connected = true\n if block_given?\n yield http\n end\n end\n rescue Net::OpenTimeout => e\n raise_error(_(\"Request to %{uri} timed out connect operation after %{elapsed} seconds\") % {uri: uri, elapsed: elapsed(start)}, e, connected)\n rescue Net::ReadTimeout => e\n raise_error(_(\"Request to %{uri} timed out read operation after %{elapsed} seconds\") % {uri: uri, elapsed: elapsed(start)}, e, connected)\n rescue EOFError => e\n raise_error(_(\"Request to %{uri} interrupted after %{elapsed} seconds\") % {uri: uri, elapsed: elapsed(start)}, e, connected)\n rescue Puppet::SSL::SSLError\n raise\n rescue Puppet::HTTP::HTTPError\n raise\n rescue => e\n raise_error(_(\"Request to %{uri} failed after %{elapsed} seconds: %{message}\") %\n {uri: uri, elapsed: elapsed(start), message: e.message}, e, connected)\n end", "def connect(options = {})\n return @pool = options[:pool] if options[:pool]\n options = options.dup\n timeout = options.delete(:timeout) || 5\n pool_size = options.delete(:pool_size) || 1\n @pool = Squirm::Pool.new(timeout)\n pool_size.times do\n conn = PG::Connection.open(options)\n yield conn if block_given?\n @pool.checkin conn\n end\n end", "def conn_start host, port, ssl\n con = Net::HTTP.new(host, port)\n if ssl\n con.use_ssl = true\n con.verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\n con.start\n if block_given?\n begin\n return yield(con)\n ensure\n con.finish\n end\n end\n con\nend", "def use(conn = nil)\n conn_given = !!conn\n conn = conn_given ? conn : @pool.checkout\n begin\n yield Thread.current[:squirm_connection] = conn\n ensure\n Thread.current[:squirm_connection] = nil\n @pool.checkin conn unless conn_given\n end\n end", "def configure\n yield self\n\n pool_size = 5\n host = @host.nil? ? 'minfraud.maxmind.com' : @host\n @connection_pool = ConnectionPool.new(size: pool_size) do\n make_http_client.persistent(\"https://#{host}\")\n end\n end", "def request(req)\n if opts[:retry_connections]\n request_with_timeout(req)\n else\n request_without_timeout(req)\n end\n end", "def with_connection\n conn = checkout\n yield conn\n ensure\n checkin conn\n end", "def with(opts = {})\n timeout = opts.fetch(:timeout, @timeout)\n\n Thread.handle_interrupt(Exception => :never) do\n conn = @pool.acquire(timeout)\n\n begin\n Thread.handle_interrupt(Exception => :immediate) do\n yield conn\n end\n ensure\n @pool.release(conn)\n end\n end\n end", "def request(*args, &blk)\n (@client ||= connect).request(*args, &blk)\n end", "def connection\n response&.request\n end", "def connect\n c = connection\n yield(c)\n ensure\n c.close if c\n end", "def http_connection\n (@shared_tcp_connection ||\n (@in_session && establish_shared_connection) ||\n create_http_connection)\n end", "def connection\n reconnect unless connected?\n if block_given?\n begin\n yield conn\n rescue Errno::ECONNRESET\n reconnect\n yield conn\n end\n else\n conn\n end\n end", "def make_conn(spec)\n case @handling_mode\n when :cache\n cache_connect(spec)\n when :pool\n # not yet implemented\n nil\n else\n nil\n end\n end", "def with_connection\n connection_id = current_connection_id\n fresh_connection = true unless active_connection?\n yield connection\n ensure\n release_connection(connection_id) if fresh_connection\n end", "def connection\r\n @connectoin ||= HTTPClient.new\r\n end", "def with_connection\n connection_id = current_connection_id\n fresh_connection = true unless active_connection?\n yield connection\n ensure\n release_connection(connection_id) if fresh_connection\n end", "def with_connection\n connection_id = current_connection_id\n fresh_connection = true unless active_connection?\n yield connection\n ensure\n release_connection(connection_id) if fresh_connection\n end", "def db_conn\n @db_conn_pool ||= ConnectionPool.new(size: 4, timeout: 2) do\n Mysql2::Client.new(self.db_settings)\n end\n end", "def with_connection\n connection = checkout\n @with_map[connection.object_id] = connection\n begin\n yield connection\n ensure\n # Update connection for any renew's that have occurred\n connection = @with_map.delete(connection.object_id)\n checkin(connection) if connection\n end\n end", "def do_get_block(req, proxy, conn, &block)\n @request_filter.each do |filter|\n filter.filter_request(req)\n end\n if str = @test_loopback_response.shift\n dump_dummy_request_response(req.body.dump, str) if @debug_dev\n conn.push(HTTP::Message.new_response(str))\n return\n end\n content = ''\n res = HTTP::Message.new_response(content)\n @debug_dev << \"= Request\\n\\n\" if @debug_dev\n sess = @session_manager.query(req, proxy)\n res.peer_cert = sess.ssl_peer_cert\n @debug_dev << \"\\n\\n= Response\\n\\n\" if @debug_dev\n do_get_header(req, res, sess)\n conn.push(res)\n sess.get_data() do |str|\n if block\n block.call(str)\n else\n content << str\n end\n end\n @session_manager.keep(sess) unless sess.closed?\n commands = @request_filter.collect { |filter|\n filter.filter_response(req, res)\n }\n if commands.find { |command| command == :retry }\n raise RetryableResponse.new\n end\n end", "def conn\n if @conn\n @conn\n else\n conn = Net::HTTP.new(host, 443)\n conn.use_ssl = true\n conn.verify_mode = OpenSSL::SSL::VERIFY_NONE\n @conn = conn\n end\n end", "def establish_connection(options = {}) # :yields: current_context\r\n\t\t\t establish_connection!(options)\r\n\t\t\t if (block_given?)\r\n \t\t\t\t begin \r\n \t\t\t\t return yield\r\n \t\t\t\t ensure\r\n \t\t\t\t @connections.pop() if connected?\r\n \t\t\t\t end\r\n \t\t\t\tend\r\n\t\t\t\tend", "def connection\n #@pool ||= {}\n #@pool[Thread.current] ||= Mongoc::Client.new(host, port, :pool_size=>@pool_size)\n #Mongoc::Client.new(host, port, {})\n Thread.current[:_mongo] ||= Mongoc::Client.new(host, port, {})\n end", "def reuse_connection\n logger.debug(\"[Dokken] reusing existing connection #{@connection}\")\n yield @connection if block_given?\n @connection\n end", "def execute(async)\n f = Fiber.current\n begin\n conn = acquire(f)\n conn.acquired_for_connection_pool += 1\n yield conn\n ensure\n conn.acquired_for_connection_pool -= 1\n conn.run_postponed_queries if conn.acquired_for_connection_pool == 0\n release(f) if !async && conn.acquired_for_connection_pool == 0\n end\n end", "def execute_streaming(request, options: {}, &block)\n redirector = Puppet::HTTP::Redirector.new(options.fetch(:redirect_limit, @default_redirect_limit))\n\n basic_auth = options.fetch(:basic_auth, nil)\n unless basic_auth\n if request.uri.user && request.uri.password\n basic_auth = { user: request.uri.user, password: request.uri.password }\n end\n end\n\n redirects = 0\n retries = 0\n response = nil\n done = false\n\n while !done do\n connect(request.uri, options: options) do |http|\n apply_auth(request, basic_auth)\n\n # don't call return within the `request` block\n http.request(request) do |nethttp|\n response = Puppet::HTTP::ResponseNetHTTP.new(request.uri, nethttp)\n begin\n Puppet.debug(\"HTTP #{request.method.upcase} #{request.uri} returned #{response.code} #{response.reason}\")\n\n if redirector.redirect?(request, response)\n request = redirector.redirect_to(request, response, redirects)\n redirects += 1\n next\n elsif @retry_after_handler.retry_after?(request, response)\n interval = @retry_after_handler.retry_after_interval(request, response, retries)\n retries += 1\n if interval\n if http.started?\n Puppet.debug(\"Closing connection for #{Puppet::HTTP::Site.from_uri(request.uri)}\")\n http.finish\n end\n Puppet.warning(_(\"Sleeping for %{interval} seconds before retrying the request\") % { interval: interval })\n ::Kernel.sleep(interval)\n next\n end\n end\n\n if block_given?\n yield response\n else\n response.body\n end\n ensure\n # we need to make sure the response body is fully consumed before\n # the connection is put back in the pool, otherwise the response\n # for one request could leak into a future response.\n response.drain\n end\n\n done = true\n end\n end\n end\n\n response\n end", "def connection\n begin\n @connections.hold { |dbh| yield(dbh) }\n rescue Mysql::Error => me\n \n @configuration.log.fatal(me)\n \n @connections.available_connections.each do |sock|\n begin\n sock.close\n rescue => se\n @configuration.log.error(se)\n end\n end\n \n @connections.available_connections.clear\n raise me\n end\n end", "def all_connections\n hold do |c|\n sync do\n yield c\n @available_connections.each{|conn| yield conn}\n end\n end\n end", "def all_connections\n hold do |c|\n sync do\n yield c\n @available_connections.each{|conn| yield conn}\n end\n end\n end", "def reuse_connection\n logger.debug(\"[WinRM] reusing existing connection #{@connection}\")\n yield @connection if block_given?\n @connection\n end", "def conn\n return @conn if defined?(@conn)\n @conn = Net::HTTP.new(resource[:source].host, resource[:source].port)\n @conn.open_timeout = resource[:http_open_timeout] || nil\n if resource[:source].scheme == 'https'\n @conn.use_ssl = true\n @conn.ca_path = resource[:http_ssl_ca_path] if resource[:http_ssl_ca_path]\n @conn.ca_file = resource[:http_ssl_ca_file] if resource[:http_ssl_ca_file]\n @conn.cert = OpenSSL::X509::Certificate.new(File.read(resource[:http_ssl_cert])) if resource[:http_ssl_cert]\n @conn.key = OpenSSL::PKey::RSA.new(File.read(resource[:http_ssl_key])) if resource[:http_ssl_key]\n @conn.verify_mode = if resource[:http_ssl_verify] === :true\n OpenSSL::SSL::VERIFY_PEER\n else\n OpenSSL::SSL::VERIFY_NONE\n end\n @conn.verify_depth = 5\n end\n @conn\n end", "def with_reserved_connection(&block)\n @connection.acquire\n yield\n ensure\n @connection.release\n end", "def create_http_connection(uri); end", "def aquire_connection\n conn = if @connection_pool\n @connection_pool.aquire_connection\n else\n @connection\n end\n @status = nil unless conn.connected?\n conn\n end", "def connections\n @connection_pool\n end", "def create_pool(node)\n ConnectionPool.new(\n size: node.options[:pool_size] || POOL_SIZE,\n timeout: node.options[:pool_timeout] || TIMEOUT\n ) do\n Connection.new(\n node.address.ip,\n node.address.port,\n node.options[:timeout] || Connection::TIMEOUT,\n node.options\n )\n end\n end", "def call(request)\n\t\t\t\t\t\traise ::Protocol::HTTP2::Error, \"Connection closed!\" if self.closed?\n\t\t\t\t\t\t\n\t\t\t\t\t\t@count += 1\n\t\t\t\t\t\t\n\t\t\t\t\t\tresponse = create_response\n\t\t\t\t\t\tresponse.send_request(request)\n\t\t\t\t\t\tresponse.wait\n\t\t\t\t\t\t\n\t\t\t\t\t\treturn response\n\t\t\t\t\tend", "def get_response(uri, req)\n Net::HTTP.start(uri.hostname, uri.port){|http| http.request(req) }\nend", "def all_connections\n yield @conn.first if @conn\n end", "def safe_connection(connection_pool)\n connection_pool.automatic_reconnect ||= true\n if !connection_pool.connected? && shards[Octopus.master_shard].connection.query_cache_enabled\n connection_pool.connection.enable_query_cache!\n end\n connection_pool.connection\n end", "def stream opts={}, &block\n retried = false\n opts = opts.merge(:request => self)\n\n begin\n start_time = Time.now\n conn = connection\n conn.start unless conn.started?\n conn_time = Time.now - start_time\n\n @response = conn.request http_request, nil, opts, &block\n @response.conn_time = conn_time\n\n @response\n\n rescue EOFError, Errno::EPIPE\n raise if retried\n @connection = nil\n retried = true\n retry\n end\n end", "def connection\n open(url)\n end", "def connect\n @client = @client_class.new\n @client.connect\n \n begin\n yield\n ensure\n @client.close\n ActiveRecord::Base.verify_active_connections!\n end\n end", "def http_request(original_uri, params)\n max_iterations = 60\n iterations = 0\n response = nil\n while iterations < max_iterations do\n begin\n @https_client.with_https_connection(original_uri.host, original_uri.port, original_uri.path, query: original_uri.query) do |conn, uri|\n conn.open_timeout = params[:open_timeout] ? params[:open_timeout] : 4 * 60\n conn.read_timeout = params[:read_timeout] ? params[:read_timeout] : 4 * 60\n if params[:request]\n request = params[:request].new(uri, params[:headers])\n else\n request = Net::HTTP::Get.new uri.request_uri\n end\n if params[:body]\n request.body = params[:body]\n end\n puts \"Request: \" + request.method + \" \" + request.uri.to_s\n response = conn.request(request)\n end\n break\n rescue Errno::ECONNREFUSED, Errno::EADDRNOTAVAIL\n puts \"Error: #{$!}, url=#{original_uri}\"\n if iterations == max_iterations - 1\n puts(\"Request failed after #{max_iterations} attempts: #{$!}, url=#{original_uri}\")\n raise\n else\n sleep 1\n end\n end\n iterations += 1\n end\n #puts \"Response: #{response.inspect}\"\n response\n end", "def send_request(conn, req, &block)\n @last_response = conn.request(req.delete(:method), req.delete(:uri), req, &block)\n end", "def connection\n @connection ||=\n begin\n conn_opts = {}\n conn_opts[:url] = url\n #conn_opts[:proxy] = proxy if proxy\n conn_opts[:request] = options.slice(:timeout, :open_timeout)\n conn_opts[:request][:params_encoder] = Faraday::FlatParamsEncoder\n\n retry_opt = {\n max: options[:retry_after_limit],\n interval: 0.05,\n interval_randomness: 0.5,\n backoff_factor: 2,\n }\n\n Faraday.new(conn_opts) do |conn|\n conn.use :ils_caching_middleware\n conn.request :retry, retry_opt\n conn.response :raise_error\n conn.adapter options[:adapter] || Faraday.default_adapter\n end\n end\n end", "def execute\n conn = connection\n Benchmark.bm { |x| x.report { yield conn } }\n conn.close\n end", "def connection(&block)\n raise ArgumentError.new('Mail::Retrievable#connection takes a block') unless block_given?\n\n start do |pop3|\n yield pop3\n end\n end", "def with_connection\n ActiveRecord::Base.connection_pool.with_connection do |connection|\n connection.transaction do\n if connection.adapter_name == \"PostgreSQL\"\n connection.execute \"SET TRANSACTION READ ONLY\"\n connection.execute \"SET LOCAL statement_timeout = 100\"\n # TODO support equivalent options for other adapters (such as mysql)\n end\n\n yield connection\n end\n end\n end", "def using_connection(connection_name, connection_spec)\n old_proxy_connection = proxy_connection\n self.proxy_connection = ConnectionProxy.new(connection_name, connection_spec)\n\n yield\n ensure\n self.proxy_connection = old_proxy_connection\n end", "def dispose\n return if @connection_pool.nil?\n\n until @connection_pool.empty?\n conn = @connection_pool.pop(true)\n conn&.close\n end\n\n @connection_pool = nil\n end", "def connection\n @connection ||= make_connection\n end", "def connection\n if defined?(@active_connection_name) && (conn = active_connections[@active_connection_name])\n conn\n else\n # retrieve_connection sets the cache key.\n conn = retrieve_connection\n active_connections[@active_connection_name] = conn\n end\n end", "def with &block\n @redis ||= ConnectionPool.new(POOL_CONF){ new_redis }\n @redis.with &block\n end", "def open\n @socket = TCPSocket.new(@uri.host, @uri.port)\n\n @ssl = OpenSSL::SSL::SSLSocket.new(@socket, @ssl_context)\n @ssl.sync_close = true\n @ssl.hostname = @uri.hostname\n @ssl.connect\n\n @http = HTTP2::Client.new\n @http.on(:frame) do |bytes|\n @ssl.print(bytes)\n @ssl.flush\n end\n\n @main_queue = Threading::DispatchQueue.new\n @work_queue = Threading::DispatchQueue.new\n @requests = Threading::Counter.new\n @exceptions = Queue.new\n @worker_thread = start_worker_thread!\n end", "def __build_connections\n Connections::Collection.new \\\n :connections => hosts.map { |host|\n host[:protocol] = host[:scheme] || DEFAULT_PROTOCOL\n host[:port] ||= DEFAULT_PORT\n\n client = ::Curl::Easy.new\n client.headers = {'User-Agent' => \"Curb #{Curl::CURB_VERSION}\"}\n client.url = __full_url(host)\n\n if host[:user]\n client.http_auth_types = host[:auth_type] || :basic\n client.username = host[:user]\n client.password = host[:password]\n end\n\n client.instance_eval &@block if @block\n\n Connections::Connection.new :host => host, :connection => client\n },\n :selector_class => options[:selector_class],\n :selector => options[:selector]\n end", "def with_connection\n tries = 0\n\n @locket.synchronize do\n begin\n tries += 1\n yield(socket)\n rescue IOError, Errno::EPIPE, Errno::ECONNREFUSED, InvalidResponse, Timeout::Error, Riemann::Client::TcpSocket::Error\n close\n raise if tries > 3\n retry\n rescue Exception\n close\n raise\n end\n end\n end", "def http(&block)\n http = Net::HTTP.new(@uri.host, @uri.port)\n if @uri.port == 443\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\n return http.start(&block) if block_given?\n http\n end", "def with_connections\n source_model.connection_pool.with_connection do\n destination_model.connection_pool.with_connection do\n yield\n end\n end\n end", "def connection\n conn = Kronk::HTTP.new @uri.host, @uri.port,\n :proxy => self.proxy,\n :ssl => !!(@uri.scheme =~ /^https$/)\n\n conn.verify_mode = OpenSSL::SSL::VERIFY_NONE if\n conn.use_ssl? && @insecure_ssl\n\n conn.open_timeout = conn.read_timeout = @timeout if @timeout\n\n conn\n end", "def with_http_response(url, &block)\n uri = URI(url)\n\n request = Net::HTTP::Get.new(uri)\n request.initialize_http_header(request_headers)\n request_options[:use_ssl] = true\n\n environment_proxy = ignore_env_proxy ? nil : :ENV\n\n Net::HTTP.start(\n uri.host,\n uri.port,\n request_proxy&.host || environment_proxy,\n request_proxy&.port,\n request_proxy&.user,\n request_proxy&.password,\n request_options\n ) do |http|\n http.request(request, &block)\n end\n end", "def with_connection\n tries = 0\n\n @locket.synchronize do\n tries += 1\n yield(socket)\n rescue IOError, Errno::EPIPE, Errno::ECONNREFUSED, InvalidResponse, Timeout::Error,\n Riemann::Client::TcpSocket::Error\n close\n raise if tries > 3\n\n retry\n rescue StandardError\n close\n raise\n end\n end", "def http\n @http || prepare_http_connection\n end", "def checkout\n start_time = Time.now\n connection = nil\n reserved_connection_placeholder = Thread.current\n begin\n @mutex.synchronize do\n raise \"Can't perform checkout, #{@name} has been closed\" if @pool_size == 0\n until connection do\n if @checked_out.size < @connections.size\n connection = (@connections - @checked_out).first\n @checked_out << connection\n elsif @connections.size < @pool_size\n # Perform the actual connection outside the mutex\n connection = reserved_connection_placeholder\n @connections << connection\n @checked_out << connection\n @logger.debug {\"#{@name}: Created connection ##{@connections.size} #{connection}(#{connection.object_id}) for #{name}\"}\n else\n @logger.info \"#{@name}: Waiting for an available connection, all #{@pool_size} connections are checked out.\"\n wait_mutex(start_time)\n end\n end\n end\n ensure\n delta = Time.now - start_time\n if delta > @warn_timeout\n @logger.warn \"#{@name}: It took #{delta} seconds to obtain a connection. Consider raising the pool size which is \" +\n \"currently set to #{@pool_size}.\"\n end\n end\n if connection == reserved_connection_placeholder\n connection = renew(reserved_connection_placeholder)\n elsif @idle_timeout && (Time.now - connection._last_used) >= @idle_timeout\n connection = renew(connection)\n end\n\n @logger.debug {\"#{@name}: Checkout connection #{connection}(#{connection.object_id}) self=#{self}\"}\n return connection\n end", "def session(&block)\n raise ArgumentError, \"#{self.class}#shared_connection must be passed a block\" unless block_given?\n\n # Immediately open a TCP connection to the server and leave it open for\n # multiple requests.\n begin\n t0 = Time.now\n @in_session = true\n establish_shared_connection\n block.call\n rescue Timeout::Error\n elapsed = Time.now - t0\n ::NewRelic::Agent.logger.warn \"Timed out opening connection to collector after #{elapsed} seconds. If this problem persists, please see http://status.newrelic.com\"\n raise\n ensure\n @in_session = false\n close_shared_connection\n end\n end", "def hold()\n fiber = Fiber.current\n conn = acquire(fiber)\n yield conn\n end", "def connection\n HTTPVerb.new(via).request_class.new(uri.request_uri)\n end", "def using_connection(connection_or_class, label: nil, &block)\n if connection_or_class.is_a?(Class) && connection_or_class < ActiveRecord::Base\n label ||= connection_or_class.name\n connection_or_class.connection_pool.with_connection do |connection|\n switch_connection_in_block(connection, label: label, &block)\n end\n else\n switch_connection_in_block(connection_or_class, label: label, &block)\n end\n end", "def prepare_http_connection\n conn = @http\n if conn.nil? || !options[:persistent]\n conn = HTTPClient.new(options[:proxy] || self.class.proxy)\n set_http_connection_options(conn, options)\n @http = conn # Always set to last used connection\n end\n conn\n end", "def with_two_connections\n run_without_connection do |original_connection|\n ActiveRecord::Base.establish_connection(original_connection.merge(pool_size: 2))\n begin\n ddl_connection = ActiveRecord::Base.connection_pool.checkout\n begin\n yield original_connection, ddl_connection\n ensure\n ActiveRecord::Base.connection_pool.checkin ddl_connection\n end\n ensure\n ActiveRecord::Base.connection_handler.clear_all_connections!(:all)\n end\n end\n end", "def connection(&block)\n raise ArgumentError.new('Mail::Retrievable#connection takes a block') unless block_given?\n\n start do |imap|\n info \"connection block\"\n yield imap\n end\n end", "def acquire(*a)\n conn = nil\n\n 1.times do\n if (conn = super) &&\n (timer = sync{@connection_timestamps.delete(conn)}) &&\n Sequel.elapsed_seconds_since(timer) > @connection_validation_timeout &&\n !db.valid_connection?(conn)\n\n case pool_type\n when :sharded_threaded, :sharded_timed_queue\n sync{@allocated[a.last].delete(Sequel.current)}\n else\n sync{@allocated.delete(Sequel.current)}\n end\n\n disconnect_connection(conn)\n redo\n end\n end\n\n conn\n end", "def index\n @http_connections = HttpConnection.all\n end", "def connection(&blk)\n @connection ||= Connection.build endpoint.secret, &blk\n end", "def http_request(url, options = {})\n\t\t\treq = Net::HTTP::Get.new(url)\n\t\t\treq[\"user-agent\"] = @@user_agent # ensure returns XML\n\t\t\treq[\"cookie\"] = \"cookieMenu=all; cookieLangId=\" + options[:lang] + \"; cookies=true;\"\n\t\t\t\n\t\t\treq[\"cookie\"] += options[:cookie] if options[:cookie]\n\n\t\t\turi = URI.parse(URI.escape(url))\n\t\t\t\n\t\t\thttp = Net::HTTP.new(uri.host, uri.port)\n\t\t\t\n\t\t\tif (options[:secure])\n\t\t\t\tputs \"Secure authentication\" if options[:debug]\n\n\t\t\t\thttp.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\t\t\t\thttp.use_ssl = true\n\t\t\tend\n\t\t \n\t\t\t\n\t\t\tbegin\n\t\t\t\ttries = 0\n\t\t\t http.start do\n\t\t\t\t puts \"Get URL \"+ url if options[:debug]\n\t\t\t res = http.request req\n\t\t\t\t\t# response = res.body\n\t\t\t\t\t\n\t\t\t\t\t# FIXME WoW Armory rate limiter. Simple version\n\t\t\t\t\t# Needs to work across instances and not sleep for 1.5 if the\n\t\t\t\t\t# request took more than 1.5\n\t\t\t\t\t# just need a 1.5 second wait until the start of the next request\n \n if options[:rate_limit]\n\t\t\t\t\t puts \"Sleeping for 1.5 seconds\" if options[:debug]\n \t\t\t\t\tsleep 1.5\n\t\t\t\t\tend\n\n\t\t\t\t\tresponse = case res\n\t\t\t\t\t\twhen Net::HTTPSuccess, Net::HTTPRedirection\n\t\t\t\t\t\t\tres.body\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\ttries += 1\n\t\t\t\t\t\t\tif tries > @@max_connection_tries\n\t\t\t\t\t\t\t\traise Wowr::Exceptions::NetworkTimeout.new('Timed out')\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tredo\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\t\t\t end\n\t\t\trescue Timeout::Error => e\n raise Wowr::Exceptions::NetworkTimeout.new('Timed out - Timeout::Error Exception')\n\t\t\trescue SocketError, Net::HTTPExceptions => e\n\t\t\t\traise Wowr::Exceptions::ServerDoesNotExist.new('Specified server at ' + url + ' does not exist.')\n\t\t\tend\n\t\tend", "def request(params={}, &block)\n # @data has defaults, merge in new params to override\n datum = @data.merge(params)\n datum[:headers] = @data[:headers].merge(datum[:headers] || {})\n\n validate_params(:request, params, datum[:middlewares])\n # If the user passed in new middleware, we want to validate that the original connection parameters\n # are still valid with the provided middleware.\n if params[:middlewares]\n validate_params(:connection, @data, datum[:middlewares])\n end\n\n if datum[:user] || datum[:password]\n user, pass = Utils.unescape_uri(datum[:user].to_s), Utils.unescape_uri(datum[:password].to_s)\n datum[:headers]['Authorization'] ||= 'Basic ' + [\"#{user}:#{pass}\"].pack('m').delete(Excon::CR_NL)\n end\n\n host_key = datum[:headers].keys.detect {|k| k.casecmp('Host') == 0 } || 'Host'\n if datum[:scheme] == UNIX\n datum[:headers][host_key] ||= ''\n else\n datum[:headers][host_key] ||= datum[:host] + port_string(datum)\n end\n\n # RFC 7230, section 5.4, states that the Host header SHOULD be the first one # to be present.\n # Some web servers will reject the request if it comes too late, so let's hoist it to the top.\n if (host = datum[:headers].delete(host_key))\n datum[:headers] = { host_key => host }.merge(datum[:headers])\n end\n\n # default to GET if no method specified\n unless datum[:method]\n datum[:method] = :get\n end\n\n # if path is empty or doesn't start with '/', insert one\n unless datum[:path][0, 1] == '/'\n datum[:path] = datum[:path].dup.insert(0, '/')\n end\n\n if block_given?\n Excon.display_warning('Excon requests with a block are deprecated, pass :response_block instead.')\n datum[:response_block] = block\n end\n\n datum[:connection] = self\n\n # cleanup data left behind on persistent connection after interrupt\n if datum[:persistent] && !@persistent_socket_reusable\n reset\n end\n\n datum[:stack] = datum[:middlewares].map do |middleware|\n lambda {|stack| middleware.new(stack)}\n end.reverse.inject(self) do |middlewares, middleware|\n middleware.call(middlewares)\n end\n datum = datum[:stack].request_call(datum)\n\n unless datum[:pipeline]\n @persistent_socket_reusable = false\n datum = response(datum)\n @persistent_socket_reusable = true\n\n if datum[:persistent]\n if (key = datum[:response][:headers].keys.detect {|k| k.casecmp('Connection') == 0 })\n if datum[:response][:headers][key].casecmp('close') == 0\n reset\n end\n end\n else\n reset\n end\n\n Excon::Response.new(datum[:response])\n else\n datum\n end\n rescue => error\n reset\n\n # If we didn't get far enough to initialize datum and the middleware stack, just raise\n raise error if !datum\n\n datum[:error] = error\n if datum[:stack]\n datum[:stack].error_call(datum)\n else\n raise error\n end\n end", "def connection\n @connection ||= begin\n conn = Faraday.new(url: url)\n conn.build do |b|\n conn_build.call(b)\n end if conn_build\n conn\n end\n end", "def checkout\n connect_to_master if !connected?\n start_time = Time.now\n loop do\n if (Time.now - start_time) > @timeout\n raise ConnectionTimeoutError, \"could not obtain connection within \" +\n \"#{@timeout} seconds. The max pool size is currently #{@size}; \" +\n \"consider increasing the pool size or timeout.\"\n end\n\n @connection_mutex.synchronize do\n socket = if @checked_out.size < @sockets.size\n checkout_existing_socket\n elsif @sockets.size < @size\n checkout_new_socket\n end\n\n return socket if socket\n\n # Otherwise, wait\n if @logger\n @logger.warn \"Waiting for available connection; #{@checked_out.size} of #{@size} connections checked out.\"\n end\n @queue.wait(@connection_mutex)\n end\n end\n end", "def ident_http_request(method, uri_string, credentials=nil, headers={}, data=nil, limit = 3, open_timeout=15, read_timeout=15)\n\n response = nil\n begin\n\n # set user agent\n user_agent = \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.73 Safari/537.36\"\n headers[\"User-Agent\"] = user_agent\n\n attempts=0\n max_attempts=limit\n found = false\n timeout = false\n\n uri = URI.parse uri_string\n\n # keep track of redirects\n response_urls = [\"#{uri}\"]\n\n unless uri\n _log error \"Unable to parse URI from: #{uri_string}\"\n return\n end\n\n until( found || attempts >= max_attempts)\n @task_result.logger.log \"Getting #{uri}, attempt #{attempts}\" if @task_result\n attempts+=1\n\n if $global_config\n if $global_config.config[\"http_proxy\"]\n proxy_config = $global_config.config[\"http_proxy\"]\n proxy_addr = $global_config.config[\"http_proxy\"][\"host\"]\n proxy_port = $global_config.config[\"http_proxy\"][\"port\"]\n proxy_user = $global_config.config[\"http_proxy\"][\"user\"]\n proxy_pass = $global_config.config[\"http_proxy\"][\"pass\"]\n end\n end\n\n # set options\n opts = {}\n if uri.instance_of? URI::HTTPS\n opts[:use_ssl] = true\n opts[:verify_mode] = OpenSSL::SSL::VERIFY_NONE\n end\n\n http = Net::HTTP.start(uri.host, uri.port, proxy_addr, proxy_port, opts)\n http.open_timeout = open_timeout\n http.read_timeout = read_timeout\n\n path = \"#{uri.path}\"\n path = \"/\" if path==\"\"\n\n # add in the query parameters\n if uri.query\n path += \"?#{uri.query}\"\n end\n\n ### ALLOW DIFFERENT VERBS HERE\n if method == :get\n request = Net::HTTP::Get.new(uri)\n elsif method == :post\n # see: https://coderwall.com/p/c-mu-a/http-posts-in-ruby\n request = Net::HTTP::Post.new(uri)\n request.body = data\n elsif method == :head\n request = Net::HTTP::Head.new(uri)\n elsif method == :propfind\n request = Net::HTTP::Propfind.new(uri.request_uri)\n request.body = \"Here's the body.\" # Set your body (data)\n request[\"Depth\"] = \"1\" # Set your headers: one header per line.\n elsif method == :options\n request = Net::HTTP::Options.new(uri.request_uri)\n elsif method == :trace\n request = Net::HTTP::Trace.new(uri.request_uri)\n request.body = \"blah blah\"\n end\n ### END VERBS\n\n # set the headers\n headers.each do |k,v|\n request[k] = v\n end\n\n # handle credentials\n if credentials\n request.basic_auth(credentials[:username],credentials[:password])\n end\n\n # USE THIS TO PRINT HTTP REQUEST\n #request.each_header{|h| _log_debug \"#{h}: #{request[h]}\" }\n # END USE THIS TO PRINT HTTP REQUEST\n\n # get the response\n response = http.request(request)\n\n if response.code==\"200\"\n break\n end\n\n if (response.header['location']!=nil)\n newuri=URI.parse(response.header['location'])\n if(newuri.relative?)\n newuri=URI.parse(\"#{uri}#{response.header['location']}\")\n end\n response_urls << ident_encode(newuri.to_s)\n uri=newuri\n\n else\n found=true #resp was 404, etc\n end #end if location\n end #until\n\n final_url = uri\n\n ### TODO - create a global $debug config option\n \n rescue ArgumentError => e\n #puts \"Unable to connect #{uri}: #{e}\"\n rescue Net::OpenTimeout => e\n #puts \"Unable to connect #{uri}: #{e}\"\n timeout = true\n rescue Net::ReadTimeout => e\n #puts \"Unable to connect #{uri}: #{e}\"\n timeout = true\n rescue Errno::ENETDOWN => e\n #puts \"Unable to connect #{uri}: #{e}\" \n rescue Errno::ETIMEDOUT => e\n #puts \"Unable to connect #{uri}: #{e}\" \n timeout = true\n rescue Errno::EINVAL => e\n #puts \"Unable to connect #{uri}: #{e}\"\n rescue Errno::ENETUNREACH => e\n #puts \"Unable to connect #{uri}: #{e}\"\n rescue Errno::EHOSTUNREACH => e\n #puts \"Unable to connect #{uri}: #{e}\"\n rescue URI::InvalidURIError => e\n #\n # XXX - This is an issue. We should catch this and ensure it's not\n # due to an underscore / other acceptable character in the URI\n # http://stackoverflow.com/questions/5208851/is-there-a-workaround-to-open-urls-containing-underscores-in-ruby\n #\n #puts \"Unable to connect #{uri}: #{e}\"\n rescue OpenSSL::SSL::SSLError => e\n #puts \"Unable to connect #{uri}: #{e}\" \n rescue Errno::ECONNREFUSED => e\n #puts \"Unable to connect #{uri}: #{e}\" \n rescue Errno::ECONNRESET => e\n #puts \"Unable to connect #{uri}: #{e}\" \n rescue Net::HTTPBadResponse => e\n #puts \"Unable to connect #{uri}: #{e}\" \n rescue Zlib::BufError => e\n #puts \"Unable to connect #{uri}: #{e}\" \n rescue Zlib::DataError => e # \"incorrect header check - may be specific to ruby 2.0\"\n #puts \"Unable to connect #{uri}: #{e}\" \n rescue EOFError => e\n #puts \"Unable to connect #{uri}: #{e}\" \n rescue SocketError => e\n #puts \"Unable to connect #{uri}: #{e}\" \n rescue Encoding::InvalidByteSequenceError => e\n #puts \"Encoding issue #{uri}: #{e}\" \n rescue Encoding::UndefinedConversionError => e\n #puts \"Encoding issue #{uri}: #{e}\" \n end\n\n # generate our output\n out = {\n :timeout => timeout,\n :start_url => uri_string,\n :final_url => final_url.to_s,\n :request_type => :ruby,\n :request_method => method,\n :request_credentials => credentials,\n :request_headers => headers,\n :request_data => data,\n :request_attempts_limit => limit,\n :request_attempts_used => attempts,\n :request_user_agent => user_agent,\n :request_proxy => proxy_config,\n :response_urls => response_urls,\n :response_object => response\n }\n\n # verify we have a response before adding these\n if response\n out[:response_headers] = response.each_header.map{|x| ident_encode \"#{x}: #{response[x]}\" }\n out[:response_body] = ident_encode(response.body)\n end\n\n out\n end", "def all_connections\n hold do |conn|\n yield conn\n\n # Use a hash to record all connections already seen. As soon as we\n # come across a connection we've already seen, we stop the loop.\n conns = {}\n conns.compare_by_identity\n while true\n conn = nil\n begin\n break unless (conn = @queue.pop(timeout: 0)) && !conns[conn]\n conns[conn] = true\n yield conn\n ensure\n @queue.push(conn) if conn\n end\n end\n end\n end", "def get *args, &block\n handle @conn.get *args, &block\n end", "def close\n @mutex.lock do\n unless @connection_pool.nil? or @connection_pool.is_closed\n @connection_pool.close\n @connection_pool = nil\n end\n end\n end", "def connection\n return @connection if @connection\n conn_opts = {\n host: host,\n port: port,\n cert: opts[:cert],\n key: opts[:key],\n cacert: opts[:cacert]\n }\n @connection = Ncio::HttpClient.new(conn_opts)\n end", "def connection(&block)\n raise ArgumentError.new('Mail::Retrievable#connection takes a block') unless block_given?\n\n start do |imap|\n yield imap\n end\n end", "def connect!\n @connection = Net::HTTP.new(@server, 80)\n if @ssl\n @connection.use_ssl = true\n @connection.verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\n @connection.start\n end" ]
[ "0.70712215", "0.6865806", "0.6775215", "0.67118084", "0.652175", "0.6521659", "0.6499072", "0.64943236", "0.645212", "0.64445376", "0.6400179", "0.6374956", "0.63282734", "0.62813157", "0.62651896", "0.6226672", "0.6219206", "0.6196349", "0.6162976", "0.61153466", "0.610464", "0.60711145", "0.6024607", "0.6013014", "0.59979975", "0.5957253", "0.5939781", "0.5935357", "0.5920982", "0.5890982", "0.5890616", "0.5890616", "0.5879024", "0.5867918", "0.5847118", "0.5844424", "0.5843204", "0.5823732", "0.5823413", "0.5820202", "0.58055824", "0.57940716", "0.5793873", "0.5793873", "0.5777961", "0.57652736", "0.5751153", "0.5737978", "0.5723291", "0.57073843", "0.5705783", "0.57043403", "0.57000685", "0.5700041", "0.5655843", "0.5647251", "0.5647135", "0.5628577", "0.56263435", "0.5621116", "0.55990696", "0.55978096", "0.5596746", "0.559562", "0.55929446", "0.5591482", "0.5575236", "0.55698776", "0.5567969", "0.55544937", "0.55459803", "0.55441946", "0.5543666", "0.55370325", "0.5527028", "0.55250853", "0.5523964", "0.5516415", "0.5512518", "0.5510071", "0.5496542", "0.5486173", "0.5485321", "0.54821914", "0.5470441", "0.5465377", "0.5463032", "0.5451613", "0.54506576", "0.5448846", "0.5446803", "0.5444742", "0.5423336", "0.54218435", "0.54172885", "0.541686", "0.5414819", "0.5409463", "0.54093814", "0.5403313" ]
0.63074315
13
Returns the number of sessions currently in the pool, not counting those currently in use.
def size @pool_mutex.synchronize { @pool.size } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def session_count\n @http_client.session_count\n end", "def session_count\n @http_client.session_count\n end", "def session_count\n entries.count('attended_session')\n end", "def current_pool_size(pool_name)\n pool(pool_name).count\n end", "def pool \n @pool.select(&:alive?).size\n end", "def count_used_instances\n count = 0\n return count\n end", "def get_available_slots\n # Return the number of unused sessions\n return @sessions_limit - get_status['running_sessions']\n end", "def length\n mutex.synchronize { running? ? @pool.length : 0 }\n end", "def known_ip_count\n @mutex.synchronize do\n @connections.size\n end\n end", "def available_count\n raise_if_closed!\n\n @lock.synchronize do\n @available_connections.length\n end\n end", "def numConnections\n if activeConnections? then do\n n = 0\n @connectedClients.each {|client| n += 1 }\n return n\n else\n return 0\n end\n end", "def pool_size\n @pool.pool_size\n end", "def get_num_connections(params)\n # TODO: deal with node not existing (nil coming back from get_stats)\n get_stats(params)['STATISTIC_SERVER_SIDE_CURRENT_CONNECTIONS']\n end", "def connection_count\n request('getconnectioncount')\n end", "def size\n @pool.size\n end", "def user_threads_count\n user_threads_lock.synchronize do\n user_threads.count\n end\n end", "def get_pool_total(pool_name)\n return token_counts( nil, pool_name )\n end", "def session_rate_limit\n SessionTracker.where(session_id: request.session.id, created_at:(Date.today.beginning_of_day..Date.today.end_of_day)).count\n end", "def count_unique_connections\n connected_users = []\n ActionCable.server.connections.each do |connection|\n connected_users.push(1)\n end\n return connected_users.uniq.length\n end", "def active_on_cluster_count\n (waiting_count + running_count)\n end", "def total_sessions(options = {})\n request_model = @request_model_factory.total_sessions_request_model(options)\n response = @network_client.perform_request(request_model)\n JSON.parse(response.body)['sessions']\n end", "def get_token_counts( token, pool_name )\n return token_counts( token, pool_name )\n end", "def get_no_of_users\n\t\tusers.select(:id).count\n\tend", "def session_count_with_counselor(counselor_id)\n counseling_sessions.where(:counselor_id => counselor_id).count\n end", "def idle\n @size - @active_threads.value\n end", "def connections\n @connections.size\n end", "def connections\n @connections.size\n end", "def njobs\n @pool.njobs\n end", "def effective_num_days\n [sessions.count, time_constraint(:max_days)].compact.min\n end", "def count\n @mutex.synchronize do\n count_nonsynchronize\n end\n end", "def reset_session_counts\n self.session_count = 0\n end", "def active_client_threads\n # If threaded return a count from the clients list\n return @clients.length if @threaded\n\n # Else return 0 if not threaded\n return 0\n end", "def get_window_count\n return @browser.windows.count\n end", "def upcoming_count\n @upcoming_count ||= @upcoming_sessions.try(:length) || Session.upcoming.where(topic: self).count\n end", "def count\n @mutex.synchronize { @count }\n end", "def getconnectioncount\n coind.getconnectioncount\n end", "def length\n @executor.getPoolSize\n end", "def get_unique_clients\n return @client_counter.length\n end", "def running_thread_count #borrowed from used Kashyap on Stack Overflow\n\t\tThread.list.select {|thread| thread.status == \"run\"}.count\n\tend", "def txn_num\n if ended?\n raise Error::SessionEnded\n end\n\n @server_session.txn_num\n end", "def worker_count()\n @workers.size\n end", "def worker_count()\n @workers.size\n end", "def unsynchronized_size\n @available_connections.length + @checked_out_connections.length + @pending_connections.length\n end", "def sessions\n Thread.current[:sessions] ||= {}\n end", "def num_uniques\n visitors.count\n end", "def num_uniques\n visitors.count\n end", "def num_uniques\n visitors.count\n end", "def sessions\n Thread.current[:sessions] ||= {}\n end", "def limited_users_count\n @limited_users_count ||= users.limit(count_limit).count\n end", "def user_count\n users.count\n end", "def number_requests\r\n return @requests.length\r\n end", "def count_tickets\n tickets = self.tickets\n total_tickets = tickets.count\n return total_tickets\n end", "def method()\n @workers.size\n end", "def running_thread_count()\n Thread.list.select {|thread| thread.status == \"run\"}.count\n end", "def count\n @count ||= get_count\n end", "def tcp_count\n host_stats[:tcp].to_i\n end", "def aps_applications_count\n redis.smembers(:aps_applications).size\n end", "def number_requests\r\n\t\treturn @requests.length\r\n \tend", "def get_session_age\n return Time.now.to_i - session.last_checkin.to_i\n end", "def sessions\n response.present? ? response.totals_for_all_results['ga:sessions'] : 0\n end", "def get_number_of_publishers\n @connections.length\n end", "def concurrent_count\n debug(\"Getting puppet status\")\n\n running = 0\n\n @puppet.status do |resp|\n begin\n running += resp[:body][:data][:running].to_i\n rescue Exception => e\n debug(\"Failed to get node status: #{e}, continuing\")\n end\n end\n\n running\nend", "def num_waiting\n @pop_mutex.waiting_threads_count + @waiter.waiting_threads_count\n end", "def nicks_connected_with\n @connection_cache.keys\n end", "def guest_count\n return @guests.count\n end", "def running_tasks_count\n @@running_tasks_count\n end", "def seconds_idle # :nodoc:\n return 0 if in_use?\n Process.clock_gettime(Process::CLOCK_MONOTONIC) - @idle_since\n end", "def initialize\n require 'concurrent'\n\n @session_counts = Concurrent::Hash.new(0)\n end", "def aps_notification_count_for_application(application_name)\n redis.llen(aps_application_queue_key(application_name)).to_i\n end", "def thread_count\n @worker_threads_count.value\n end", "def active_node_count\n Puppet.debug('Querying PuppetDB for Active Nodes')\n pql = ['from', 'nodes',\n ['and',\n ['=', ['node', 'active'], true],\n ]\n ]\n results = query_puppetdb(pql)\n return nil if results.nil?\n Puppet.debug(results)\n results.count\n end", "def increment_count\n session[:count] += 1\n @count = session[:count]\n end", "def connection_count\n @@_telnet_connection_count\n end", "def worker_count\n @action == 'run' ? 1 : workers\n end", "def count\n redis { |conn| conn.llen(key) }\n end", "def server_count(id = '__default__')\n @server_counts[id]\n end", "def task_count()\n @tasks.size\n end", "def get_num\n\t\treturn @num_users\n\tend", "def getconnectioncount\n request :getconnectioncount\n end", "def guests_count\n return @guests_count\n end", "def ntCount\n return @ntIndex.length\n end", "def interested_users_count\n self.users.size\n end", "def sessions\n return @sessions\n end", "def token_count_vector( token )\n token_pool_counts = []\n self.pools.each do |pool_name, pool|\n\tunless pool_name == '__Corpus__'\n\t token_pool_counts.push( get_token_counts( token, pool_name ) )\n\tend\n end\n return token_pool_counts\n end", "def vp_count(locked=false)\n if locked\n return @vp_lock.synchronize{@hostname2vp.length}\n else\n return @hostname2vp.length\n end\n end", "def running_count(tracking_key)\n Resque.redis.get(running_count_key(tracking_key)).to_i\n end", "def subscription_count\n @subs.size\n end", "def check_in_count()\n return @guests.length #guests array length\n end", "def count\n return @@all\n end", "def num_waiting\n @waiting.size\n end", "def num_waiting\n @waiting.size\n end", "def created_count(server=:default)\n server = @servers[server]\n @allocated[server].length + @available_connections[server].length\n end", "def busy_size\n @busy_grp.list.size\n end", "def num_connections\n @num_connections ||= @doc.xpath('/person/num-connections').text\n end", "def get_players_num\n\t\treturn @players.length\n\tend", "def unseen_memberships_count\n messages.watchable.unseen.group_by(&:membership_id).length\n end", "def cart_products_count\n count = 0\n CartProduct.all.each do |product|\n if product.user_id.to_s == logged_in.to_s\n count += 1\n end\n end\n return count\n end", "def total_unprocessed_tasks_count\n return @total_unprocessed_tasks_count\n end", "def tasks_total_count\n tasks.length\n end", "def get_server_count\n @redis.scard(\"servers\") do |count|\n yield count.to_i\n end\n end" ]
[ "0.751882", "0.751882", "0.7052156", "0.6961703", "0.69174224", "0.6824242", "0.67998475", "0.6658201", "0.6530768", "0.65033126", "0.63871723", "0.6382236", "0.6256664", "0.61764187", "0.6172329", "0.6167277", "0.6157506", "0.6156232", "0.6116119", "0.610121", "0.6035581", "0.6023776", "0.60226095", "0.6008089", "0.5985342", "0.59745616", "0.59745616", "0.595892", "0.59387386", "0.592908", "0.58578616", "0.5844353", "0.58410716", "0.5823943", "0.5811234", "0.5809171", "0.580821", "0.5804693", "0.57978094", "0.5776333", "0.5765722", "0.5765722", "0.57534856", "0.5736478", "0.57345647", "0.57345647", "0.57345647", "0.57247573", "0.57232344", "0.5686998", "0.5686625", "0.5678372", "0.56718665", "0.56577903", "0.5657201", "0.5657109", "0.56517273", "0.56475717", "0.5640423", "0.56327456", "0.56269723", "0.5621526", "0.56126475", "0.5599161", "0.5593834", "0.55679834", "0.55670273", "0.55666447", "0.55638784", "0.55426884", "0.5537449", "0.55368435", "0.5534348", "0.553053", "0.552986", "0.5528973", "0.55226755", "0.55204135", "0.55129474", "0.5501755", "0.5496163", "0.5492678", "0.5487257", "0.54811525", "0.5479378", "0.5478895", "0.5474079", "0.5472328", "0.54696685", "0.54681087", "0.54681087", "0.54664224", "0.5464323", "0.5462945", "0.5461213", "0.54602766", "0.5457843", "0.5452384", "0.5452265", "0.54494447" ]
0.6383814
11
Removes stale http sessions from the pool (that have exceeded the idle timeout).
def clean! @pool_mutex.synchronize { _clean } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reap_expired_sessions\n @timestamps.each do |session_id,stamp|\n delete_session(session_id) if (stamp + @session_ttl) < Time.now \n end\n GC.start\n end", "def cleanup\n @sessions.each_value do |session|\n session.close if session.expired?\n end\n rescue => e\n log.error(\"Expired session cleanup failed: #{e}\")\n end", "def cleanup_sessions\n @mutex.synchronize { @sessions.garbage_collect }\n end", "def close_idle_connections(idle_time) # in sec\n @http_client.keep_alive_timeout = idle_time # set timeout value\n close_expired_connections\n end", "def close_idle_connections(idle_time) # in sec\n @http_client.keep_alive_timeout = idle_time # set timeout value\n close_expired_connections\n end", "def clean_sessions\n self.log_puts(\"Cleaning sessions on appserver.\") if @debug\n \n #Clean up various inactive sessions.\n session_not_ids = []\n time_check = Time.now.to_i - 300\n @sessions.delete_if do |session_hash, session_data|\n session_data[:dbobj].flush\n \n if session_data[:dbobj].date_lastused.to_i > time_check\n session_not_ids << session_data[:dbobj].id\n false\n else\n true\n end\n end\n \n self.log_puts(\"Delete sessions...\") if @debug\n @ob.list(:Session, {\"id_not\" => session_not_ids, \"date_lastused_below\" => (Time.now - 5356800)}) do |session|\n idhash = session[:idhash]\n self.log_puts(\"Deleting session: '#{session.id}'.\") if @debug\n @ob.delete(session)\n @sessions.delete(idhash)\n end\n \n #Clean database weak references from the tables-module.\n @db.clean\n \n #Clean the object-handler.\n @ob.clean_all\n \n #Call various user-connected methods.\n @events.call(:on_clean) if @events\n end", "def close_idle_sockets\n return if closed?\n return unless max_idle_time\n\n @lock.synchronize do\n i = 0\n while i < @available_connections.length\n connection = @available_connections[i]\n if last_checkin = connection.last_checkin\n if (Time.now - last_checkin) > max_idle_time\n connection.disconnect!(reason: :idle)\n @available_connections.delete_at(i)\n @populate_semaphore.signal\n next\n end\n end\n i += 1\n end\n end\n end", "def sessions\n SockJS.debug \"Refreshing sessions\"\n\n if @sessions\n @sessions.delete_if do |_, session|\n unless session.alive?\n SockJS.debug \"Removing closed session #{_}\"\n end\n\n !session.alive?\n end\n else\n @sessions = {}\n end\n end", "def clear_sessions\n session.keys.each do |key|\n session.delete(key) if key =~ /ranmemory_/\n end\n end", "def sessions_reset\n self.sessions_flush\n @sessions = {}\n end", "def clear_sessions \n sessions.each do |key, session|\n logger.info \"Closing: #{key}\"\n session.close\n end \n sessions.clear \n reset_password\n end", "def clear_upstream_sessions\n upstream_sessions.delete_all\n end", "def close_expired_connections\n # By default the keep alive timeout is 15 sec, which is the HTTP 1.1\n # standard. To change the value, use keep_alive_timeout= method\n # do nothing, handled by HTTPClient\n end", "def close_expired_connections\n # By default the keep alive timeout is 15 sec, which is the HTTP 1.1\n # standard. To change the value, use keep_alive_timeout= method\n # do nothing, handled by HTTPClient\n end", "def cleanup\n Authie.notify(:cleanup) do\n # Invalidate transient sessions that haven't been used\n active.where('expires_at IS NULL AND last_activity_at < ?',\n Authie.config.session_inactivity_timeout.ago).each(&:invalidate!)\n # Invalidate persistent sessions that have expired\n active.where('expires_at IS NOT NULL AND expires_at < ?', Time.now).each(&:invalidate!)\n end\n true\n end", "def clean_expired!\n sessions.remove( { :expire => { '$lt' => Time.now } } )\n end", "def garbage_collect\n $redis.keys(\"#{remote_ip}.*\").each do |key|\n $redis.del(key) unless key =~ /#{session}/ || key =~ /hidden/\n end\n end", "def invalidate_all_sessions!\n update(session_token: SecureRandom.hex)\n end", "def clear_session\n session[:timeout] = nil\n session[:uid] = nil\n end", "def clear_session\n session[:timeout] = nil\n session[:uid] = nil\n end", "def limit_session_time\n set_session_time(Settings.gitlab['unauthenticated_session_expire_delay'])\n end", "def purge_old_requests(seconds = 60)\n @requests.delete_if {|request_time| request_time < Time.now - seconds}\n end", "def clear_session\n Mack::SessionStore.expire_all\n end", "def remove_old_sessions\n candidates = find_old_sessions\n candidates.destroy_all\nend", "def close_stale_pipes\n return if @ttl <= 0\n now = Time.now\n return unless now - @last_stale_cleanup_cycle >= @ttl\n @logger.info(\"Starting stale pipes cleanup cycle\", :pipes => @pipes)\n inactive_pipes = @pipes.select { |command, pipe| not pipe.active }\n @logger.debug(\"%d stale pipes found\" % inactive_pipes.count, :inactive_pipes => inactive_pipes)\n inactive_pipes.each do |command, pipe|\n drop_pipe(command)\n end\n # mark all pipes as inactive, a call to write will mark them as active again\n @pipes.each { |command, pipe| pipe.active = false }\n @last_stale_cleanup_cycle = now\n end", "def cull_idle_sockets\n\t\tself.log.debug \"Culling idle sockets.\"\n\n\t\tearliest = Time.now - self.class.idle_timeout\n\n\t\tself.connection_times.each do |sender_id, times|\n\t\t\ttimes.each do |conn_id, lastframe|\n\t\t\t\tnext unless earliest > lastframe\n\n\t\t\t\tself.log.warn \"Timing out connection %s:%d: last seen %0.3fs ago.\" %\n\t\t\t\t\t[ sender_id, conn_id, Time.now - lastframe ]\n\n\t\t\t\t# Make a CLOSE frame\n\t\t\t\tframe = Mongrel2::WebSocket::Frame.close\n\t\t\t\tframe.set_status( CLOSE_EXCEPTION )\n\n\t\t\t\t# Use the connection directly so we can send a frame and close the\n\t\t\t\t# connection\n\t\t\t\tself.conn.send( sender_id, conn_id, frame.to_s )\n\t\t\t\tself.conn.send_close( sender_id, conn_id )\n\t\t\tend\n\t\tend\n\tend", "def empty_connection_pools!; end", "def reset_timer\n @conn_expires_at = Time.now + @keep_alive_timeout if @persistent\n end", "def reset_session_expiry\n ::ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS.update(:session_expires => 1.hour.from_now)\n end", "def session_reset_timeout! \n session[:expire_at] = Time.now + MAX_SESSION_TIME.seconds\n end", "def collect_garbage(options = {})\n config = load_config(options)\n last_key = eliminate_unwanted_sessions(config)\n while !last_key.empty?\n last_key = eliminate_unwanted_sessions(config, last_key)\n end\n end", "def drain_pool\n @pool.each { |worker| worker.kill }\n @pool.clear\n end", "def evict\n # Peek at the first connection to see if it is still fresh. If so, we can\n # return right away without needing to use `synchronize`.\n first_expires_at, first_conn = connections.first\n return if (first_expires_at.nil? || fresh?(first_expires_at)) && !closed?(first_conn)\n\n connections.synchronize do\n fresh, stale = connections.partition do |expires_at, conn|\n fresh?(expires_at) && !closed?(conn)\n end\n connections.replace(fresh)\n stale.each { |_, conn| closer.call(conn) }\n end\n end", "def clear_active_connections!\n self.ensure_ready\n self.connection_pool_list.each(&:release_connection)\n end", "def cleanup\n @session_id = nil\n end", "def prune_pool\n if Garcon.monotonic_time - @gc_interval >= @last_gc_time\n @pool.delete_if { |worker| worker.dead? }\n # send :stop for each thread over idletime\n @pool.select { |worker| @idletime != 0 &&\n Garcon.monotonic_time - @idletime > worker.last_activity\n }.each { @queue << :stop }\n @last_gc_time = Garcon.monotonic_time\n end\n end", "def clear_session\n session[:timeout] = nil\n session[:user_name] = nil\n session[:real_user_name] = nil\n session[:job_id] = nil\n session[:auth_type] = nil\n cookies.delete :auth_token\n reset_session\n end", "def reset_sessions\n reset_session_expired_at\n @application_session.update_attributes(\n :expired_at=>session_expired_at\n )\n end", "def http_reset\n @http = nil\n end", "def reset\n @redis_sessions = nil\n end", "def cleanup(session = false)\n # if session\n # select { |cookie| cookie.session? || cookie.expired? }\n # else\n # select(&:expired?)\n # end.each { |cookie|\n # delete(cookie)\n # }\n # # subclasses can optionally remove over-the-limit cookies.\n # self\n end", "def clear_reloadable_connections!\n self.ensure_ready\n self.connection_pool_list.each(&:clear_reloadable_connections!)\n end", "def stop_polling!\n @pool.each { |_, t| Thread.kill(t) }\n @pool = {}\n end", "def renew_session\n @authenticator.kill_session\n @authenticator.get_session\n end", "def connection_pool_idle_timeout\n super\n end", "def invalidate_session\n @sequence = 0\n @session_id = nil\n end", "def session_timeout\n #return if Rails.env.test?\n #check session last_seen\n if session[:last_seen] < SESSION_TIMEOUT_MINUTES.minutes.ago\n reset_session\n else\n session[:last_seen] = Time.now.utc\n end unless session[:last_seen].nil?\n #check when session created\n if Session.first.created_at < SESSION_WIPEOUT_HOURS.hours.ago\n Session.sweep\n end unless Session.first.nil?\n end", "def expire\n if in_use?\n if @owner != Thread.current\n raise ActiveRecordError, \"Cannot expire connection, \" \\\n \"it is owned by a different thread: #{@owner}. \" \\\n \"Current thread: #{Thread.current}.\"\n end\n\n @idle_since = Concurrent.monotonic_time\n @owner = nil\n else\n raise ActiveRecordError, \"Cannot expire connection, it is not currently leased.\"\n end\n end", "def purge_old_tokens\n auth_tokens.desc(:last_used_at).offset(20).destroy_all\n end", "def clear_session\n session.clear\n end", "def on_http_session_destruct(*args)\n @hayabusa.log_puts(\"HTTP-connection destruction - checking if no connections are active any more.\")\n \n stop = false\n httpserv = @hayabusa.httpserv\n \n if !httpserv or !httpserv.http_sessions or httpserv.http_sessions.empty?\n stop = true\n end\n \n if stop\n @hayabusa.log_puts(\"Stopping server because no active connections.\")\n @hayabusa.stop\n end\n end", "def evict\n return if @cache.empty?\n @semaphor.synchronize(){|| \n keys = @cache.keys\n least_recently_used = keys.first\n @cache.each_pair do |url, response|\n least_recently_used = url if @cache[least_recently_used].timestamp > @cache[url].timestamp\n end\n @current_load = @current_load - @cache[least_recently_used].response.bytesize()\n @cache.delete(least_recently_used)\n }\n end", "def clean!\n HotTub.logger.info \"[HotTub] Cleaning pool #{@name}!\" if HotTub.logger\n @mutex.synchronize do\n begin\n @_pool.each do |clnt|\n clean_client(clnt)\n end\n ensure\n @cond.signal\n end\n end\n nil\n end", "def refresh_timeout\n # a json session cookie will serialize time as strings, make the conversion explicit so that tests too see strings\n # (see config.action_dispatch.cookies_serializer)\n session[:timeout] = Settings.session_timeout.seconds.from_now.to_s\n session[:has_warned] = false\n end", "def kill\n\t\tframework.sessions.deregister(self)\n\tend", "def kill\n\t\tframework.sessions.deregister(self)\n\tend", "def refresh_session\n update_session(30.days.from_now)\n update_last_session\n end", "def cleanup\n logger.info(\"Cleaning up expired sessions...\", :cleanup, { state: :starting })\n begin\n count = CacheStore.cleanup(ttl: SESSION_TTL)\n logger.info(\"Deleted #{count} expired sessions.\", :cleanup, { state: :success, count: count })\n rescue StandardError => e\n logger.info(\"Failed to clean up expired sessions.\", :cleanup, { state: :error, message: e.message })\n\n # Reraise (calling `raise` without arguments will reraise last error)\n raise\n end\n end", "def clear_reloadable_connections!\n @reserved_connections.each do |name, conn|\n checkin conn\n end\n @reserved_connections = {}\n @connections.each do |conn|\n conn.disconnect! if conn.requires_reloading?\n end\n @connections = []\n end", "def kill_session\n session[:session] = false\n session[:sessionToken] = \"\"\n session[:sessionMember] = \"\"\n session[:sessionMV] = \"\"\n session[:sessionOffer] = \"\"\n end", "def expire\n if in_use?\n if @owner != ActiveSupport::IsolatedExecutionState.context\n raise ActiveRecordError, \"Cannot expire connection, \" \\\n \"it is owned by a different thread: #{@owner}. \" \\\n \"Current thread: #{ActiveSupport::IsolatedExecutionState.context}.\"\n end\n\n @idle_since = Process.clock_gettime(Process::CLOCK_MONOTONIC)\n @owner = nil\n else\n raise ActiveRecordError, \"Cannot expire connection, it is not currently leased.\"\n end\n end", "def reap\n stale_connections = @connections.select do |conn|\n conn.in_use? && !conn.owner.alive?\n end\n\n stale_connections.each do |conn|\n if conn.active?\n conn.reset!\n checkin conn\n else\n remove conn\n end\n end\n end", "def refresh_session\n self.with_lock(timeout: 60, retries: 120, retry_sleep: 0.5) do\n if self.token_expires_at <= 10.seconds.from_now\n begin\n session.refresh_tokens\n self.refresh_token = session.refresh_token\n self.access_token = session.access_token\n self.token_expires_at = session.expires_at\n self.save\n rescue ExactOnlineLib::Api::Sdk::AuthError\n @session = nil\n end\n else\n @session = nil\n end\n @client = nil\n end\n end", "def throw_away!\n pool.remove self\n disconnect!\n end", "def start_timer\n Thread.new do\n loop {\n sleep @session_ttl\n reap_expired_sessions\n } \n end \n end", "def flush_expired\n if gc_last && gc_time && gc_last+gc_time <= Time.now\n flush_expired!\n end\n end", "def cleanup\n\t\tcurrent_time = current_date_time\n\n\t\tputs current_time\n\n\t\t# delete all sessions that are older than 30 minutes\n\t\tActiveRecord::Base.connection.execute(\"DELETE FROM sessions WHERE updated_at < '#{current_time}'\")\n\tend", "def clear!\n visit(url)\n reset_session!\n end", "def clear_session\n\t\tsession.clear\n\tend", "def check_idle_servers!\n\t\tmust_not_be_in_synchronize_block\n\t\[email protected] do\n\t\t\t@next_cleaning_time = Time.now - 60 * 60\n\t\t\[email protected]\n\t\tend\n\tend", "def eliminate_unwanted_sessions(config, last_key = nil)\n scan_result = scan(config, last_key)\n batch_delete(config, scan_result[:items])\n scan_result[:last_evaluated_key] || {}\n end", "def refresh_session\n self.update_attributes(session_expires_in: 30.days.from_now)\n end", "def reset_session!\n raw_session.clear\n end", "def force_close_all()\n ret = []\n @sessions.each_key do |key|\n ret << format_udp_info( @sessions[key] )\n @sessions.delete key\n end\n ret\n end", "def check_out\n @mutex.synchronize do\n begin\n return new_client unless connection_pool_enabled?\n\n client = @connection_pool.pop(true)\n\n client.ping if @options[:reconnect]\n\n client\n rescue ThreadError\n if @created_connections < max_pool_size\n client = new_client\n @created_connections += 1\n return client\n end\n\n MysqlFramework.logger.error { \"[#{self.class}] - Database connection pool depleted.\" }\n\n raise 'Database connection pool depleted.'\n end\n end\n end", "def set_keep_alive; end", "def reset_session!\n request.reset_session\n end", "def reset_session!\n request.reset_session\n end", "def reap\n stale_connections = synchronize do\n @connections.select do |conn|\n conn.in_use? && !conn.owner.alive?\n end\n end\n\n stale_connections.each do |conn|\n synchronize do\n if conn.active?\n conn.reset!\n checkin conn\n else\n remove conn\n end\n end\n end\n end", "def refresh_timeout\n # a json session cookie will serialize time as strings, make the conversion explicit so that tests too see strings\n # (see config.action_dispatch.cookies_serializer)\n session[:timeout] = current_user.class::SESSION_TIMEOUT.seconds.from_now.to_s\n session[:has_warned] = false\n end", "def reset\n @executed_requests = Hash.new\n @links = Hash.new\n @properties = Hash.new\n @status = :stale\n self\n end", "def clear()\n @mutex.synchronize {\n each_object &destroy_block\n @idle_list = []\n @active_list = {}\n }\n end", "def connection_pool_maximum_reuse\n super\n end", "def recycle()\n @@pool_mutex.synchronize do\n if (@@pool_size < MAX_POOL_SIZE)\n clear_for_recycle()\n @next = @@pool;\n @@pool = this\n @@message_pool_size += 1\n end\n end\n end", "def clear_reloadable_connections!\n if @@allow_concurrency\n # With concurrent connections @@active_connections is\n # a hash keyed by thread id.\n @@active_connections.each do |thread_id, conns|\n conns.each do |name, conn|\n if conn.requires_reloading?\n conn.disconnect!\n @@active_connections[thread_id].delete(name)\n end\n end\n end\n else\n @@active_connections.each do |name, conn|\n if conn.requires_reloading?\n conn.disconnect!\n @@active_connections.delete(name)\n end\n end\n end\n end", "def purge_expired_workers\n @services.purge_expired_workers\n end", "def reset!\n @sess_hash = {}\n end", "def close_expired_connections\n raise NotImplementedError\n end", "def disconnect\n Threaded.sessions.values.each(&:disconnect)\n end", "def flush_session_channels\n\t\tsession_channels.each_pair { |sid, session|\n\t\t\tsession.close\n\t\t}\n\n\t\tsession_channels = Hash.new\n\tend", "def refresh_timeout\n session[:timeout] = current_user.class::SESSION_TIMEOUT.seconds.from_now\n end", "def flush_expired!\n Dir[ File.join( store, \"*.cache\" ) ].each do |f|\n if (File.mtime(f)+timeout) <= Time.now\n File.delete(f)\n end\n end\n @gc_last = Time.now\n end", "def reset_session_counts\n self.session_count = 0\n end", "def clear_session\n @session = @login_info = nil\n end", "def stop_managed_sessions\n @sessions.each {|session| session.stop}\n end", "def clear_expired(request)\n entries_for(request)\n .where {|t| t.created_at < Time.now - ttl }\n .delete\n end", "def disconnect\n return unless pool\n pool.map(&:close)\n @pool = nil\n end", "def clear_reloadable_connections!\n @reserved_connections.clear\n @connections.each do |conn|\n checkin conn\n conn.disconnect! if conn.requires_reloading?\n end\n @connections.delete_if do |conn|\n conn.requires_reloading?\n end\n @available.clear\n @connections.each do |conn|\n @available.add conn\n end\n end", "def httpdigest_logout\n session.delete(SESSION_NONCE)\n session.delete(SESSION_OPAQUE)\n end", "def set_connection_pool_idle_timeout(opts)\n opts = check_params(opts,[:timeouts])\n super(opts)\n end" ]
[ "0.6963261", "0.6915655", "0.690415", "0.63019747", "0.63019747", "0.6284289", "0.62255615", "0.62031925", "0.6200842", "0.61912626", "0.6179047", "0.6148755", "0.6125538", "0.6125538", "0.6120973", "0.6056583", "0.6046601", "0.60017264", "0.5986309", "0.5986309", "0.5971708", "0.5951524", "0.59416217", "0.5923797", "0.5917872", "0.5837675", "0.5824591", "0.5823019", "0.582224", "0.5810368", "0.5808967", "0.58008593", "0.5797038", "0.57635957", "0.5675223", "0.5620433", "0.5620143", "0.56026125", "0.5577459", "0.5565833", "0.55569726", "0.5549044", "0.55436766", "0.55372715", "0.55215424", "0.55204344", "0.5519949", "0.55069625", "0.5503461", "0.5491903", "0.5490318", "0.5489879", "0.5488783", "0.5463255", "0.546089", "0.5458726", "0.545539", "0.54416287", "0.54415923", "0.54381734", "0.54326665", "0.5431194", "0.5417557", "0.5415359", "0.54054946", "0.53886217", "0.538666", "0.5378373", "0.5362474", "0.53619546", "0.53549033", "0.53428245", "0.53403157", "0.5338723", "0.53365594", "0.53328526", "0.53272957", "0.53272957", "0.5324214", "0.53223735", "0.53160805", "0.5302031", "0.52980644", "0.52956986", "0.5292612", "0.528968", "0.52754056", "0.52716297", "0.52690816", "0.52682024", "0.52636796", "0.52620226", "0.525818", "0.52580976", "0.52561164", "0.52440786", "0.5242563", "0.52325875", "0.5231386", "0.5220665" ]
0.528617
86
Closes and removes removes all sessions from the pool. If empty! is called while there are outstanding requests they may get checked back into the pool, leaving the pool in a nonempty state.
def empty! @pool_mutex.synchronize do @pool.each(&:finish) @pool = [] end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cleanup_sessions\n @mutex.synchronize { @sessions.garbage_collect }\n end", "def clear_session\n Mack::SessionStore.expire_all\n end", "def clear_sessions \n sessions.each do |key, session|\n logger.info \"Closing: #{key}\"\n session.close\n end \n sessions.clear \n reset_password\n end", "def cleanup\n @sessions.each_value do |session|\n session.close if session.expired?\n end\n rescue => e\n log.error(\"Expired session cleanup failed: #{e}\")\n end", "def clear_active_connections!\n self.ensure_ready\n self.connection_pool_list.each(&:release_connection)\n end", "def clean!\n HotTub.logger.info \"[HotTub] Cleaning pool #{@name}!\" if HotTub.logger\n @mutex.synchronize do\n begin\n @_pool.each do |clnt|\n clean_client(clnt)\n end\n ensure\n @cond.signal\n end\n end\n nil\n end", "def drain_pool\n @pool.each { |worker| worker.kill }\n @pool.clear\n end", "def empty_connection_pools!; end", "def clear_sessions\n session.keys.each do |key|\n session.delete(key) if key =~ /ranmemory_/\n end\n end", "def clean_sessions\n self.log_puts(\"Cleaning sessions on appserver.\") if @debug\n \n #Clean up various inactive sessions.\n session_not_ids = []\n time_check = Time.now.to_i - 300\n @sessions.delete_if do |session_hash, session_data|\n session_data[:dbobj].flush\n \n if session_data[:dbobj].date_lastused.to_i > time_check\n session_not_ids << session_data[:dbobj].id\n false\n else\n true\n end\n end\n \n self.log_puts(\"Delete sessions...\") if @debug\n @ob.list(:Session, {\"id_not\" => session_not_ids, \"date_lastused_below\" => (Time.now - 5356800)}) do |session|\n idhash = session[:idhash]\n self.log_puts(\"Deleting session: '#{session.id}'.\") if @debug\n @ob.delete(session)\n @sessions.delete(idhash)\n end\n \n #Clean database weak references from the tables-module.\n @db.clean\n \n #Clean the object-handler.\n @ob.clean_all\n \n #Call various user-connected methods.\n @events.call(:on_clean) if @events\n end", "def clear()\n @mutex.synchronize {\n each_object &destroy_block\n @idle_list = []\n @active_list = {}\n }\n end", "def clear_session\n session.clear\n end", "def empty_connection_pools!\n Seahorse::Client::NetHttp::ConnectionPool.pools.each do |pool|\n pool.empty!\n end\n end", "def close\n @pool.each do |s|\n #@pool.remove(s)\n s.close\n #@pool.remove(s)\n end\n end", "def clear_upstream_sessions\n upstream_sessions.delete_all\n end", "def clean!\n @pool_mutex.synchronize { _clean }\n end", "def clear\n connections.synchronize do\n connections.map(&:last).each(&closer)\n connections.clear\n end\n end", "def dispose\n return if @connection_pool.nil?\n\n until @connection_pool.empty?\n conn = @connection_pool.pop(true)\n conn&.close\n end\n\n @connection_pool = nil\n end", "def clear_session\n\t\tsession.clear\n\tend", "def clear_all_connections!\n disconnect_read_pool!\n @original_handler.clear_all_connections!\n end", "def disconnect\n return unless pool\n pool.map(&:close)\n @pool = nil\n end", "def sessions\n SockJS.debug \"Refreshing sessions\"\n\n if @sessions\n @sessions.delete_if do |_, session|\n unless session.alive?\n SockJS.debug \"Removing closed session #{_}\"\n end\n\n !session.alive?\n end\n else\n @sessions = {}\n end\n end", "def drain!\n HotTub.logger.info \"[HotTub] Draining pool #{@name}!\" if HotTub.logger\n @mutex.synchronize do\n begin\n while clnt = @_pool.pop\n close_client(clnt)\n end\n ensure\n @_out.clear\n @_pool.clear\n @pid = Process.pid\n @cond.broadcast\n end\n end\n nil\n end", "def clear_session\n @session = @login_info = nil\n end", "def clear\n LOCK.synchronize do\n @queue.each { |_, jes| jes.each(&:close) }\n @queue.clear\n end\n end", "def clear_all\n clear\n clear_stored_requests\n end", "def remove!\n @session.delete(SESSION_KEY) if empty?\n end", "def clear_session\n session[:timeout] = nil\n session[:uid] = nil\n end", "def clear_session\n session[:timeout] = nil\n session[:uid] = nil\n end", "def flush_session_channels\n\t\tsession_channels.each_pair { |sid, session|\n\t\t\tsession.close\n\t\t}\n\n\t\tsession_channels = Hash.new\n\tend", "def sessions_reset\n self.sessions_flush\n @sessions = {}\n end", "def remove\n if empty?\n @session.delete(SESSION_KEY)\n @session.delete(KEPT_KEY)\n end\n end", "def cleanup\n @session_id = nil\n end", "def release()\n fiber = Fiber.current\n if fiber[connection_pool_key]\n @busy_connections.delete(fiber)\n @connections << fiber[connection_pool_key]\n fiber[connection_pool_key] = nil\n end\n end", "def clear(options = nil)\n raise_if_closed!\n\n @lock.synchronize do\n @generation += 1\n\n publish_cmap_event(\n Monitoring::Event::Cmap::PoolCleared.new(@server.address)\n )\n\n unless options && options[:lazy]\n until @available_connections.empty?\n connection = @available_connections.pop\n connection.disconnect!(reason: :stale)\n @populate_semaphore.signal\n end\n end\n end\n\n true\n end", "def destroy\n @session.clear\n end", "def clear_reloadable_connections!\n self.ensure_ready\n self.connection_pool_list.each(&:clear_reloadable_connections!)\n end", "def close\n @pool.close\n end", "def close\n @pool.dispose\n end", "def free\n @pool.shutdown(&:free)\n end", "def destroy\n self.class.delete_all(\"session_id='#{session_id}'\")\n end", "def finalize_session\n session_stores.each { |name, store| store.finalize(self) }\n end", "def clear()\n shutdown()\n @tasks = {}\n _clear()\n end", "def clear\n LOCK.synchronize do\n @queue.each do |_, jobs|\n jobs.each do |job|\n job.close\n @registry.delete(job.id)\n end\n end\n\n @queue.clear\n end\n end", "def close\n ensure_session!\n\n session.release!\n end", "def close\n @sockets.each do |sock|\n sock.close\n end\n @host = @port = nil\n @sockets.clear\n @checked_out.clear\n end", "def close\n @mutex.lock do\n unless @connection_pool.nil? or @connection_pool.is_closed\n @connection_pool.close\n @connection_pool = nil\n end\n end\n end", "def reset\n @redis_sessions = nil\n end", "def cleanup\n Authie.notify(:cleanup) do\n # Invalidate transient sessions that haven't been used\n active.where('expires_at IS NULL AND last_activity_at < ?',\n Authie.config.session_inactivity_timeout.ago).each(&:invalidate!)\n # Invalidate persistent sessions that have expired\n active.where('expires_at IS NOT NULL AND expires_at < ?', Time.now).each(&:invalidate!)\n end\n true\n end", "def clear_active_connections!\n clear_cache!(@@active_connections) do |name, conn|\n conn.disconnect!\n end\n end", "def clear\n\t\tmust_be_in_synchronize_block\n\t\[email protected]_value do |server|\n\t\t\tif server.started?\n\t\t\t\tserver.stop\n\t\t\tend\n\t\tend\n\t\[email protected]\n\t\t@next_cleaning_time = nil\n\tend", "def dispose\n begin\n @lock.synchronize do\n while instance = @available.pop\n instance.close\n end\n\n @condition.wait(@lock) if @used.size > 0\n end\n end until empty?\n end", "def clear_query_caches_for_current_thread\n connection_handler.each_connection_pool do |pool|\n pool.connection.clear_query_cache if pool.active_connection?\n end\n end", "def clear_any_logged_in_session\n if logged_in?\n session[:user] = nil\n session[:user_id] = nil\n current_agent = nil\n end\n end", "def close\n return unless @session\n update\n @session = nil\n end", "def clear_threads thread_pool, clean_array = true\n thread_pool.each{ |thread| thread.exit }\n thread_pool.clear if clean_array\nend", "def clear_session\n\t\tsession[:email] = nil \n\t\tsession[:player_id] = nil\n\t\tsession[:admin] = nil\n\t\tsession[:login_time] = nil \n\tend", "def clear!\n visit(url)\n reset_session!\n end", "def close\n pool.checkin self\n end", "def close\n pool.checkin self\n end", "def garbage_collect\n $redis.keys(\"#{remote_ip}.*\").each do |key|\n $redis.del(key) unless key =~ /#{session}/ || key =~ /hidden/\n end\n end", "def delete_object_pool\n object_pool.delete\n end", "def clear_session\n session[:timeout] = nil\n session[:user_name] = nil\n session[:real_user_name] = nil\n session[:job_id] = nil\n session[:auth_type] = nil\n cookies.delete :auth_token\n reset_session\n end", "def clear\n @sem.synchronize do\n @store.close!\n @size = 0\n end\n end", "def close_session\n @session.close unless @session.nil?\n @session = nil\n end", "def close_idle_sockets\n return if closed?\n return unless max_idle_time\n\n @lock.synchronize do\n i = 0\n while i < @available_connections.length\n connection = @available_connections[i]\n if last_checkin = connection.last_checkin\n if (Time.now - last_checkin) > max_idle_time\n connection.disconnect!(reason: :idle)\n @available_connections.delete_at(i)\n @populate_semaphore.signal\n next\n end\n end\n i += 1\n end\n end\n end", "def clear_pending\n @async_requests.clear\n nil\n end", "def close\n # by default do nothing - close any cached connections\n end", "def close\n @repo.request_http(:post, path('session/close'),\n :expected_status_code => 204)\n end", "def reap_expired_sessions\n @timestamps.each do |session_id,stamp|\n delete_session(session_id) if (stamp + @session_ttl) < Time.now \n end\n GC.start\n end", "def clear!\n @handlers = {}\n @environments = {}\n @requests = []\n end", "def clear_reloadable_connections!\n synchronize do\n @reserved_connections.clear\n @connections.each do |conn|\n checkin conn\n end\n\n @connections.delete_if(&:finished?)\n\n @available.clear\n @connections.each do |conn|\n @available.add conn\n end\n end\n end", "def shutdown!\n @pool.each(&:shutdown!)\n end", "def disconnect\n Threaded.sessions.values.each(&:disconnect)\n end", "def reap!\n HotTub.logger.info \"[HotTub] Reaping pool #{@name}!\" if HotTub.log_trace?\n while !@shutdown\n reaped = nil\n @mutex.synchronize do\n begin\n if _reap?\n if _dead_clients?\n reaped = @_out.select { |clnt, thrd| !thrd.alive? }.keys\n @_out.delete_if { |k,v| reaped.include? k }\n else\n reaped = [@_pool.shift]\n end\n else\n reaped = nil\n end\n ensure\n @cond.signal\n end\n end\n if reaped\n reaped.each do |clnt|\n close_client(clnt)\n end\n else\n break\n end\n end\n nil\n end", "def reset_session!\n raw_session.clear\n end", "def shutdown\n @pool.shutdown do |connection|\n connection.quit\n end\n end", "def shutdown\n @pool.shutdown do |connection|\n connection.quit\n end\n end", "def logout!\n session.clear\n end", "def logout\n close_session\n end", "def cleanup(session = false)\n # if session\n # select { |cookie| cookie.session? || cookie.expired? }\n # else\n # select(&:expired?)\n # end.each { |cookie|\n # delete(cookie)\n # }\n # # subclasses can optionally remove over-the-limit cookies.\n # self\n end", "def remove_old_sessions\n candidates = find_old_sessions\n candidates.destroy_all\nend", "def ensure_cleanup_mongoid_session(&block)\n block.call\n ensure\n Mongoid::IdentityMap.clear\n Mongoid.disconnect_sessions\n end", "def clear!\n unless empty?\n if SpiceRub::Native.kclear\n self.loaded.each { |kernel| kernel.mark_unloaded }\n @pool = []\n return true\n end\n end\n false\n end", "def cleanup_session\n return unless request.get?\n return if (params[:controller] == 'search') && (params[:action] == 'image')\n session_keys.each do |key|\n value = session[key]\n session.delete(key) if value.try(:empty?) || value.nil?\n end\n end", "def on_http_session_destruct(*args)\n @hayabusa.log_puts(\"HTTP-connection destruction - checking if no connections are active any more.\")\n \n stop = false\n httpserv = @hayabusa.httpserv\n \n if !httpserv or !httpserv.http_sessions or httpserv.http_sessions.empty?\n stop = true\n end\n \n if stop\n @hayabusa.log_puts(\"Stopping server because no active connections.\")\n @hayabusa.stop\n end\n end", "def shutdown\n @thread_pool.shutdown\n end", "def clear\n @genePool.clear\n @size = 0\n end", "def clear_session\n Rails.logger.debug('SSO: ApplicationController#clear_session', sso_logging_info)\n\n @session_object&.destroy\n @current_user&.destroy\n @session_object = nil\n @current_user = nil\n end", "def clear_reloadable_connections!\n @reserved_connections.clear\n @connections.each do |conn|\n checkin conn\n conn.disconnect! if conn.requires_reloading?\n end\n @connections.delete_if do |conn|\n conn.requires_reloading?\n end\n @available.clear\n @connections.each do |conn|\n @available.add conn\n end\n end", "def close_all\n @connections.close_all\n end", "def session_end!(destroy=true)\n if destroy\n session.clear\n else\n session['sinatra.session'] = false\n end\n end", "def close\n inactive!\n close_connections\n end", "def clear_reloadable_connections!\n @reserved_connections.each do |name, conn|\n checkin conn\n end\n @reserved_connections = {}\n @connections.each do |conn|\n conn.disconnect! if conn.requires_reloading?\n end\n @connections = []\n end", "def close\n @mutex.synchronize do\n @thread.kill\n @store.each_value do |value|\n sess, _ = value\n sess.close(@context)\n end\n end\n end", "def clear_reloadable_connections!\n synchronize do\n @reserved_connections.clear\n @connections.each do |conn|\n checkin conn\n conn.disconnect! if conn.requires_reloading?\n end\n @connections.delete_if do |conn|\n conn.requires_reloading?\n end\n @available.clear\n @connections.each do |conn|\n @available.add conn\n end\n end\n end", "def logout!\n session.clear\n end", "def logout!\n session.clear\n end", "def clear_cache *keys\n keys.size == 0 ?\n cache_pool.clear :\n keys.each { |key| cache_pool.delete key }\n end", "def clear_session\n rails_controller_instance.reset_session\n end" ]
[ "0.7035583", "0.66259634", "0.6596378", "0.6568518", "0.65473664", "0.6536656", "0.6520357", "0.6503517", "0.64680356", "0.6449909", "0.64278233", "0.62706995", "0.62659276", "0.6264156", "0.6254002", "0.6252899", "0.62417734", "0.62311023", "0.6224066", "0.62177527", "0.612151", "0.60832864", "0.6030122", "0.59958375", "0.5995212", "0.5975493", "0.5974534", "0.5963245", "0.5963245", "0.5941745", "0.5940889", "0.59358746", "0.5935731", "0.58807194", "0.5850258", "0.58428234", "0.58348346", "0.58107936", "0.5787774", "0.57649297", "0.5760442", "0.5738512", "0.5734228", "0.5727026", "0.57063365", "0.57061976", "0.57041085", "0.56919026", "0.56913334", "0.56767565", "0.5673691", "0.5666328", "0.56651926", "0.5642099", "0.56381", "0.5635152", "0.56155455", "0.560235", "0.5589769", "0.5589769", "0.5589187", "0.5571353", "0.55699086", "0.55639434", "0.5554625", "0.55367625", "0.55242723", "0.5506271", "0.5485644", "0.54849875", "0.54793084", "0.5462607", "0.5455376", "0.5454465", "0.5452601", "0.5449469", "0.544312", "0.544312", "0.54383165", "0.5426741", "0.54108405", "0.54069495", "0.54024684", "0.5398518", "0.53888714", "0.5381947", "0.53813493", "0.53757215", "0.53729737", "0.536585", "0.53639567", "0.53622603", "0.53609896", "0.53535485", "0.5352509", "0.5341285", "0.5330911", "0.5330911", "0.5326095", "0.53209203" ]
0.69292384
1
Write a method named include? that takes an Array and a search value as arguments. This method should return true if the search value is in the array, false if it is not. You may not use the Arrayinclude? method in your solution.
def include?(arr, search) arr.each do |element| if element == search return true end end false end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def include?(array, search)\n array.each do |value|\n return true if value == search\n end\n false\nend", "def include?(arr, search)\n arr.any? { |i| i == search }\nend", "def include?(array, search_value)\n array.any? { |element| element == search_value }\nend", "def include?(arr, search)\n arr.any? { |elem| elem == search }\nend", "def include? (array, search)\n array.each { |item| return true if search == item }\n return false\nend", "def include?(array, search_value)\n array.select { |value| value == search_value }.empty? ? false : true\nend", "def include?(arr, search)\n result = false\n arr.each { |num| result = true if num == search }\n result\nend", "def include?(arr, search_value)\n arr.each do |num|\n if num == search_value\n return true\n end\n end\n false\nend", "def include?(arr, search_value)\n new_arr = arr.select { |element| element == search_value}\n !new_arr.empty?\nend", "def include? array, item\n array.include?(item)\nend", "def include?(array, search_value)\n !array.select{|element| element == search_value}.empty?\nend", "def include?(array, value)\n array.any?(value)\nend", "def include?(array, search_value)\n array.count(search_value) > 0\nend", "def include?(array, search_element)\n array.each do |array_element|\n if array_element == search_element\n return true\n end\n end\n false\nend", "def include?(array, search_element)\n array.each do |array_element|\n if array_element == search_element\n return true\n end\n false\n end\nend", "def include?(array, query)\n array.each do |el|\n return true if el == query\n end\n false\nend", "def include?(array, value)\n array.each do |elem|\n return true if elem == value\n end\n false\nend", "def include?(array, search_value)\n # array.each do |element|\n # return true if element == search_value\n # end\n # false\n array.count(search_value) > 0\nend", "def include?(array, search_value)\n if array.count(search_value) == 1\n return true\n else\n return false\n end\nend", "def include?(array, value)\n array.each { |element| return true if value == element }\n false\nend", "def include?(arr, val)\n arr.any? { |element| element == val }\nend", "def include?(array, value)\n # https://ruby-doc.com/core-2.7.2/Array.html#method-i-find_index\n !!array.find_index(value)\nend", "def include?(arr, search_val)\n # arr.each { |e| return true if e == search_val }\n # false\n arr.count(search_val) > 0\n # or:\n # arr.any? { |i| i == val }\nend", "def include?(array, value)\n !!array.find_index(value)\nend", "def include?(array, value)\n !!array.find_index(value)\nend", "def include?(arr, value)\n includes = false\n arr.each { |n| includes = true if n == value }\n includes\nend", "def include?(list, search)\n return false if list.empty? && search == nil \n list.find { |elem| elem == search } == search ? true : false\nend", "def include?(array, arg)\n boolean_return = false\n array.each {|value| return boolean_return = true if value == arg}\n boolean_return\nend", "def using_include(array, element)\n\tarray.include?(element)\nend", "def include?(arr, search_term)\n arr.reduce(false) { |acc, current| current == search_term ? true : acc }\nend", "def include?(array,search_value)\n included = false\n array.each do |x|\n included = true if x == search_value\n break if x == search_value\n end\n \n included\nend", "def include?(arr, include_item)\n arr.each { |item| return true if item == include_item }\n false\nend", "def include?(array, value)\n array.each do |integer|\n return true if integer == value\n end\n return false\nend", "def array_includes?(array, given_thing)\n answer = false\n\n array.each do |thing|\n if thing == given_thing\n answer = true\n end\n end\n\n return answer\nend", "def include?(arr, value)\n !(arr.select { |element| element == value }).empty?\nend", "def include?(arr, val)\n arr.each { |el| return el == val if el == val }\n false\nend", "def include?(arr, target)\n arr.any?{ |ele| ele == target} ? true : false\nend", "def include?(ary, value)\r\n ary.select{ |obj| obj == value } != []\r\nend", "def include?(array, target)\n matches = array.select { |element| element == target }\n !matches.empty?\nend", "def is_item_in_array(array,item)\n return array.include?(item)\nend", "def include?(array, value)\r\n array.count(value) > 0\r\nend", "def include?(list, search)\n !!list.find_index(search)\nend", "def include?(array, value)\n # method A\n array.any? { |element| element == value }\n \n # method B\n # for item in array\n # return true if item == value\n # end\n \n # false\nend", "def my_include?(array, target)\n return false if array.empty?\n return true if array.first == target\n my_include?(array.drop(1), target)\nend", "def include?(element)\n @ary.include? element\n end", "def includes?(array, target)\n if array.empty?\n false\n elsif array.first == target\n true\n else\n includes?(array.drop(1),target)\n end\nend", "def in_arr? (arr, text, exact)\n\tif exact\n\t\treturn arr.include? text\n\telse\n\t\treturn arr.any?{|s| s.include? text}\n\tend\nend", "def include_array?(array)\n array.any? { |member| array?(member) }\n end", "def include?(*args)\n args.inject(true) {|val, x| val = self.single_include?(x)}\n end", "def check_array(array,target)\n if array.include?(target)\n return true\n else\n return false\n end\nend", "def includ?(array, value)\n\tarray.each do |element|\n\t\tif element == value\n\t\t\treturn true\n\t\tend\n\tend\n\tfalse\nend", "def include?(ary, value)\n !!ary.index(value)\nend", "def include?(arr, num)\n arr.each{ |element| return true if element == num}\n return false\nend", "def include?(arr, number)\n arr.any? { |num| num == number }\nend", "def includes?(array, target)\n return true if array.first == target\n return false if array.empty?\n includes?(array.drop(1), target)\nend", "def includes?(array, target)\n return false if array.empty?\n return true if array[0] == target\n includes?(array.drop(1),target)\nend", "def includes?(array, target)\n return false if array.empty?\n return true if array.first == target\n includes?(array.drop(1), target)\nend", "def contains (array, string)\n# use select method to filter over array\n array.select do |value|\n# use include? to see if the array includes string\n value.include? string\n end\nend", "def includes?(array, target)\n return false if array.empty?\n \n return true if array[0] == target\n\n includes?(array[1..-1], target)\nend", "def includes?(array, target)\n return false if array.empty?\n return true if array.first == target\n includes?(array.drop(1), target)\nend", "def includes?(array, target)\n return false if array.empty?\n return true if array.first == target\n includes?(array[1..-1])\nend", "def include?(array, integer)\r\n array.each do |element|\r\n return true if element == integer\r\n end\r\n\r\nfalse\r\nend", "def include_any?(arr, arr2)\n #good for large sets w/ few matches\n # Set.new(self).intersection(arr).empty?\n arr2.any? {|e| arr.include?(e) }\n end", "def includes?(array, target)\n return false if array.empty?\n\n if array.pop == target\n return true\n else\n includes?(array, target)\n end\nend", "def include?(ary, target)\n !ary.select { |value| value == target }.empty?\nend", "def includes?(array, target)\n return false if array.length <= 0\n return true if array[0] == target\n includes?(array[1..-1], target)\nend", "def includes?(array, target)\n return false if array.empty?\n return true if array.pop == target\n includes?(array, target)\nend", "def exists?(number, array)\n array.include?(number)\nend", "def include?(o)\n @mut.synchronize{@array.include?(o)}\n end", "def item_include?(array, string)\n match = false\n array.each do |el|\n if el == string\n match = true\n end\n end\n match\nend", "def include?(value)\n @values.include? value\n end", "def includes?(array, target)\n \n if array.empty?\n return false\n end\n \n if array[-1] == target\n return true\n else\n return includes?(array[0...-1], target)\n end\n\nend", "def includes?(array, target)\n return true if array[0] == target\n return false if array[0] != target && array.length <= 1\n\n includes?(array.drop(1), target)\nend", "def includes?(array, target)\n return false if array.empty?\n dup = array.dup\n return true if dup.pop == target\n includes?(dup, target)\nend", "def include?(ary, number)\n return false if ary.size == 0\n result = ary.detect do |item|\n item == number\n end\n !!(result == number)\nend", "def is_it_in(array, string)\n array.include?(string) ? array.index(string) : nil\nend", "def includes?(array, target)\n array.each do |k, v|\n if k == key\n return true\n elsif v.class.to_s == \"Array\"\n v.each do |inner_array|\n return has_key(inner_array, key)\n end\n else\n return false\n end\n end\n\nend", "def arr_includes_all?(arr, *inc)\n inc.map { |i| arr.include? i }.reduce(&:&)\n end", "def include?(key)\n value.include?(key)\n end", "def include?(value)\n element.include? value\n end", "def includes?(array, target)\n #empty array does not contain object\n return false if array == []\n\n #start with array[3]\n value = array.shift #pluck off\n if value == target\n true #the recursive call is not made\n else\n includes?(array, target)\n end\n\nend", "def include?(val)\n self.each {|item|\n if item.equal?(val)\n return true\n end\n }\n return false\n end", "def item_included?(str, arr)\n arr.each do |item|\n return true if item == str\n end\n false\nend", "def include?(*args_)\n _offset_for_args(args_) ? true : false\n end", "def include?(arg0)\n end", "def include?(other)\n `return self.indexOf(other) == -1 ? Qfalse : Qtrue;`\n end", "def include?(other)\n `return self.indexOf(other) == -1 ? Qfalse : Qtrue;`\n end", "def includes?(data)\n list.includes?(data)\n end", "def include?(num)\n self[num].include?(num)\n end", "def include?(item)\n self.__contains__(item).rubify\n end", "def array_42(z)\n if z.include? 42\n return true\n else\n return false\n end\n\nend", "def include?(list,tst)\n list.each {|itm| return true if itm == tst}\n false\nend", "def include?(something); end", "def contains(value)\n end", "def search(array, value)\n return false if array.length == 0\n\n return search_helper(array, value)\nend", "def is_there_thing?(thing, a)\n a.include?(thing)\nend", "def include?(item)\n end", "def include?(value) \n if value and value != \"\"\n value = value.split(MULTI_VALUES_SEPARATOR) if value.is_a?(String) and value.include?(MULTI_VALUES_SEPARATOR)\n if value.is_a?(Array)\n value.all? { |v| include_bis(v) }\n else\n include_bis(value)\n end\n else\n true\n end\n end", "def include?(searchstring, substring)\n\nend", "def does_list_include?(array, obj)\n array.count(obj) > 0\nend" ]
[ "0.87318766", "0.8564619", "0.85589343", "0.85322535", "0.85317034", "0.839832", "0.8393822", "0.83696365", "0.83552134", "0.83169943", "0.8304971", "0.8293071", "0.8165603", "0.8138183", "0.81308603", "0.81212085", "0.8113191", "0.8107507", "0.8079256", "0.80765855", "0.80452543", "0.80307126", "0.8022038", "0.8012729", "0.8012729", "0.7994109", "0.79534996", "0.792708", "0.7920286", "0.7900389", "0.7866111", "0.7858741", "0.7815027", "0.7776529", "0.7755873", "0.7752689", "0.7669471", "0.7632691", "0.76119816", "0.7564112", "0.75545734", "0.7525034", "0.75001824", "0.74636906", "0.73554575", "0.73342276", "0.7320322", "0.7304179", "0.72955567", "0.72885835", "0.7284972", "0.7276525", "0.7269392", "0.7259288", "0.72491753", "0.72365534", "0.7216352", "0.7212918", "0.7198345", "0.7192325", "0.7183454", "0.7175966", "0.71652853", "0.71539897", "0.71411306", "0.70832044", "0.70638597", "0.7038321", "0.70137733", "0.7006132", "0.69977814", "0.69937545", "0.69827527", "0.69607204", "0.6956051", "0.6907052", "0.68531895", "0.68442464", "0.6832791", "0.6830471", "0.6814767", "0.6792787", "0.679076", "0.67806315", "0.67800474", "0.6768611", "0.6768611", "0.6759278", "0.67486", "0.6733938", "0.6719272", "0.67124474", "0.6649265", "0.6647385", "0.66248524", "0.66239536", "0.65816283", "0.65739655", "0.6541068", "0.65349746" ]
0.84378207
5
Write a method that computes the difference between the square of the sum of the first n positive integers and the sum of the squares of the first n positive integers. Examples:
def sum_square_difference(n) square_of_sums = (1..n).inject(:+) ** 2 sum_of_squares = (1..n).inject {|sum, num| sum + (num ** 2)} square_of_sums - sum_of_squares end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sum_square_difference(n)\n integers = (1..n).to_a\n\n square_of_sum = integers.sum ** 2\n sum_of_squares = integers.map { |n| n ** 2 }.sum\n\n square_of_sum - sum_of_squares\nend", "def sum_square_difference(n)\n ((1..n).reduce(:+)**2) - (1..n).reduce{ |sum, i| sum + i**2 }\nend", "def sum_square_difference(n)\n n_integers = (1..n).to_a\n square_of_sum = n_integers.inject(:+)**2\n sum_of_squares = n_integers.map {|n|n**2}.inject(:+)\n square_of_sum - sum_of_squares\nend", "def sum_square_difference(n)\n # square_of_sum = (1..n).reduce(:+) ** 2\n # sum_of_squares = (1..n).reduce { |sum, num| sum + num * num }\n # square_of_sum - sum_of_squares\n # (1..n).reduce(:+)**2 - (1..n).reduce { |sum, num| sum + num * num }\n\n (1..n).sum**2 - (1..n).sum { |num| num**2 }\nend", "def difference_between_sum_sq_and_sq_sum(n)\n square_sum(n) - sum_squares(n)\nend", "def sum_square_difference(n)\n \n sum = 0 \n for i in 0..n\n sum += i\n end\n \n sq_sum = 0\n for i in 0..n\n sq_sum += (i**2)\n end \n \n (sum*sum) - sq_sum\nend", "def sum_square_difference(n)\n square_of_sum = ((1..n).sum) ** 2\n sum_of_square = (1..n).map{|i| i * i}.sum\n p difference = square_of_sum - sum_of_square\nend", "def sum_square_diff(n)\r\n sq_of_sum = (1..n).to_a.sum ** 2\r\n sum_of_sq = (1..n).to_a.map{ |num| num *= num }.sum\r\n (sq_of_sum - sum_of_sq).abs\r\nend", "def sum_square_difference(n)\n sum = 0\n sums_squared = 0\n 1.upto(n) do |num|\n sum += num\n sums_squared += num**2\n end\n sum**2 - sums_squared\nend", "def sum_sq_diff(n)\n nums_in_range = (1..n)\n # square_sums = nums_in_range.sum ** 2\n square_sums = nums_in_range.sum.pow(2)\n sums_square = nums_in_range.map { |n| n ** 2 }.sum\n square_sums - sums_square\nend", "def sum_square_difference(n)\r\n square_total = 0\r\n sum_square = 0\r\n 1.upto(n) {|x| square_total += x}\r\n 1.upto(n) {|x| sum_square += (x**2)}\r\n square_sum = square_total**2\r\n square_sum - sum_square\r\nend", "def sum_square_difference(int)\n first_n_ints = (1..int).to_a\n\n sum_1 = first_n_ints.sum\n\n sum_2 = first_n_ints.map{|int| int**2}.sum\n\n (sum_1**2) - sum_2\nend", "def squares_diff(n)\n (1..n).inject(:+)**2 - (1..n).map{|i| i*i}.inject(:+)\nend", "def sum_square_difference(num)\n 1.upto(num).sum**2 - 1.upto(num).reduce(0) { |total, n| total + n**2 }\nend", "def sum_square_difference(num)\n (1..num).sum ** 2 - (1..num).map {|num| num ** 2 }.sum\nend", "def sum_square_difference(num)\n (1..num).inject(:+)**2 - (1..num).map{|x| x**2}.inject(:+)\nend", "def sum_square_difference(num)\n square_of_sum = 1.upto(num).to_a.reduce(:+) ** 2\n sum_of_squares = 1.upto(num).to_a.map{ |n| n ** 2 }.reduce(:+)\n square_of_sum - sum_of_squares\nend", "def diff_squares(num)\r\n sum_of_nums = (1..num).inject { |sum, x| sum + x }\r\n sum_of_sq = (1..num).inject { |sum, x| sum + x**2 }\r\n sum_of_nums**2 - sum_of_sq\r\nend", "def sum_square_difference(num)\n square_of_sum = ((1..num).sum)**2\n sum_of_squares = (1..num).map { |n| n**2}.sum\n square_of_sum - sum_of_squares\nend", "def sum_square_difference(num)\n\n sum_squared = (1..num).to_a.sum ** 2\n\n squares = []\n\n (1..num).each { |n| squares << n ** 2 }\n\n squared_sum = squares.sum\n\n sum_squared - squared_sum\nend", "def sum_square_difference(num)\n sum = sum(num)\n square = square(num)\n p sum - square\nend", "def sum_square_difference(integer)\n (1..integer).reduce(:+)**2 - 1.upto(integer).map { |i| i**2 }.reduce(:+)\nend", "def sum_square_difference(num)\n square_of_sum = (0..num).inject(:+) ** 2\n sum_of_square = (0..num).map { |num| num ** 2}.inject(:+)\n square_of_sum - sum_of_square\nend", "def sum_square_difference(integer)\n array = []\n 1.upto(integer) { |num| array << num }\n sum_squared = array.reduce(:+)**2\n\n array = []\n 1.upto(integer) { |num| array << num**2 }\n squared_sums = array.reduce(:+)\n\n sum_squared - squared_sums\nend", "def sum_square_difference(int)\n # square_of_sums = (0..int).inject(:+) ** 2\n # sum_of_squares = (0..int).inject(0) { |memo, value| memo + value ** 2 }\n # return square_of_sums - sum_of_squares\n\n (0..int).inject(:+) ** 2 - (0..int).inject(0) { |sum, n| sum + n ** 2 }\nend", "def sum_square_diff(num)\n sum_of_squares = 0\n square_of_sum = 0\n\n (1..num).each do |i|\n squared = i**2\n sum_of_squares += squared\n square_of_sum += i\n end\n\n square_of_sum **= 2\n\n difference = square_of_sum - sum_of_squares\n\n puts difference\nend", "def sum_square_difference(number)\n squared_sum = 1.upto(number).inject(:+)**2\n sum_squares = 0\n 1.upto(number).each {|num| sum_squares += num**2}\n squared_sum - sum_squares\nend", "def square_of_sums\n return (@n * (@n + 1) / 2)**2\n end", "def sum_of_squares(n)\n sum = 0\n (1..n).each {|i| sum = sum + (i*i)}\n sum\n end", "def sum_square_difference(num)\n square_of_the_sum = 0\n sum_of_the_squares = 0\n \n 1.upto(num) do |num|\n square_of_the_sum += num\n sum_of_the_squares += (num ** 2)\n end\n\n total = (square_of_the_sum ** 2) - sum_of_the_squares\n total\nend", "def sum_square_difference(a_num)\r\n first_block = (1..a_num).to_a.reduce(&:+)\r\n first_block **=2\r\n\r\n second_block = (1..a_num).to_a.map { |number| number ** 2 }\r\n second_block = second_block.reduce(&:+)\r\n\r\n first_block - second_block\r\nend", "def sum_of_squares n\n (n**3)/3 + (n**2)/2 + n/6 \nend", "def sum_square_difference(num)\n square_of_sum = 0\n sum_of_squares = 0\n\n 1.upto(num) do |i| \n square_of_sum += i\n sum_of_squares += i**2\n end\n\n square_of_sum**2 - sum_of_squares\nend", "def findDiffSquares(n)\n sum = 0\n (1..n).each { |i|\n (1..n).each { |j|\n sum += i*j unless i == j\n }\n }\n sum\nend", "def difference\n square_of_sums - sum_of_squares\n end", "def difference\n square_of_sums - sum_of_squares\n end", "def difference\n # square of sums will always be bigger\n square_of_sum - sum_of_squares\n end", "def sum_square_difference(num)\r\n arr = (1..num).to_a\r\n sum1 = arr.sum ** 2\r\n sum2 = arr.inject { |sum, number| sum + number**2 }\r\n sum1 - sum2\r\nend", "def sum_square_difference(num)\n sum = 0\n square_sum = 0\n\n 1.upto(num) do |n|\n sum += n\n square_sum += n**2\n end\n\n sum**2 - square_sum\nend", "def square_of_sum(n)\n sum = 0\n (1..n).each {|i| sum = sum + i}\n sum * sum\n end", "def sum_up_to_squared n=100\r\n (2 * n + 1) * (n + 1) * n / 6\r\nend", "def difference\n return square_of_sums - sum_of_squares\n end", "def solve( n = 100 )\n # Sum of squares is given by n(n + 1)(2n + 1) / 6, while square of sums\n # is [n(n + 1)][n(n + 1)] / 4. Subtracting and simplifying the result\n # gives n(n + 1)(n - 1)(3n + 2) / 12.\n n * (n + 1) * (n - 1) * (3*n + 2) / 12\n end", "def sum_square_difference(num)\n arr = (1..num).to_a\n square_of_arr_summed = (arr.sum) ** 2\n square_of_each_num = arr.reduce(0) { |sum, n| sum + n**2 }\n\n # Alternatively\n # square_of_each_num = 0\n # arr.each { |element| square_of_each_num += element **2 }\n\n return square_of_arr_summed - square_of_each_num\nend", "def sum_squares(n)\nsums = [] \n for i in (1..n)\n i_squared = i**2\n sums.push i_squared \n end\n p sums.reduce(:+)\nend", "def sum_of_squares\n return @n * (@n + 1) * (2 * @n + 1) / 6\n end", "def difference\n square_of_sum - sum_of_squares\n end", "def sum_of_squares(n)\n sum = 0\n for i in 1..n\n sum+= i*i\n end \n sum\nend", "def six\n square_of_sum(100) - sum_of_squares(100)\nend", "def sum_square_difference(integer)\n sum = 0\n square_sum = 0\n 1.upto(integer) { |i| sum += i }\n 1.upto(integer) { |i| square_sum += i**2 }\n sum**2 - square_sum\nend", "def p6\n\trange = (1..100).to_a\n\tsquare_of_sum = range.reduce(:+) ** 2\n\tsum_of_square = (range.map{|x| x ** 2}).reduce(:+)\n\tsquare_of_sum - sum_of_square\nend", "def sum_square_difference(num)\n total_square = 0\n num_square = 0\n\n 1.upto(num) do |number|\n total_square += number\n end\n\n 1.upto(num) do |fig|\n num_square += fig**2\n end\n\n product_total = total_square ** 2\n square_difference = product_total - num_square\n square_difference\nend", "def square_sum_up_to n=100\r\n (n * (n + 1) / 2)**2\r\nend", "def square_sums(n)\n Array(1..n).sum**2\nend", "def solution(num)\n sum_of_squares = 0\n\n (1..num).each do |number|\n sum_of_squares += number**2\n end\n\n square_of_sums = (1..num).inject(:+) ** 2\n\n p (square_of_sums - sum_of_squares).abs\nend", "def square_of_sum\n\t\t@n**2*(@n+1)**2/4\n\tend", "def sum_of_squares(n)\n (1..n).inject(0) do |total, i|\n total += i**2\n end\nend", "def squareOfSum n\n return triangularNumber(n)**2\nend", "def sum_of_the_squares\n sum = 0\n (1..self).each do |n|\n sum += n**2\n end\n sum\n end", "def sums num\n\tsum_of_squares = 0\n\tsum = 0\n\t1.upto num do |n|\n\t\tsum_of_squares += n*n\n\t\tsum += n\n\tend\n\tsum**2 - sum_of_squares \nend", "def sum_squares(n)\n (1..n).inject { |sum, i| sum += i**2 }\nend", "def sum_of_squares(numbers)\n numbers.map { |x| x * x }.reduce(0) { |acc, x| acc + x }\nend", "def squareSum(numbers)\n numbers.map { |n| n*n}.reduce(:+)\nend", "def squareSum(numbers)\n numbers.map { |n| n*n }.reduce(:+)\nend", "def sum_of_squares\n self.inject(0) { |sos, n| sos + n**2 }\n end", "def num_squares1(n)\n helper = [0, 1]\n (2..n).each do |i|\n helper << (1..Math.sqrt(i).to_i).map do |j|\n helper[i - j ** 2] + 1\n end.min\n end\n helper[n]\nend", "def sum_of_squares\n\t\t\tinject(0) do |sum, elem|\n\t\t\t\tsum + (elem ** 2)\n\t\t\tend\n\t\tend", "def num_squares2(n)\n helper = [0, 1]\n (2..n).each do |i| \n helper[i] = i\n (1..Math.sqrt(i).to_i).each do |j|\n helper[i] = [helper[i - j ** 2] + 1, helper[i]].min\n end \n end \n helper[n]\nend", "def sum_of_squares\n squares = differences_from_mean.map { |diff| diff ** 2 }\n squares.reduce(:+)\n end", "def square_of_n_integers n\n ((n/2) * (n+1))**2\nend", "def sum_square_difference(i)\n x = 0 \n sum = 0\n square_sum = 0\n loop do\n x += 1\n sum += x\n square_sum += x**2\n break if x == i \n end\n sum**2-square_sum\nend", "def square_of_sums\n sum=((@num**2+@num)/2)**2\n end", "def square_sum(numbers)\n squares = numbers.map{|number| number * number}\n squares.reduce(0){|num, sum| num + sum}\nend", "def sum_of_squares\n @number_range.sum {|n| n**2}\n end", "def squareSum(numbers)\n numbers.map { |i| i ** 2 }.reduce(:+)\nend", "def sum_of_squares\n end", "def sum_of_squares\n @range.sum { |n| n**2 }\n end", "def squareSum(numbers)\n numbers.inject(0) { |sum, n| sum + n*n }\nend", "def squareSum(numbers)\n numbers.reduce(0){|sum, x| sum + (x ** 2)}\nend", "def sum_of_squares\n range.reduce { |a, e| a + e**2 }\n end", "def subtract_product_and_sum(n)\r\n n=n.to_s.chars.map(&:to_i)\r\n if n[0] == 0\r\n n[1] = n[1]*-1 \r\n n = n[1..-1]\r\n end\r\n n.reduce(:*) - n.sum\r\nend", "def square_of_sums\n range.reduce(:+)**2\n end", "def sum_of_squares\n sum(square(sequence))\n end", "def sumSquareDifference( maxValue )\n sumSquares = 0\n sum = 0\n\n Range.new( 1, maxValue ).each do | value |\n sum += value\n sumSquares += value * value\n end\n\n squaresSum = sum * sum\n\n puts squaresSum - sumSquares\nend", "def square_of_sums\n square(sum(sequence))\n end", "def square_of_sum\n end", "def sum_of_the_squares max_number\n sum = 0\n (1..max_number).each { |i| sum += (i ** 2) }\n sum\nend", "def arith_sum_squares(max)\n max * (max+1) * (2*max+1) / 6\nend", "def sum_square_difference(max_num: 100)\n diff = 0\n num_set = (1..max_num).to_a.reverse\n set_sum = num_set.inject(:+)\n until num_set.length == 1\n foo = num_set.pop\n set_sum -= foo\n diff += 2 * foo * set_sum\n end\n puts diff\nend", "def num_squares3(n)\n n /= 4 while n % 4 == 0\n return 4 if n % 8 == 7\n (0..Math.sqrt(n).to_i).each do |a|\n b = Math.sqrt(n - a ** 2).to_i\n if a * a + b * b == n\n if a > 0 && b > 0\n return 2\n elsif a == 0 && b == 0\n return 0\n else\n return 1\n end\n end\n end\n return 3\nend", "def sum_of_squares values\n values.collect { |v| v**2 }.reduce(:+)\nend", "def sum_squares_excluding_smallest(*args)\n drop_the_smallest(*args).reduce(0) do |accum, n|\n accum += n * n\n end\nend", "def sumOfSquares(max)\n out = 0\n max.times do |i|\n out += (i+1)**2\n end\n out\nend", "def sum_of_squares(x)\n sum_of_squares = 0\n (1..x).each do |f|\n sum_of_squares += f**2\n end\n return sum_of_squares\nend", "def sum(n)\n end", "def sum_sq(n)\n cnt = 1\n sum = 0\n while cnt <= n\n sum += cnt * cnt\n cnt += 1\n end \n puts sum\nend", "def summation(n)\n sum = 0\n (1..n).each { |num| sum += num }\n return sum\nend", "def sum_of_squares(max)\n sum = 0\n (1..max).each do|current|\n sum = sum + current**2\n end\n return sum\nend", "def sum_of_square(range)\n\trange.inject(0) { |sum, i| sum + i**2 }\nend", "def square_of_sum\n @number_range.sum**2\n end" ]
[ "0.854787", "0.85229677", "0.85021406", "0.85000306", "0.8475286", "0.845751", "0.8387166", "0.8375444", "0.83246243", "0.8274602", "0.82738507", "0.8097872", "0.80208457", "0.7928952", "0.7813768", "0.7797255", "0.7733579", "0.77135974", "0.7709057", "0.76909673", "0.7683417", "0.76315707", "0.7614701", "0.7605563", "0.7601508", "0.75833446", "0.75693816", "0.75648504", "0.75504", "0.75489223", "0.75343984", "0.75163245", "0.750573", "0.7473062", "0.74720883", "0.74720883", "0.74483067", "0.74423414", "0.7353504", "0.73089856", "0.7293725", "0.72898656", "0.72839415", "0.727883", "0.7278451", "0.72733307", "0.7272463", "0.7260718", "0.7237397", "0.7236647", "0.71834254", "0.7161851", "0.71577775", "0.7156897", "0.7153297", "0.7082387", "0.7045346", "0.697641", "0.6945048", "0.6916315", "0.69029194", "0.6894181", "0.68859285", "0.6874764", "0.6866525", "0.6862138", "0.6840185", "0.6817461", "0.6809639", "0.6800331", "0.67828923", "0.6781352", "0.67588705", "0.6758803", "0.6757941", "0.67437345", "0.67333305", "0.67217004", "0.6720984", "0.67078453", "0.6687099", "0.6670584", "0.66409385", "0.66309345", "0.6608564", "0.6593798", "0.65879965", "0.6575917", "0.6570963", "0.65126294", "0.6497612", "0.649215", "0.6454558", "0.64541143", "0.644652", "0.6434709", "0.64342684", "0.6421396", "0.6420755", "0.6418388" ]
0.8401951
6
Create a method that takes two integers as arguments. The first argument is a count, and the second is the first number of a sequence that your method will create. The method should return an Array that contains the same number of elements as the count argument, while the values of each element will be multiples of the starting number. You may assume that the count argument will always have a value of 0 or greater, while the starting number can be any integer value. If the count is 0, an empty list should be returned
def sequence(multiple, starting_num) return [] if multiple == 0 counter = 1 array = [] loop do array << counter * starting_num counter += 1 break if counter > multiple end array end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sequence(count, starting_num)\n result_arr = []\n 1.upto(count) { |num| result_arr << starting_num * num }\n result_arr\nend", "def sequence(count, start_number)\n array = []\n count.times { |i| array << (start_number * (i + 1)) }\n array\nend", "def sequence(count, start)\n final_arr = []\n 1.upto(count) do |num|\n final_arr << num * start\n end\n final_arr\nend", "def sequence(count, start)\n return [] if count == 0 \n sequence_array = []\n iterator = 1\n count.times do\n sequence_array << start * iterator \n iterator += 1 \n end \n sequence_array\nend", "def sequence(count, num)\n seq_arr = []\n 1.upto(count) { |n| seq_arr << num * n }\n seq_arr\nend", "def sequence(count, number)\n sequence_arr = []\n 1.upto(count) do |n|\n sequence_arr << number * n\n end\n sequence_arr\nend", "def sequence(count, startnum)\n sequence_array = []\n multiple = 1\n \n until count == 0\n sequence_array << startnum * multiple\n count -= 1\n multiple += 1\n end\n \n sequence_array\nend", "def sequence(count, start_num)\n (1..count).map { |idx| start_num * idx }\nend", "def sequence(count, first_nb)\n result = []\n count.times { |loop| result << (first_nb * (loop + 1)) }\n result\nend", "def sequence(count, start)\n seq = []\n count.times { |i| seq << start * (i + 1) }\n seq\nend", "def sequence(count, first_num)\n multiples = []\n count.times {|index| multiples[index] = first_num * (index +1) }\n multiples\nend", "def sequence(count, num)\n arr = []\n count.times{ |i| arr << (i+1) * num }\n arr\nend", "def sequence(count, start_num)\n output_arr = [start_num] * count # populate with count, then just multiply\n output_arr.map.with_index do |num, idx|\n num * (idx + 1)\n end\nend", "def sequence(count, start)\n (1..count).map { |count| count * start }\nend", "def sequence(count, num)\n multiples = []\n count.times { |i| multiples.push(num * (i + 1)) }\n multiples\n # (1..count).map { |idx| idx * num }\nend", "def sequence(count, num)\n result = 0\n Array.new(count).map {|_| result += num }\nend", "def sequence(count, first_num)\n result = []\n multiple = 1\n\n count.times do \n result << first_num * multiple\n multiple += 1\n end\n result\nend", "def sequence(count, start)\n (1..count).map { |i| i * start }\nend", "def sequence2(count, num)\n (1..count).to_a.map { |c| c * num }\nend", "def sequence(count, first)\n (1..count).map { |idx| idx * first }\nend", "def sequence(count, start)\n sequence = []\n current = start\n\n count.times do\n sequence << current\n current += start\n end\n\n sequence\nend", "def sequence(count, first)\n sequence = []\n number = first\n\n count.times do\n sequence << number\n number += first\n end\n sequence\nend", "def sequence(num)\n Array.new(num) { |i| i+1 }\nend", "def sequence(count, integer)\n new_arr = []\n times = 1\n count.times do \n new_arr << integer * times\n times += 1\n end\n p new_arr\nend", "def sequence(count, skip)\n result = []\n return result if count.zero?\n count.times do |x|\n result << skip * (x + 1)\n end\n result\nend", "def sequence(count, first)\n (1..count).map { |value| value * first }\nend", "def sequence(n)\n results = []\n 1.upto(n) {|num| results << num}\n results\nend", "def repeatedly(count, initial = nil)\n return [] if (count = count.to_i) == 0\n return count.times.collect{ nil } unless block_given?\n return count.times.collect do\n initial = yield(initial)\n end\n end", "def sequence(num)\r\n new_arr = []\r\n (1..num).step(1) { |n| new_arr << n }\r\n new_arr\r\nend", "def multiples_of(number, upTo)\n result = Array.new\n (0..upTo).step(number) do |n|\n result << n\n end\n puts result.inspect\n result\nend", "def sequence(num)\n arr = []\n count = 1\n while count <= num\n arr << count\n count += 1\n end\n arr\nend", "def sequence(number)\n (1..number).to_a\nend", "def sequence(number)\n (1..number).to_a\nend", "def sequence(num)\n\n results = []\n\n 1.upto(num) { |num| results << num }\n\n results\n\nend", "def sequence(num)\n sequence_arr = []\n 1.upto(num) { |n| sequence_arr << n }\n sequence_arr\nend", "def number_counting_seq(n)\r\n\r\nend", "def sequence(num)\n result = []\n num.times{|i| result << i + 1}\n result\nend", "def counting(limit) # this method receives an integer argument and returns an array\n numbers = []\n if limit.is_a?(Integer)\n count = 0\n while count < limit\n numbers << count\n count += 1\n end\n end \n numbers\nend", "def sequence(number)\n array_of_numbers = []\n \n 1.upto(number) do |num|\n array_of_numbers << num\n end\n \n array_of_numbers\n \nend", "def sequence(int)\n array = []\n 1.upto(int) do |num|\n array << num\n end\n array\nend", "def sequence(num)\n (1..num).to_a\nend", "def sequence(num)\n (1..num).to_a\nend", "def sequence(num)\n (1..num).to_a\nend", "def sequence(num)\n return [] if num < 1\n (1..num).to_a\nend", "def series_up(n) # given n, return a list that goes [1,1,2,1,2,3... n]\n n_list = []\n (n+1).times do |m|\n m.times do |val|\n n_list.push(val+1)\n end\n end\n return n_list\nend", "def sequence(num)\n new_arr = []\n if num <= 0\n count = num\n else\n count = 1\n end\n \n num.abs.times do\n new_arr << count\n count += 1\n end\n \n p new_arr\nend", "def sequence(number_of_multiples, multiplier)\n return [] if number_of_multiples == 0\n result = []\n current_number = 1\n loop do\n result << current_number * multiplier\n current_number += 1\n break if current_number > number_of_multiples\n end\n result\nend", "def sequence(number_of_multiples, multiplier)\n result = []\n (1..number_of_multiples).each { |number| result << number * multiplier }\n result\nend", "def sequence(length, step)\n Array.new(length) { |idx| (idx + 1) * step }\nend", "def sequence(num)\n arr = []\n 1.upto(num) { |n| arr << n }\n arr\nend", "def sequence3(number)\n array = []\n 1.upto(number) { |num| array << num }\n array\nend", "def sequence(number)\n result = []\n 1.upto(number) {|e| result << e}\n result\nend", "def series_up(n) # Got help again. My first code couldn't adapt at all. This one has a reset limit, meaning it loops the amount of times it needs to for each interger. Still not perfect, but almost there. \n list = [1]\n i = 1\n length = n*(n+1)/2\n reset = 3\n list.push i\n i += 1\n if i == reset\n reset += 1\n end\n return list\nend", "def magic_numbers(count)\n index = 0\n array = []\n found = 0\n while found < count\n if is_magic_number?(index)\n array.push(index)\n found += 1\n end\n index += 1\n end\n return array\nend", "def series_up(n)\n list = []\n (n+1).times do |a|\n a.times do |b|\n list.push(b+1)\n end \n end\n return list\nend", "def sequence(integer)\n (1..integer).to_a\nend", "def sequence(integer)\n (1..integer).to_a\nend", "def sequence(number)\n result = []\n 1.upto(number) do |num|\n result << num\n end\n \n result\nend", "def sequence(num)\n (1..num).map { |n| n }\nend", "def sequence(n1, n2)\n\n arr = []\n counter = 1\n \n while n1 >0\n loop do \n arr << n2 * counter\n counter +=1\n break if counter > n1\n end\n break\n end\narr\nend", "def sequence(num)\n sequence = []\n for nums in 1..num\n sequence << nums\n end\n sequence\nend", "def sequence(count,num)\narr = []\ntotal = 0\ncount.times {arr << total += num}\np arr\nend", "def sequence(number_of_multiples, multiplier)\n result = []\n current_number = 1\n loop do\n break if current_number > number_of_multiples # catches edge case\n result << current_number * multiplier\n current_number += 1\n end\n result\nend", "def sequence(num)\n return [0] if num == 0\n num > 0 ? (1..num).to_a : (num..0)\nend", "def magic_numbers(count)\n num = 1\n result = []\n while result.length < count\n result << num if is_magic_number?(num)\n num += 1\n end\n result\nend", "def countup(num)\n (1..num).to_a\nend", "def sequence(int, int1)\n arr = []\n int.times {|i| arr << int1 + (int1 * i) }\n arr\nend", "def monkey_count(n)\n [*1..n]\nend", "def multiples_x(number, multiple)\n current_multiple = multiple\n multiples = []\n\n while current_multiple <= number\n multiples << current_multiple\n current_multiple += multiple\n end\n\n multiples\nend", "def getArray(n=3)\n return (1..n).to_a\nend", "def sequence(num)\n num > 0 ? (1..num).to_a : (num..1).to_a\nend", "def count_up(number)\n (1..number).to_a\nend", "def sequence2(num)\n arr = []\n \n 1.upto(num) do |n|\n arr << n\n end\n arr\nend", "def series_up(n)\n new_list=[] # to push into a new list\n (n + 1).times do |index| #You need the nested loop index.times to run at least once. Since Index starts at 0, you need to add 1 so that it runs at least once\n index.times do |value| # this runs the loop each time until it reaches the number needed\n new_list.push(value + 1) #Same as the loop above. Since the value starts at 0, you need to start at 1 bc that's what the challenge wants you to do. the .push pushes it into the new list \n end \n end \n return new_list # this makes the function print the newly created list\nend", "def sequence(num)\n arr = []\n \n 1.upto(num) do |i|\n arr << i\n end\n\n arr\nend", "def seriesup(n)\n list = [] \n (n+1).times do |b| # added the +1 because this code needs to run 1 more time than the input\n b.times do |a|\n list.push(a+1) #changed the variable from b to a because it doesn't need to use the first variable, you have to use the second one to make it repeat from 1. Also, I had a space between the list.push and the (), so the push didnt even work with this space.\n end\n end\n return list\nend", "def sequence(num)\n (1..num).to_a unless num < 1\nend", "def sequence(num)\n (1..num).to_a unless num < 1\nend", "def call_numbers(*)\n []\n end", "def sequence(num)\n\tarr = []\n\t1.upto(num) {|num| arr << num }\n\tarr\nend", "def multiples_of( x, xmax )\n ct = x\n nums = []\n while ct <= xmax\n nums << ct\n ct += x\n end\n return nums\nend", "def sequence(num)\n 1.downto(num).to_a\nend", "def series_up(nums) \r\n series = 0 # start the list at the right \r\n list = [] # the list is empty at the start \r\n nums.times do |seq| \r\n n = 0 \r\n nums.times do |nums| # run a loop for the sequence \r\n list[n + series] = n + 1 \r\n n += 1 \r\n end \r\n series += seq + 1 # exponential growth \r\nend \r\n return list \r\nend", "def sequence(int)\n if int > 0 \n (1..int).to_a\n elsif int == 0\n [0]\n else\n result = []\n 0.downto(int) { |i| result << i }\n result\n end\nend", "def magic_numbers(count)\nend", "def series_up(num)\n series = 0\n list = [] #starts as empty\n #puts \"running code\"\n num.times do |pattern|\n n = 0#original num\n num.times do |num|\n list[n + series] = n + 1\n n += 1\n end \n series += pattern + 1 \n #makes it grow exponentially\n end\n return list \nend", "def range(start_val, end_val)\n return [] if start_val + 1 == end_val\n nums = [start_val + 1]\n nums + range(start_val + 1, end_val)\nend", "def sequence(integer1, integer2)\n sequence_array = []\n current_value = integer2\n integer1.times do\n sequence_array << current_value\n current_value += integer2\n end\n sequence_array\nend", "def series_up(x)\nbignum = 1\ncount = 1 #made it one beacsue when it was 0 it only printed the number - 1\nlist = [] # changed it to list so i dont get confused\n x.times do #loop in a loop \n count = 1 #It resets it to one so it follows the pattern\n while count <= bignum #while count is less than or equal too this loop will keep on going\n list.push(count) #pushes count into the list\n count = count + 1 #making count equal to count + 1. So if count is 2, it will come out as 3\n end\n bignum = bignum + 1 #setting big number so the loop keeps on going\n end\n return list #when the loop is over it takes the list and prints it\nend", "def sequence(n)\n n < 1 ? (n..0).to_a : (1..n).to_a\nend", "def count_to (n)\n array = []\n count = 0\n while count <= n\n count += 1\n array.push(count.round)\n end\nend", "def element_times_index(numbers)\n \n i = 0 # i represents to the index current index always\n \n new_array = []\n \n while i < numbers.length # We cant do less than or equal to here\n \n new_array << numbers[i] * i # You can shovel directly into a new array\n i += 1\n end\n return new_array\nend", "def sequence(quantity, number)\n sequence = []\n counter = 1\n quantity.times do \n sequence << number * counter\n counter += 1\n end\n sequence\nend", "def get_fibonacci_sequence(count)\n $i = 0\n # make sure we were passed in a number by converting it to an integer and then comparing the string value of the resulting\n # object to the original as to_i will output 0 if it can't convert to an integer\n # if it's not a number we'll raise an ArgumentError\n i_count = count.to_i\n if i_count.to_s != count || i_count < 0\n raise(ArgumentError, 'The requested number of items from the sequence must be a positive number.')\n end\n\n # create a new array to hold the calculated values and seed it with the first 2 numbers of the sequence to use in the calculations\n fib_sequence = Array.new\n fib_sequence.push 0\n fib_sequence.push 1\n $i+=2\n\n while $i <= i_count\n fib_sequence.push fib_sequence[-2] + fib_sequence[-1]\n $i+=1\n end\n # because we seed the array with the first 2 values of the sequence, we use slice to make sure we don't return too many items\n # in the case where they request 0 or 1 items\n fib_sequence.slice(0, i_count)\n end", "def sequence(num)\n result = [1]\n times_number = num > 0 ? num - 1 : -(num) + 1\n times_number.times{num > 0 ? result << result.last + 1 : result << result.last - 1}\n result\nend", "def sequence(num1, num2)\n (1..num1).map { |value| value * num2 }\nend", "def series_up(nums)# did not have time to do this function\n series = 0 # start the list at the right value\n list = [] # the list is empty at the start \n nums.times do |seq| # Run a loop for the sequence\n n = 0# set it equal to orignal num\n nums.times do |nums|\n list[n+ series] = n + 1\n n += 1\n end\n\n series += seq + 1 # exponetial growth \n end\n return list\n\nend", "def range(start, finish)\n return [] if start >= finish\n [start + 1] + range(start + 1, finish)\nend", "def numbers(n)\n\nend", "def count_by(x, n)\n (1..n).map{|i| i*x}\nend" ]
[ "0.80142564", "0.78074026", "0.7567709", "0.7562581", "0.7558641", "0.7540436", "0.74942553", "0.74785477", "0.74374723", "0.7418926", "0.73927593", "0.73886436", "0.73679894", "0.7338968", "0.7311367", "0.7276826", "0.7214861", "0.71601534", "0.7099355", "0.7040678", "0.7009042", "0.6966081", "0.69571435", "0.6942469", "0.6942448", "0.6923806", "0.6909168", "0.68857694", "0.6884009", "0.68703294", "0.6843682", "0.6831935", "0.6831935", "0.68184835", "0.67983395", "0.67611974", "0.6751219", "0.67459327", "0.6724009", "0.6720131", "0.6713496", "0.6713496", "0.6713496", "0.6707144", "0.6705988", "0.67030686", "0.6681774", "0.66294795", "0.6628221", "0.6624795", "0.66114265", "0.66071457", "0.6601996", "0.6589251", "0.657925", "0.65727156", "0.65727156", "0.655731", "0.6513137", "0.6511078", "0.6489577", "0.6488613", "0.64691365", "0.6464333", "0.6461032", "0.6455457", "0.6452421", "0.6438775", "0.6430069", "0.6404066", "0.63954204", "0.63604385", "0.63599306", "0.6334399", "0.63312125", "0.6321224", "0.6290213", "0.6290213", "0.6288196", "0.6287802", "0.62661546", "0.6264021", "0.6257542", "0.6257417", "0.62499946", "0.6239787", "0.62357944", "0.6233254", "0.6231853", "0.6229568", "0.6226958", "0.6210128", "0.618111", "0.6172563", "0.61646855", "0.61557317", "0.6135694", "0.61329585", "0.6131101", "0.61288625" ]
0.7353234
13
initialize | for default is on ./Movies, just type the filename
def initialize(filename, time, directory="./Movies/%s") @hwnd = API.hwnd(nil) @filename = directory % filename @time = time @_ntime = Time.now @refreshTime = 0 @screen = Sprite.new() @screen.bitmap = Bitmap.new(Graphics.width, Graphics.height) @screen.bitmap.fill_rect(0, 0, Graphics.width, Graphics.height, Color.new(0, 0, 0)) @screen.z = 10e3 sleep(1.0) MCI.call("open \""+@filename+"\" alias FILE style 1073741824 parent " + @hwnd.to_s,0,0,0) main end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(path)\n super\n @movies = load_data(path).map { |movie| Movie.create(self, movie) }\n end", "def initialize filename\n\t\t@filename = filename\n\tend", "def initialize(file)\r\n raise IOError, \"Cannot read #{file}\" unless File.readable? file\r\n @file = file\r\n @filename = File.basename file\r\n @name = File.basename file\r\n @keywords = @name.split\r\n @category = 'experimental uploader'\r\n @description = \"A video about #{@name}\"\r\n end", "def initialize(filename)\n @moviedata = Movie_Data.new(filename)\n @user_rating_map = moviedata.getMovie_rating_map\n @user_predictMap = {}\n @popularityMap = moviedata.getPopularityMap\n @avgRatingMap = moviedata.getAverageRatingMap\n \n end", "def initialize(directory)\n @directory = directory\n @original_directory = directory\n @status, @enrich_movie_full, @enrich_status = false, \"\", false\n @title_full = File.basename directory\n @status, name = movie_directory File.basename directory\n @name = clean_movie_name name\n end", "def initialize(path, movie)\n @file = path[FILE_REGEX]\n @movie = movie\n @genres = movie['Genre'].split(', ')\n @params = {\n **base_params,\n **genre_params,\n **remote_url_params\n }\n end", "def initialize(filename)\n @filename = filename\n end", "def initialize(filename)\n @filename = filename\n end", "def initialize(filename)\n @filename = filename\n end", "def initialize(title, artist, filename)\n @title = title #instance variable\n @artist = artist#instance variable\n @filename = filename#instance variable\n @play_count = 0#instance variable\n end", "def initialize(filename)\n @filename = filename\n end", "def initialize(filename)\n @filename = filename\n end", "def initialize(filename)\n @path = filename\n end", "def initialize(filename)\n @fname = filename\n end", "def initialize(filename = DEFAULT_FILENAME)\n @filename = File.join(APP_ROOT, filename)\n\n validate_file\n self\n end", "def initialize \r\n\t\tputs \"Enter the file location & name...\"\r\n\t\tbook_file = gets.chomp\r\n\t\t# Opens and reads the html files:\r\n\t\t@page = Nokogiri::HTML(open(book_file))\r\n\tend", "def initialize (mp3File, nameFile)\n if File.exists?(mp3File)\n @mp3 = mp3File\n else\n puts \"File #{mp3File} does not exist!\"\n end\n \n if File.exists?(nameFile)\n if File.readable?(nameFile)\n @file = File.open(nameFile)\n @filename = nameFile\n else \n puts \"File is not readable! Are the permissions correct? :(\"\n end\n \n else\n puts \"File #{nameFile} does not exist!\"\n end\n end", "def initialize(source)\n @source = File.expand_path(source)\n end", "def initialize(filename)\n @filename = filename\n parse()\n end", "def initialize(path)\n @path = path\n # accepts a file path to parse mp3 files from \n end", "def initialize(file = \"\")\n @file = file\n @replays = []\n\n load if File.exist?(file)\n end", "def initialize(options)\n options.each { |k, v| self.send :\"#{k}=\", v }\n self.file = File.expand_path file\n end", "def initialize(fileName_vars)\n @fileName_vars = fileName_vars\n end", "def initialize(filename)\n super(filename);\n @@this = self;\n end", "def initialize(path); end", "def initialize(filename)\n super(filename, EXT)\n end", "def initialize(filename)\n super(filename, EXT)\n end", "def initialize(filename=nil, file_options={})\n load_file(filename, file_options) if not filename.nil?\n end", "def initialize(file)\n @file = file\n @original_file = file\n @status, @enrich_status = false, false\n @status = music_file File.basename file\n \n @name = clean_music_name name\n end", "def initialize(file_name = '')\n if file_name == ''\n @ranking_data = retrieve_ranking_data\n else\n @ranking_data = retrieve_ranking_data(IO.read(Dir.pwd + \"/\" + file_name))\n end\n end", "def initialize(args = {})\n @file = args[:file] if args[:file]\n @dictionary = args[:dictionary] if args[:dictionary]\n end", "def movie_initializer\r\n new_movie = Movie.new\r\n end", "def initialize(filename)\n @filename = filename\n @cards = generate_cards\n end", "def initialize(filename)\n @data_source\n @metros = Hash.new\n if !File.file?(filename)\n puts \"Files does not exit. check your path\"\n exit\n end\n file = File.read(filename)\n dataset = JSON.parse(file)\n initialize_data_source(dataset['data sources'])\n initialize_metros(dataset['metros'])\n if (dataset.has_key?('single_route'))\n initialize_routes(dataset['routes'], 1)\n else\n initialize_routes(dataset['routes'], 0)\n end\n end", "def init_filename(file_index, filename)\r\n @file_index = file_index\r\n @filename = filename\r\n end", "def initialize(file_name, initial_data = {})\n @file_name = file_name\n super initial_data\n end", "def initialize(parent = nil, file = nil, title = nil, description = nil)\n super(parent)\n\n @file = file\n self.title = title\n self.description = description\n end", "def initialize description\n\t\t\t@medias = []\n\t\t\t@md = nil\n\t\t\t@path = description\n\t\t\tfolder = description.split('/')\n\t\t\tif folder.length == 1\n\t\t\t\t@folder = '.'\n\t\t\telse\n\t\t\t\t@folder = folder[0..-2].join('/') + '/'\n\t\t\tend\n\t\t\t@config = YAML.load_file description\n\t\tend", "def initialize(object, file)\n super(object, file)\n @name = object.name\n end", "def initialize(object, file)\n super(object, file)\n @name = object.name\n end", "def initialize(file, url, subject)\n @file = file\n # File.join(File.expand_path(\"../files\", __FILE__), \"_v9KUmP_小学英语会议报名_20170817162821.xls\")\n url = url || \"http://localhost:3000/dvd_results\"\n @pass = ENV[\"QIANYAN_PASS\"]\n @subject = subject.camelize\n @uri = gen_uri(url)\n end", "def load_genre_list()\n File.open('./genre_list')\nend", "def initialize(file)\n @file = file\n end", "def initialize(file)\n @file = file\n end", "def initialize(path)\n @path=path #create an instance variable which takes in the users input\n end", "def initialize(file_path)\n\t\t@path = file_path\n\tend", "def initialize(path = \"./db/mp3s\") #Default argument for the ending of the file given in path.\n @importer = MusicImporter.new(path).import\n #Create new instance (.new) of the MusicIMporter object (instantated in the MusicLibraryController class). And then you can call that MusicImporter's own class methods on this object (.import)\n end", "def initialize(music_path)\n @music_path = music_path\n end", "def initialize (imdb_ranking = nil) #initializes movie with basic details from IMDb Index Page\r\n\t\tif imdb_ranking == nil \r\n\t\t user_input\r\n\t\telse\r\n\t\t @imdb_ranking = imdb_ranking\r\n\t\tend\r\n\t\t@title = title\r\n\t\t@director = director\r\n\t\t@year = year\r\n\t\t@rating = rating\r\n\t\t@duration = duration\r\n\t\t@genres = genres\r\n\t\tsave\r\n\t\tself\r\n\tend", "def initialize (imdb_ranking = nil) #initializes movie with basic details from IMDb Index Page\r\n\t\tif imdb_ranking == nil \r\n\t\t user_input\r\n\t\telse\r\n\t\t @imdb_ranking = imdb_ranking\r\n\t\tend\r\n\t\t@title = title\r\n\t\t@director = director\r\n\t\t@year = year\r\n\t\t@rating = rating\r\n\t\t@duration = duration\r\n\t\t@genres = genres\r\n\t\tsave\r\n\t\tself\r\n\tend", "def initialize(filename)\n if filename == '-'\n @filename = 'stdin'\n text = STDIN.read\n else\n @filename = filename\n text = File.read(filename)\n end\n\n @document = Kramdown::Document.new(text, input: 'GFM')\n end", "def initialize(file_path)\n\t\tbegin\n\t\t\t@file_desc = File.open(file_path)\n\t\trescue\n\t\t\traise \"File not found\"\n\t\tend\n\tend", "def initialize (title, artist, genre)\n\t\t# insert lines here\n\t\t@genre = genre\n\tend", "def initialize(file, game)\n @file = file\n @game = game\n end", "def initialize(file_path)\n @file_path = file_path\n end", "def initialize(filepath = nil)\n @path = filepath ? File.expand_path(filepath.to_s) : nil\n load\n end", "def initialize(_filename=DEFAULT_STORE_FILENAME,args={})\n @filename = _filename\n super(args)\n end", "def initialize(name)\n @name = name\n load \n end", "def initialize(name) # accepts a name for the new genre\n @name = name # retrieves the name of a genre\n # can set the name of a genre\n @songs = []\n end", "def initialize(file)\n @file = file.is_a?(String) ? File.open(file) : file\n end", "def initialize(file)\n @file = file.is_a?(String) ? File.open(file) : file\n end", "def initialize(file)\n @file = file.is_a?(String) ? File.open(file) : file\n end", "def initialize(file_name, dir = default_dir)\n @dir = dir\n @file_name = file_name\n end", "def initialize file_path\n\t\t\t@file_path = file_path\n\t\t\t@meta = {}\n\t\tend", "def initialize(filename)\r\n @filename = filename\r\n @base_filename = File.basename(filename)\r\n @filepath = File.dirname(filename)\r\n @category = nil\r\n find_category\r\n @language = nil\r\n find_language\r\n @errors = nil\r\n @number_properties = nil\r\n end", "def initialize myFileName\n\t\t@handle = File.new(myFileName, \"r\")\n\tend", "def initialize(path)\n @dir = File.basename(path)\n @name = @dir.humanize\n end", "def initialize(path)\n @path = path#accepts a file path to parse MP3 files from\n end", "def init_file; end", "def initialize(file_name)\n create(file_name)\n end", "def initialize(file)\n @file = file\n end", "def initialize(file)\n @file = file\n end", "def initialize(file)\n @file = file\n end", "def initialize(filepath)\n puts \"Give an appropriate response to each category. Note that parenthesis within placeholders are NOT supported.\"\n story = File::read(filepath) #FIXME: Do I want to be putting the whole file into story? What if it's long?\n print parse(story)\n end", "def initialize(file)\n @file = file\n @original_file = file\n @status, @show, @season, @number, @name, @series_name = false, \"\", \"\", \"\", \"\", \"\"\n @status, show, @season, @number = tv_file File.basename file\n @season.gsub!(/^s/i,'')\n @season.gsub!(/^0/,'') if @season != \"0\" \n @number.gsub!(/^0/,'') if @number != \"0\"\n \n @show = show_name_rename show\n @series_name = @show\n \n #@number.gsub!(/^/,'0') if @number.to_i < 10 and @number.to_i != 0\n end", "def initialize(filename, logger=nil)\n @title_isbn_hash = Hash.new\n @isbn_dvd_hash = Hash.new\n @isbn_title_hash = Hash.new\n @filespec = filename\n @logger = OptionalLogger.new(logger)\n load\n save\n end", "def initialize root=\".\", verbose = true, ext=\".java\"\n @root = File.absolute_path root\n @verbose = verbose\n @files = Hash.new # files found\n @extension = ext\n end", "def initialize path\n # make menu instance accessible by the class\n @@menu = self\n @rolls = {}\n @sources = []\n\n # load a yaml file\n load_from_file path\n\n # create objects from the menu\n set_sources\n set_roll_models\n set_rolls\n end", "def initialize filename, options = {}\n @files = []\n @options = CommandLineOptions.new.merge options\n @filename = filename\n end", "def initialize( fn )\n @path = fn\n @dir = ::Webby::Resources.dirname(@path)\n @name = ::Webby::Resources.basename(@path)\n @ext = ::Webby::Resources.extname(@path)\n @mtime = ::File.mtime @path\n\n @_meta_data = {}\n self._reset\n end", "def initialize(args)\n @filename = args.fetch(:filename, nil)\n @yamlstring = args.fetch(:yamlstring, nil)\n \n unless defined?(@filename) || defined?(@string)\n raise InitializationError.new \"you must give me a filename or a string of YAML to get started\"\n end\n\n \n \n \n end", "def initialize(args,*options)\n super\n full_name = file_name.underscore\n\n @module_name = full_name.split('_').last\n @module_path = 'modules/' + full_name\n\n end", "def initialize(id, movie_id)\n @id = id\n @movie_id = movie_id\n @url = \"http://www.kinopoisk.ru/film/#{movie_id}/video/#{id}/\"\n @title = title\n end", "def init_file=(_arg0); end", "def app\n FilmFile\n end", "def app\n FilmFile\n end", "def initialize(filename, version)\n @filename = filename\n @version = version\n end", "def initialize(path)\n @path = File.expand_path(path)\n end", "def initialize(name) #initialize the song class with a name\n @name = name\n end", "def initialize (filename)\n if (filename && File::exists?(filename))\n parse (filename)\n else\n fail \"xmp file not specified in command line.\\nType: '#{$0} <#{TOPLEVEL}.xmp>'\"\n end\n end", "def initialize with_filename=\"\", options={}\n @id = if with_filename.blank?\n options[:filename]\n else\n with_filename\n end\n\n @attributes = if options.empty?\n yaml_front_matter\n else\n options\n end\n\n self._accessible_attributes.each do |attribute|\n class_eval do\n define_method(attribute) { @attributes[attribute] }\n end\n end\n end", "def initialize filename, mode='r', *args, &block\n @filename = filename\n @mode = mode\n end", "def initialize(data_location_hash)\n\t\t@data_file_path = data_location_hash[:path]\n\t\t@training_file_name = data_location_hash[:training]\n\t\t@testing_file_name = data_location_hash[:testing]\n\n\t\t@all_movies = Hash.new\n\t\t@all_users = Hash.new\n\n\t\tload_movie_data\n\t\tload_training_data\n\tend", "def initialize(file)\n @file = file\n end", "def initialize(imdb_id, title = nil, year = nil)\n @imdb_id = \"%07d\" % imdb_id.to_i\n @title = title\n @year = year\n @url = \"http://www.imdb.com/title/tt#{@imdb_id}/\"\n end", "def initialize\n bootstrap unless File.exist?(file)\n load_attributes\n end", "def initialize (title, artist, genre)\n # insert lines here\n @title = title\n @artist = artist\n\t\t@genre = genre\n\tend", "def initialize(file_index, filename)\n super(0, 56 + file_index % 4 * 90, 544, 90)\n @file_index = file_index\n @filename = filename\n load_gamedata\n refresh\n @selected = false\n end", "def initialize(path)\n @path = path \n end", "def initialize(filename)\n @filename = filename\n @source = yield\n end" ]
[ "0.70945776", "0.6798279", "0.669775", "0.6588018", "0.6544795", "0.653428", "0.64948267", "0.64948267", "0.64948267", "0.6390163", "0.6381442", "0.6381442", "0.6372666", "0.62922084", "0.6155978", "0.61206245", "0.6052851", "0.6049529", "0.6046943", "0.6042897", "0.60284173", "0.60239124", "0.5997179", "0.5994071", "0.5979884", "0.5979572", "0.5979572", "0.59551245", "0.5951695", "0.5941845", "0.59221447", "0.59185743", "0.5906621", "0.59052366", "0.58892876", "0.5888601", "0.5886209", "0.5871164", "0.5867777", "0.5867777", "0.586484", "0.58497727", "0.583736", "0.583736", "0.58318394", "0.5817571", "0.58168125", "0.58160585", "0.5813416", "0.5813416", "0.5789095", "0.57861793", "0.5778667", "0.5772752", "0.57630616", "0.57607174", "0.5754884", "0.5742213", "0.57283825", "0.5727492", "0.5727492", "0.5727492", "0.5726426", "0.5725058", "0.57204276", "0.5717393", "0.57100487", "0.5704884", "0.56943303", "0.5693619", "0.5684656", "0.5684656", "0.5684656", "0.56761825", "0.5675583", "0.56699026", "0.5660275", "0.56536746", "0.5648868", "0.56453216", "0.5642063", "0.5632722", "0.5632573", "0.5630564", "0.5625059", "0.5625059", "0.56136906", "0.56116825", "0.560984", "0.55947673", "0.5587779", "0.55852777", "0.5581278", "0.5573722", "0.5568614", "0.55650723", "0.5542536", "0.55332845", "0.55319834", "0.5528368" ]
0.6579407
4
update and run the movie
def update loop do if (Time.now.to_f - @_ntime.to_f) >= @time.to_f Graphics.update terminate break return end Input.update if Input.trigger?(Input::C) && $game_temp.mskip terminate break return end if @refreshTime >= rtime Graphics.update @refreshTime = 0 end @refreshTime += 1 end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update() end", "def update\r\n $scene.update\r\n end", "def update\n\n\n prepare_movie(false)\n\n respond_to do |format|\n if @movie.update(movie_params)\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { render :show, status: :ok, location: @movie }\n else\n format.html { render :edit }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def run\n page = parse(\"#{url}#{URI.encode('A Christmas Prince')}\")\n binding.pry\n page.css('#movieSection .results_ul li:first-child').each do |row|\n # movie = Movie.find_or_initialize_by(title: title(row), year: year(row))\n # if movie.persisted?\n # movie.update(update_params(row))\n # update(movie, row)\n # else\n # movie.assign_attributes(create_params(row))\n # movie.save\n # end\n end\n end", "def movie; end", "def run(cmd)\n movie.run(cmd)\n end", "def update ; end", "def update\n \n end", "def update\n respond_to do |format|\n if @movie.update(movie_params)\n format.json { render :show, status: :ok, location: @movie }\n else\n format.json do\n render json: @movie.errors, status: :unprocessable_entity\n end\n end\n end\n end", "def update\n\t\t\t\tprotect_runtime_errors do\n\t\t\t\t\tif @clear_history\n\t\t\t\t\t\t@history_cache = nil \n\t\t\t\t\t\tGC.start\n\t\t\t\t\tend\n\t\t\t\t\[email protected]_text(CP::Vec2.new(352,100), \"ERROR: See terminal for details. Step back to start time traveling.\")\n\t\t\t\t\t\n\t\t\t\t\t# -- update files as necessary\n\t\t\t\t\t# need to try and load a new file,\n\t\t\t\t\t# as loading is the only way to escape this state\n\t\t\t\t\tdynamic_load @files[:body]\n\t\t\t\t\t\n\t\t\t\t\[email protected] @window, self, @wrapped_object, turn_number()\n\t\t\t\tend\n\t\t\tend", "def play\r\n return if self.finished?\r\n self.update\r\n end", "def update\r\n\r\n end", "def update\n super\n refresh if @cw_data.include?(:playtime) && Graphics.frame_count / Graphics.frame_rate != @total_sec\n end", "def update\n \t\n end", "def update\n \t\n end", "def start_update \n @updating = $app.animate(UPDATE_SPEED) do\n update\n end\n end", "def updateProgramme()\n @media_operation = :update\n end", "def update\n end", "def reload\n rebuild_single_resource(Enceladus::Requester.get(\"movie/#{id}\", Enceladus::Movie.default_params))\n end", "def update\n update_animation\n end", "def update\n \n end", "def update()\n end", "def update\n ;\n end", "def update\r\n end", "def update\r\n end", "def update\r\n end", "def update\r\n end", "def play\n \n end", "def update; end", "def update; end", "def update; end", "def update; end", "def update; end", "def update; end", "def update; end", "def update; end", "def update\n @timer.update(Window.fps)\n case @scene\n when 'intro'\n update_intro\n when 'level'\n update_level\n when 'transition'\n update_transition\n when 'credits'\n update_credits\n end\n end", "def update\n @movie = Movie.find(params[:id])\n\n respond_to do |format|\n @movie.reload\n if @movie.update_attributes(params[:movie])\n flash[:notice] = 'Movie was successfully updated.'\n format.html { render 'maintenance/index', :layout => 'maintenance' }\n format.js\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.js\n format.xml { render :xml => @movie.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n ::Scheduler.start(:on_update)\n if @last_scene != $scene\n sort_z\n @last_scene = $scene\n end\n # Internal update management\n update_manage\n unless @no_mouse\n Mouse.moved = (@mouse.x != Mouse.x || @mouse.y != Mouse.y)\n @mouse.x = Mouse.x\n @mouse.y = Mouse.y\n end\n Audio.update\n update_cmd_eval if @__cmd_to_eval\n rescue LiteRGSS::Error\n puts 'Graphics stopped but did not raised the `LiteRGSS::Graphics::ClosedWindowError` exception'\n raise LiteRGSS::Graphics::ClosedWindowError, 'Temporary fix'\n end", "def update\n respond_to do |format|\n if @movie.update(movie_params)\n format.html { redirect_to @movie, notice: '更新しました' }\n format.json { render :show, status: :ok, location: @movie }\n else\n format.html { render :edit }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n\t\t\n\t\tend", "def update!(**args)\n @frames = args[:frames] if args.key?(:frames)\n end", "def update\n colourable_update\n movable_update\n end", "def timelapse\n raise NoSnapshotError if Dir.glob(saving_path+'/*.jpg').count.zero?\n\n puts \"Generate video...\"\n MovieMaker.build\n puts \"Video is ready.\"\n end", "def update\n update_flow\n update_sprites\n update_weather\n update_timer\n update_viewports\n @brightness -= 15 if @brightness > 0\n end", "def update\r\n # Si el pez no esta vivo, no hacer nada en este metodo\r\n if !@pez_vivo; return; end\r\n\r\n @image = @animation[@frame_name].next\r\n @frame_name = @direccion.izquierda? ? :izquierda : :derecha\r\n\r\n self.mover\r\n # if @genero == 1\r\n # @color = Color::FUCHSIA\r\n # else\r\n # @color = Color::GREEN\r\n # end # if\r\n\r\n # El pez muere luego de que pasa el tiempo de vida + desviacion\r\n if (Time.now - @vida_inicio) > @vida + @vida_desviacion\r\n print \"Muere el pez '#{@nombre}', vivió #{(Time.now - @vida_inicio).to_i} segundos...\\n\" if $modo_debug\r\n @pez_vivo = false\r\n @image = Image[\"pezd.png\"]\r\n # self.destroy\r\n end # if\r\n\r\n # El pez puede reproducirse si se ha reproducido menos de las veces que puede\r\n if @reproducir_veces1 < @reproducir_veces2\r\n # El pez puede reproducirse cuando sobrepasa el tiempo definido + desviacion\r\n if (Time.now - @reproducir_inicio) > @reproducir + @reproducir_desviacion\r\n @reproducir_puede = true\r\n end # if\r\n end # if\r\n end", "def update\n @movie = Movie.find(params[:id])\n\n respond_to do |format|\n if @movie.update(movie_params)\n format.html { redirect_to movie_url(@movie), notice: \"Movie was successfully updated.\" }\n else\n format.html { render :edit, status: :unprocessable_entity }\n end\n end\n end", "def update\n add_director\n add_actors\n respond_to do |format|\n if @movie.update(movie_params)\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { render :show, status: :ok, location: @movie }\n else\n format.html { render :edit }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def message_update_processing\n Graphics.update\n $scene&.update\n end", "def update\r\n end", "def update\n respond_to do |format|\n if @movie.update(movie_params)\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { render :show, status: :ok, location: @movie }\n else\n format.html { render :edit }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @movie.update(movie_params)\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { render :show, status: :ok, location: @movie }\n else\n format.html { render :edit }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @movie.update(movie_params)\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { render :show, status: :ok, location: @movie }\n else\n format.html { render :edit }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @movie.update(movie_params)\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { render :show, status: :ok, location: @movie }\n else\n format.html { render :edit }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @movie.update(movie_params)\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { render :show, status: :ok, location: @movie }\n else\n format.html { render :edit }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @movie.update(movie_params)\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { render :show, status: :ok, location: @movie }\n else\n format.html { render :edit }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @movie.update(movie_params)\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { render :show, status: :ok, location: @movie }\n else\n format.html { render :edit }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @movie.update(movie_params)\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { render :show, status: :ok, location: @movie }\n else\n format.html { render :edit }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @movie.update(movie_params)\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { render :show, status: :ok, location: @movie }\n else\n format.html { render :edit }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @movie.update(movie_params)\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { render :show, status: :ok, location: @movie }\n else\n format.html { render :edit }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @movie.update(movie_params)\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { render :show, status: :ok, location: @movie }\n else\n format.html { render :edit }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @movie.update(movie_params)\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { render :show, status: :ok, location: @movie }\n else\n format.html { render :edit }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @movie.update(movie_params)\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { render :show, status: :ok, location: @movie }\n else\n format.html { render :edit }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @movie.update(movie_params)\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { render :show, status: :ok, location: @movie }\n else\n format.html { render :edit }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @movie.update(movie_params)\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { render :show, status: :ok, location: @movie }\n else\n format.html { render :edit }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @movie.update(movie_params)\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { render :show, status: :ok, location: @movie }\n else\n format.html { render :edit }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @movie.update(movie_params)\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { render :show, status: :ok, location: @movie }\n else\n format.html { render :edit }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @movie = Movie.find(params[:id])\n\n respond_to do |format|\n if @movie.update_attributes(movie_params)\n format.html { redirect_to @movie, notice: 'La pelicula ha sido actualizada correctamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def update \n end", "def update\n @player = @player.get_state\n self.run\n self\n end", "def update\n respond_to do |format|\n if @omdb_movie.update(omdb_movie_params)\n format.html { redirect_to @omdb_movie, notice: 'Omdb movie was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @omdb_movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @video_actions = args[:video_actions] if args.key?(:video_actions)\n @video_anchors = args[:video_anchors] if args.key?(:video_anchors)\n @video_info = args[:video_info] if args.key?(:video_info)\n @video_score_info = args[:video_score_info] if args.key?(:video_score_info)\n end", "def update\n super\n if BattleManager.in_turn?\n process_event\n process_action\n end\n BattleManager.judge_win_loss unless BattleManager.victory_phase?\n if BattleManager.victory_phase?\n if @victory_score.done and @victory_score.active\n sfx = CP::VICTORY::IMAGE_SFX\n vol = CP::VICTORY::SFX_VOL\n pit = CP::VICTORY::SFX_PIT\n RPG::SE.new(sfx, vol, pit).play unless sfx.nil?\n @victory_score.active = false\n @victory_item.active = true\n end\n end\n end", "def main_process\n while @running\n Graphics.update\n update\n end\n end", "def update!(**args)\n @video_frames = args[:video_frames] if args.key?(:video_frames)\n end", "def update\n @watched_movie = WatchedMovie.find(params[:id])\n\n respond_to do |format|\n if @watched_movie.update_attributes(params[:watched_movie])\n format.html { redirect_to @watched_movie, notice: 'Watched movie was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @watched_movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @movie = @catalogue.movies.find(params[:id])\n data = params[:movie]\n if(data.has_key?(\"genres\"))\n\t\tids = Genre.get_ids(data[:genres])\n\t\tdata.delete(\"genres\")\n\tend\n\[email protected]_dirty_associations do\n\t\tunless ids == nil\n\t\t\[email protected]_ids = ids\n\t end\n\n\t respond_to do |format|\n\t if @movie.update_attributes(data)\n\t format.html { redirect_to(@movie, :notice => 'Movie was successfully updated.') }\n\t format.xml { head :ok }\n\t format.json { render :json => {:success => true} }\n\t else\n\t format.html { render :action => \"edit\" }\n\t format.xml { render :xml => @movie.errors, :status => :unprocessable_entity }\n\t format.json { render :json => {:success => false, :errors => @movie.errors} }\n\t end\n\t end\n end\n end", "def update\n respond_to do |format|\n if @movies_ive_watched.update(movies_ive_watched_params)\n format.html { redirect_to @movies_ive_watched, notice: 'Movies ive watched was successfully updated.' }\n format.json { render :show, status: :ok, location: @movies_ive_watched }\n else\n format.html { render :edit }\n format.json { render json: @movies_ive_watched.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @movie.update(movie_params)\n format.html {redirect_to @movie, notice: 'Movie was successfully updated.'}\n format.json {render :show, status: :ok, location: @movie}\n else\n format.html {render :edit}\n format.json {render json: @movie.errors, status: :unprocessable_entity}\n end\n end\n end", "def update!(**args)\n @animations = args[:animations] if args.key?(:animations)\n @image = args[:image] if args.key?(:image)\n end", "def update\n @movie = Movie.find(params[:id])\n\n respond_to do |format|\n if @movie.update_attributes(params[:movie])\n format.html { redirect_to(@movie, :notice => 'Movie was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @movie.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @movie = Movie.find(params[:id])\n\n respond_to do |format|\n if @movie.update_attributes(params[:movie])\n format.html { redirect_to(@movie, :notice => 'Movie was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @movie.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n super\n # update_bitmap # Not needed for now\n update_screen # Update the position the graphic should be displayed\n # update_frame # Update the frame count (if wanted later)\n end", "def update\n\t\trespond_to do |format|\n\t\t\tresult = Tmdb::TV.detail(show_params[:tmdbid])\n\t\t\[email protected] = result[\"name\"]\n\t\t\[email protected] = result[\"overview\"]\n\t\t\[email protected] = result[\"number_of_seasons\"]\n\t\t\[email protected] = result[\"number_of_episodes\"]\n\t\t\[email protected] = result[\"episode_run_time\"].dig(0)\n\t\t\[email protected] = result[\"vote_average\"]\n\t\t\[email protected] = result[\"first_air_date\"]\n\t\t\[email protected]\n\t format.html { redirect_to @show, notice: 'Show was successfully updated.' }\n\t format.json { render :show, status: :ok, location: @show }\n\t\tend\n\tend", "def play; end", "def update\n @movie = Movie.find(params[:id])\n\n respond_to do |format|\n if @movie.update_attributes(params[:movie])\n format.html { redirect_to(edit_movie_path(@movie), :notice => 'Movie was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @movie.errors, :status => :unprocessable_entity }\n end\n end\n end", "def play \n end", "def update\n \n end", "def update\n \n end", "def update\n \n end" ]
[ "0.6536469", "0.6531511", "0.6440086", "0.6421167", "0.63263154", "0.631737", "0.6299851", "0.6202555", "0.6194916", "0.61818415", "0.61765695", "0.61118865", "0.6099283", "0.6098503", "0.6098503", "0.6086195", "0.6072781", "0.60568035", "0.605509", "0.6054287", "0.6054043", "0.60518163", "0.60372365", "0.6002423", "0.6002423", "0.6002423", "0.6002423", "0.59964854", "0.5986248", "0.5986248", "0.5986248", "0.5986248", "0.5986248", "0.5986248", "0.5986248", "0.5986248", "0.59843546", "0.5979103", "0.5974301", "0.59716046", "0.596913", "0.5967374", "0.59618247", "0.5960984", "0.59586376", "0.5956406", "0.59549946", "0.59484816", "0.59208584", "0.59208584", "0.59208584", "0.59208584", "0.59208584", "0.59208584", "0.59208584", "0.59208584", "0.59208584", "0.59208584", "0.59208584", "0.58975935", "0.58741283", "0.58592206", "0.58592206", "0.58592206", "0.58592206", "0.58592206", "0.58592206", "0.58592206", "0.58592206", "0.58592206", "0.58592206", "0.58592206", "0.58592206", "0.58592206", "0.58592206", "0.58592206", "0.58592206", "0.58592206", "0.58287567", "0.5822347", "0.5819611", "0.58161306", "0.5810637", "0.5810541", "0.58099765", "0.58089024", "0.5803314", "0.5802269", "0.5787826", "0.5784965", "0.57775456", "0.577419", "0.577419", "0.5773528", "0.57706505", "0.57641476", "0.57624954", "0.5761337", "0.575287", "0.575287", "0.575287" ]
0.0
-1
Sets the cache adaptor IdentityCache will be using == Parameters +cache_adaptor+ A ActiveSupport::Cache::Store
def cache_backend=(cache_adaptor) cache.memcache = cache_adaptor end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cache_backend=(cache_adaptor)\n if defined?(@cache)\n cache.cache_backend = cache_adaptor\n else\n @cache = MemoizedCacheProxy.new(cache_adaptor)\n end\n end", "def adapter\n unless @_adapter && @_adapter.valid?\n @_adapter = Cachetastic::Adapters.build(cache_klass)\n end\n @_adapter\n end", "def adapter\n a = cache_conn_instance.get(cache_name)\n if adapter_supported?(a.class)\n return a\n else\n raise Cachetastic::Errors::UnsupportedAdapter.new(cache_name, a.class)\n end\n end", "def use_cache(cache)\n @cache = cache\n end", "def cache=(cache)\n @cache = Cache.new(cache, logger)\n end", "def cache=(cache)\n expire_index!\n @cache = cache\n end", "def adaptor\n @session.adaptor\n end", "def set_cache\n cache_key = self.class.cache_key(self.key)\n Rails.cache.write(cache_key, self.actual_value)\n end", "def initialize(cache_store)\n @cache_store = cache_store\n end", "def adapter=(adapter)\n Adapter.use = adapter\n end", "def set_cache(value); end", "def set_cache(value); end", "def initialize(cache)\n self.cache = cache\n end", "def configure_cache; end", "def set_adapter\n @adapter = Adapter.find(params[:id])\n end", "def set_cachefacebook_interface\n @cachefacebook_interface = CachefacebookInterface.find(params[:id])\n end", "def cached(cache_key)\n begin\n result = yield\n $memcache.set(cache_key, result, 7200)\n warn \"Component #{cache_key} Set Successfully\" \n result\n rescue\n {}\n end\n end", "def set_adapter(adapter)\n @instance = adapter\n end", "def cache_store=(_arg0); end", "def cache_store=(_arg0); end", "def cache(options = {})\n self._cache =\n options.delete(:cache_store) ||\n ActiveModelSerializers.config.cache_store ||\n ActiveSupport::Cache.lookup_store(:null_store)\n self._cache_key = options.delete(:key)\n self._cache_only = options.delete(:only)\n self._cache_except = options.delete(:except)\n self._cache_options = options.empty? ? nil : options\n end", "def cache(options = {})\n self._cache =\n options.delete(:cache_store) ||\n ActiveModelSerializers.config.cache_store ||\n ActiveSupport::Cache.lookup_store(:null_store)\n self._cache_key = options.delete(:key)\n self._cache_only = options.delete(:only)\n self._cache_except = options.delete(:except)\n self._cache_options = options.empty? ? nil : options\n end", "def cache\n if Esi.config.cache.nil?\n @cache ||= ActiveSupport::Cache::NullStore.new\n else\n Esi.config.cache\n end\n end", "def base_cache_manager=(manager)\n @cache_manager = manager\n end", "def cache(&block)\n if ActiveRecord::Base.configurations.blank?\n yield\n else\n self.connection_proxy.cache(&block)\n end\n end", "def cache_store; end", "def cache_store; end", "def cache=(_arg0); end", "def cache=(_arg0); end", "def cache=(_arg0); end", "def cache=(_arg0); end", "def set_cache(cache_data)\n cache_data.each do |id, data|\n Memcache.write(@id_to_cache_key_map[id][:kit], data, get_cache_expiry)\n end\n end", "def set_auto_caching\n self.vdo_caching = 0\n self.auto_caching = 1\n end", "def cache_store_type\n \"memcache\"\n end", "def update_cache(ticket, cache)\n cache[ticket[:spacekey]] = ticket[:id] if seen?(ticket, cache)\n cache\n end", "def default_adapter=(adapter); end", "def default_adapter=(adapter); end", "def default_adapter=(adapter); end", "def set_keycache(key,encoded_key,expires = 3600)\n @keycache = {\n :expires => Time.now.to_i + expires,\n :key => key,\n :encoded_key => encoded_key\n }\n write_settings\n end", "def cache!\n @@cache\n end", "def escribe_cache\n Rails.cache.write(\"cache_service_#{id}\", true, :expires_in => 1.week)\n end", "def initialize(cache = Global.cache)\n @cache = cache.new\n end", "def cache_store\n return nil if _cache.nil?\n return _cache if _cache.class != ActiveSupport::Cache::NullStore\n if ActiveModelSerializers.config.cache_store\n self._cache = ActiveModelSerializers.config.cache_store\n else\n nil\n end\n end", "def cache_store\n return nil if _cache.nil?\n return _cache if _cache.class != ActiveSupport::Cache::NullStore\n if ActiveModelSerializers.config.cache_store\n self._cache = ActiveModelSerializers.config.cache_store\n else\n nil\n end\n end", "def cache\n @cache ||= ::Shopidav::Cache.new(site)\n end", "def cache_set(ck, obj)\n @cache_store.set(ck, obj, @cache_ttl)\n end", "def initialize api_key, region, cache_store = {}, rate_limiter = nil\n @cache_store = cache_store\n @rate_limiter = rate_limiter\n raise InvalidCacheStore if cached? && !store.is_a?(Redis)\n @api_key = api_key\n @region = region\n end", "def cache\n @__cache ||= Cache.new self\n end", "def adapter\n request_cache.get(\"#{@env['HTTP_X_REQUEST_ID']}.adapter\")\n end", "def cache_store_type\n \"dummy\"\n end", "def initialize cache = nil\n if cache.is_a? String\n @cache = FileCache.new(cache)\n elsif cache\n @cache = cache\n else\n @cache = NilCache.new\n end\n\n # initialize default #when_auth\n @get_auth_details = lambda do |abs_url, realm|\n if @user and @pass\n [@user, @pass]\n else\n nil\n end\n end\n end", "def cache_setup(hostname, username, appname, cachename)\n options[:namespace] = [\n 'ramaze', hostname, username, appname, cachename\n ].compact.join(':')\n redis_connection = ::Redis.new\n @client = ::Redis::Namespace.new(options[:namespace], redis: redis_connection)\n end", "def cache( object = nil )\n return @cache unless object\n @cache[ object.id ] = object\n end", "def cache\n @cache ||= Flareshow::Cache.new\n end", "def set_article\n @article = Rails.cache.fetch \"article-#{params[:id]}\" do\n Article.find(params[:id])\n end\n end", "def cache_impression\n impressionable.impressioners_ids.add(user_id)\n end", "def set_account_cache(account, raw_token)\n Authentication::RedisStore.instance.json_set(raw_token, data_to_cache(account))\n return {raw_token => data_to_cache(account)}\n end", "def set_redis_as_cache_storage\n # https://blog.appsignal.com/2018/04/17/rails-built-in-cache-stores.html\n # https://www.engineyard.com/blog/rails-5-2-redis-cache-store\n # config.cache_storage = :redis_cache_store, { driver: :hiredis } # , url: \"redis://redis:6379/0\" }\n end", "def interface_cache; end", "def cache(new_cache = nil)\n @cache = new_cache if new_cache\n @cache\n end", "def disable_caching=(_arg0); end", "def cache\n if self.cache_store\n self.cache_store\n else\n self.cache_store = :file_store, root.join(\"tmp\").to_s\n self.cache_store\n end\n end", "def cache_attribute(attribute, by: :id, unique: true)\n cache_attribute_by_alias(attribute, alias_name: attribute, by: by, unique: unique)\n end", "def adapter(adapter, options = {}, &block)\n case adapter\n when Symbol\n use(Adapters.const_get(adapter), options, &block)\n when Class\n use(adapter, options, &block)\n else\n raise ArgumentError, 'Adapter must be a Moneta store' unless adapter.respond_to?(:load) && adapter.respond_to?(:store)\n raise ArgumentError, 'No options allowed' unless options.empty?\n @proxies.unshift adapter\n nil\n end\n end", "def set_manual_caching\n self.vdo_caching = 0\n self.auto_caching = 0\n end", "def cache_object=(new_cache_object)\n @cache_object = new_cache_object\n end", "def set_affiliate\n @affiliate = Affiliate.find(params[:id])\n end", "def cache\n @options[:cache]\n end", "def rails_cache_id\n Apartment::Tenant.current\n end", "def set_cms_affiliation\n @cms_affiliation = Cms::Affiliation.find(params[:id])\n end", "def cache(key)\n if !@cache_client\n # no cache client\n return yield self\n end\n\n if result = @cache_client.get(key)\n # cache hit\n result\n else\n #cache miss\n result = yield self\n @cache_client.set(key, result)\n result\n end\n end", "def cache(key, options = {}, &block)\n if cache_configured?\n cache_store.fetch(ActiveSupport::Cache.expand_cache_key(key, :controller), options, &block)\n else\n yield\n end\n end", "def initialize\n @memory_store = ActiveSupport::Cache::MemoryStore.new\n end", "def save_client_cache\n self.client_cache = @client.cache\n end", "def adapter=(adapter_name)\n adapter_name = adapter_name.to_s\n adapter_name << '_adapter' unless adapter_name =~ /_adapter$/\n adapter_const = adapter_name.pascalize\n\n @adapter = AutomationObject::Driver.const_get(adapter_const.to_s)::Driver\n end", "def set_show_adapter\n @show_adapter = ShowAdapter.find(params[:id])\n end", "def enable_caching(*args)\n self.caching_enabled = args.size > 0 ? args.first : true\n end", "def put(cache_method, value)\n cache.send(\"#{cache_method}=\", value)\n end", "def use_adaptor! base, object\n base.class.send :include, adaptor_for(object)\n end", "def cache_client\n @m ||= Mutex.new\n @m.synchronize do\n if instance_variable_defined?(:@cache_client)\n @cache_client\n else\n dir = Rails.root.join(CacheDirectory.find_by(name: 'efs_twitter_user')&.dir || 'tmp/efs_cache')\n FileUtils.mkdir_p(dir) unless File.exists?(dir)\n options = {expires_in: 1.month, race_condition_ttl: 5.minutes}\n @cache_client = ActiveSupport::Cache::FileStore.new(dir, options)\n end\n end\n end", "def cache\n @cache ||= build_cache\n end", "def cache(opts = {}, &block)\n expiration_time = (opts[:expires_in] || default_expire_time).to_i\n stale_time = (opts[:stale_for] || default_stale_if_error_time).to_i\n cache_key = opts[:key]\n\n set_headers(expiration_time, stale_time)\n\n if expiration_time > 0\n ::Rails.cache.fetch(cache_key, raw: true, expires_in: expiration_time) do\n block.call.to_json\n end\n else\n block.call.to_json\n end\n end", "def adapter=(v)\n cfg_set(:adapter, v)\n end", "def adapter=(v)\n cfg_set(:adapter, v)\n end", "def set_product_cach\n @product_cach = ProductCache.find(params[:id])\n end", "def cache\n @cache ||= MemoryCache.new\n end", "def adapter\n @adapter ||= adapter_class.new configuration\n end", "def cache_class(options={})\n @cache_class ||= {}\n return @cache_class[options[:cache] || self.cache] if @cache_class[options[:cache] || self.cache]\n \n @cache_class[options[:cache] || self.cache] = if self.cache\n Cache.const_get((options[:cache] || self.cache).to_s.gsub(/(?:^|_)(.)/) { $1.upcase })\n else\n Cache::NoCache\n end\n end", "def mock_affiliate(stubs={})\n @mock_affiliate ||= mock_model(Affiliate, stubs)\n end", "def enable_cache(type)\n raise Train::UnknownCacheType, \"#{type} is not a valid cache type\" unless @cache_enabled.keys.include?(type.to_sym)\n\n @cache_enabled[type.to_sym] = true\n end", "def update_cache\n return '' if disabled?\n\n key = \"#{identity_cache_key}:#{short_sha1}:#{Time.now.to_f}\"\n ArCache.write(identity_cache_key, key, raw: true, expires_in: 20.years)\n key\n end", "def set_affiliate\n @affiliate = Affiliate.find(params[:id])\n end", "def set_affiliate\n @affiliate = Affiliate.find(params[:id])\n end", "def initialize(adapter)\n @adapter = adapter\n end", "def cache_store(*args)\n super { |key, value| @store[key] = value }\n end", "def get_cache_object\n return @cache_obj unless @cache_obj == nil\n @cache_obj = ChaiIo::Cache::RedisCache.new\n @cache_obj\n end", "def adapters\n @adapters ||= {}\n end", "def set_cache_flag\n @cache_flag = CacheFlag.find(params[:id])\n end", "def set_advertiser\n @advertiser = Advertiser.find(params[:id])\n end", "def cache(key, &block)\n fail 'Block required!' unless block_given?\n Rails.cache.fetch(key, cache_config, &block)\n end" ]
[ "0.7985402", "0.5877068", "0.5712947", "0.565489", "0.5530371", "0.5415116", "0.5412614", "0.52439725", "0.51875204", "0.5162303", "0.5105361", "0.5105361", "0.50983346", "0.5032008", "0.5017104", "0.5003646", "0.49907756", "0.4945278", "0.49392638", "0.49392638", "0.4909831", "0.4909831", "0.48935494", "0.48348057", "0.48252273", "0.48250905", "0.48250905", "0.48007116", "0.48007116", "0.48007116", "0.48007116", "0.4781719", "0.47525638", "0.47304878", "0.47248828", "0.47240794", "0.47240794", "0.47240794", "0.47131035", "0.47120085", "0.47114915", "0.47049657", "0.4699187", "0.4699187", "0.46899348", "0.4685934", "0.4658182", "0.46034548", "0.4594351", "0.45939434", "0.45835608", "0.45705655", "0.45666313", "0.454686", "0.45386937", "0.4535167", "0.45334756", "0.4528925", "0.45169696", "0.4501588", "0.44977698", "0.4494399", "0.44936144", "0.44601595", "0.44520172", "0.4448414", "0.44359916", "0.4431142", "0.44268256", "0.4412502", "0.44115007", "0.44082034", "0.44080448", "0.44075552", "0.43982953", "0.43926233", "0.43881035", "0.43834373", "0.43783808", "0.4370139", "0.4365969", "0.4353303", "0.43480167", "0.4340236", "0.43349588", "0.4324224", "0.43231854", "0.43183243", "0.43083516", "0.4307626", "0.43062145", "0.42914113", "0.42914113", "0.4291386", "0.42911178", "0.42878184", "0.42823434", "0.42782962", "0.42774382", "0.42721835" ]
0.8116999
0
Cache retrieval and miss resolver primitive; given a key it will try to retrieve the associated value from the cache otherwise it will return the value of the execution of the block. == Parameters +key+ A cache key string
def fetch(key, &block) result = cache.read(key) if should_cache? if result.nil? if block_given? ActiveRecord::Base.connection.with_master do result = yield end result = map_cached_nil_for(result) if should_cache? cache.write(key, result) end end logger.debug "[IdentityCache] cache miss for #{key}" else logger.debug "[IdentityCache] cache hit for #{key}" end unmap_cached_nil_for(result) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_cached( key, &block )\n \n # have a look in the cache\n value = fetch( key )\n\n # Cache HIT?\n return value unless value.nil?\n\n # Cache MISS : execute the block\n value = block.call( key )\n\n # Store value in the cache\n return store( key, value )\n end", "def fetch(*key)\n @cache[key] ||= yield\n end", "def fetch(*key)\n if block_given?\n @cache[key] ||= yield\n else\n @cache[key]\n end\n end", "def cached_fetch(key)\n fetch(key) do\n return yield unless h = self[:cache]\n Sequel.synchronize{return h[key] if h.has_key?(key)}\n value = yield\n Sequel.synchronize{h[key] = value}\n end\n end", "def cache key\n begin\n if expired?(key)\n content = Proc.new { yield }.call\n set( key, content )\n end\n content ||= get( key )\n return content\n rescue LocalJumpError\n return nil\n end\n end", "def cache_fetch(key, expires_in:, &block)\n if ret = mload(key)\n ret\n else\n val = block.call\n mdump(key, val)\n expire(key, expires_in)\n val\n end\n end", "def get(key)\n @cache[key]\n end", "def cached_lookup(key, default, &block)\n if cache_has_key(key)\n retval = cached_value(key)\n else\n retval = yield key, default\n cache(key, retval)\n end\n retval\nend", "def fetch(key)\n @monitor.synchronize do\n found, value = get(key)\n found ? value : store(key, yield)\n end\n end", "def cache_get(key)\n nil\n end", "def get(key)\n @cache[key]\n end", "def value\n v = connection.get(key)\n rescue Memcached::NotFound\n if block\n value = block.call\n value\n end\n end", "def call_with_cache(key)\n cache.key?(key) ? cache[key] : cache[key] = fetch(key).call\n end", "def cache_fetch(key, default = nil)\n # Retrieve the data and return it\n record = @store[:key => namespaced(key)]\n record.value rescue default\n end", "def retrieve(key)\n raise NotImplementedError.new 'Implement retrieve(key) in your CacheManager'\n end", "def cache(key)\n if !@cache_client\n # no cache client\n return yield self\n end\n\n if result = @cache_client.get(key)\n # cache hit\n result\n else\n #cache miss\n result = yield self\n @cache_client.set(key, result)\n result\n end\n end", "def get(key, expires_in = 0, &block)\n\n #look for the cache item in the store\n items = @store.select { |i| i[:key] == build_key(key) }\n item = if !items.empty? then items[0] else nil end\n #check if a valid item was found in the store\n if item == nil || (item[:expires] != nil && item[:expires] <= Time.now.utc)\n #a valid item wasn't found so check if a hydration block was specified.\n if block_given?\n #create the item from the block\n value = yield\n #put the item in the store\n set(build_key(key), value, expires_in)\n return value\n else\n #no hydration block was specified\n\n #check if an expired item was found\n if item != nil\n #remove the expired item from the store\n remove(build_key(key))\n end\n return nil\n end\n end\n\n #return the item\n return item[:value]\n end", "def fetch( key, &block )\n fail NotImplementedError\n end", "def cache_read(key)\n @mutex.synchronize do\n @cache[key]\n end\n end", "def cache_read(key: cache_key, **)\n Rails.cache.read(key, namespace: namespace) if validate_key(key)\n end", "def cache key, opts = {}\n if opts[:ttl]\n # cache globaly if ttl provided\n Lux.cache.fetch(key, opts) { yield }\n else\n data = @var[:cache] ||= {}\n data = @var[:cache][key]\n return data if data\n @var[:cache][key] = yield\n end\n end", "def read(key)\n @cache[key]\n end", "def fetch(keyspace, options={}, &blk)\n key = @timestamp_manager.current_key(keyspace)\n tags = [\"cache_keyspace:#{keyspace.root}\"]\n\n # happy path: see if the value is there in the key we expect\n value = @storage.read(key, options) if key.present?\n if !value.nil?\n metrics(:increment, 'read.present', tags: tags)\n log(:debug, \"Read value from key: '#{key}'\")\n return value\n end\n\n metrics(:increment, 'read.not-present', tags: tags)\n log(:debug, \"Cache key `#{key}` not present.\")\n\n # try to generate a new value if another process already isn't\n if block_given?\n new_value = generate_and_store(keyspace, options, tags, &blk)\n return new_value unless new_value.nil?\n end\n\n # attempt to fall back to the last known value\n value = last_known_value(keyspace, options, tags)\n return value if value.present?\n\n # wait for the other process if a last known value isn't there\n if key.present?\n return time('wait.run', tags: tags) do\n wait_for_new_value(keyspace, options, tags)\n end\n end\n\n # At this point, there's no key, value, last known key, or last known value.\n # A block wasn't given or couldn't create a non-nil value making it\n # impossible to do anything else, so bail\n if !key.present?\n metrics(:increment, 'no-key.give-up')\n log(:warn, \"Giving up fetching cache keyspace for root `#{keyspace.root}`. No key could be generated.\")\n end\n nil\n end", "def fetch(key, ttl = nil, req_options = nil)\n req_options = req_options.nil? ? CACHE_NILS : req_options.merge(CACHE_NILS) if cache_nils\n val = get(key, req_options)\n return val unless block_given? && not_found?(val)\n\n new_val = yield\n add(key, new_val, ttl_or_default(ttl), req_options)\n new_val\n end", "def cache_get(ck)\n cache_op(:get, ck)\n end", "def cache(key, action, cache_store)\n binding.pry\n cache_key = key.to_s + \"_\" + action.to_s\n if cache_store[cache_key]\n return cache_store[cache_key]\n else\n result = yield # run the block\n cache_store[cache_key] = result # store it in our cache\n return result\n end\nend", "def call(key, ttl: TTL)\n key = namespaced_key(key)\n\n fetch(key) || cache(key, yield, ttl)\n end", "def fetch(&block)\n Rails.cache.fetch(cache_key, &block)\n end", "def get(key, lifetime: 2**32, dirty: false, &block)\n if block_given?\n return @hash[key][:value] if (dirty || @dirty) && locked? && expired?(key) && @hash.key?(key)\n synchronized { calc(key, lifetime, &block) }\n else\n rec = @hash[key]\n if expired?(key)\n return rec[:value] if dirty || @dirty\n @hash.delete(key)\n rec = nil\n end\n raise 'The key is absent in the cache' if rec.nil?\n rec[:value]\n end\n end", "def get_or_cache(key, expiry = 0, &block)\n return block.call(key) unless servers?\n get(key) || put(key, block.call(key))\n end", "def get(*keys)\n unless keys.length == @num_keys\n arg_count = keys.length\n fail \"Opscode::Rackspace::Monitoring::CMCache.get: Key count mismatch (#{@num_keys}:#{arg_count})\"\n end\n\n unless defined?(@cache)\n return nil\n end\n\n eval_str = '@cache'\n (0...@num_keys).each do |i|\n key = keys[i]\n cval = eval(eval_str)\n unless cval.key?(key.to_s)\n return nil\n end\n\n eval_str += \"[\\\"#{key}\\\"]\"\n end\n\n Chef::Log.debug(\"Opscode::Rackspace::Monitoring::CMCache.get: Returning cached value from #{eval_str}\")\n return eval(eval_str)\n end", "def cache(key)\n return @cache[key] if cached?(key)\n\n @cache[key] = yield\n end", "def fetch(key); end", "def cache(key)\n @lock.synchronize do\n @contents[key] ||= yield\n end\n end", "def cache(key, &block)\n fail 'Block required!' unless block_given?\n Rails.cache.fetch(key, cache_config, &block)\n end", "def read(key)\n return if @expires[key] && @expires[key] < Faulty.current_time\n\n @cache[key]\n end", "def cache(key = nil)\n key ||= BasicCache.caller_name\n key = key.to_sym\n if include? key\n @store[key].value\n else\n value = yield\n @store[key] = TimeCacheItem.new Time.now, value\n value\n end\n end", "def fetch(key)\n now = Time.now.public_send(_kind)\n value = get(key, now)\n\n if value.nil?\n clear_all(key)\n value = set(key, now, set_nil(yield))\n end\n\n unset_nil(value)\n end", "def call(key, ttl: ShopifyClient.config.cache_ttl, &block)\n value = get(key)\n\n if value.nil?\n value = block.()\n\n set(key, value, ttl: ttl)\n end\n\n value\n end", "def get!(key)\n record = object(key)\n return nil unless record\n record.rewrite_cache\n record.value\n end", "def get(key)\n node = @cache[key]\n return -1 if node.nil?\n move_to_head(node)\n node.value\n end", "def get(key)\n return -1 unless @cache.key?(key)\n val = @cache[key]\n @cache.delete(key)\n @cache[key] = val\n val\n end", "def cache_get(k)\n synchronize{@cache[k]}\n end", "def cache_get(key)\n if @cache.key?(key)\n _data, _expire = *cache_read(key)\n if _expire.nil? || Time.now < _expire\n Merb.logger.info(\"cache: hit (#{key})\")\n return _data\n end\n @mutex.synchronize do @cache.delete(key) end\n end\n Merb.logger.info(\"cache: miss (#{key})\")\n nil\n end", "def cache key, value=nil, &block\n return self[key] if self.has_key?(key)\n @lock.write_sync{ @data[key] = block_given? ? yield() : value }\n end", "def cache(key = nil, &code)\n key ||= Stash.caller_name\n @store[key.to_sym] ||= code.call\n end", "def fetch(key, default = nil)\n return default unless entry = @cache[\"#{@cache_name}:#{key}\"]\n return entry[:value] if entry[:expires].nil? || entry[:expires] > Time.now\n @cache.delete(\"#{@cache_name}:#{key}\")\n default\n end", "def cache_fetch(key, default = nil)\n @moneta.fetch(key, default)\n end", "def cache_get(key)\n data = @memcache.get(key)\n Merb.logger.info(\"cache: #{data.nil? ? \"miss\" : \"hit\"} (#{key})\")\n data\n end", "def get(key)\n mon_synchronize do\n perform [\"get\", key]\n end\n end", "def get(key)\n mon_synchronize do\n perform [\"get\", key]\n end\n end", "def get(resource, key)\n @cache[resource][key]\n end", "def cache_fetch(key, default = nil)\n nkey = namespaced(key)\n\n # Delete expired rows\n @dataset.select.filter(:key => nkey) do\n expires < Time.now\n end.delete\n\n # Get remaining row (if any)\n result = @dataset.select(:value).filter(:key => nkey).limit(1)\n\n if result.empty?\n return default\n else\n return deserialize(result.first[:value])\n end\n end", "def cache_fetch(key, default = nil)\n nkey = namespaced(key)\n\n # Delete expired rows\n @dataset.select.filter(:key => nkey) do\n expires < Time.now\n end.delete\n\n # Get remaining row (if any)\n result = @dataset.select(:value).filter(:key => nkey).limit(1)\n\n if result.empty?\n return default\n else\n return deserialize(result.first[:value])\n end\n end", "def [](key)\n File.read(cache_path(key))\n rescue Errno::ENOENT\n nil\n end", "def get(key)\n return nil unless @items.key?(key)\n @items[key].call\n end", "def fetch(key, &block)\n store.compute_if_absent(key, &block)\n end", "def fetch(key, cache_fetcher_options = {})\n if should_use_cache?\n unmap_cached_nil_for(cache.fetch(key, cache_fetcher_options) do\n map_cached_nil_for(yield)\n end)\n else\n yield\n end\n end", "def fetch(key, *args, &block)\n value = self[key]\n return value unless value.nil?\n\n @parameters.fetch(key, *args, &block)\n end", "def fetch(key)\n result.fetch(key)\n end", "def force_get(key)\n # Return nothing if not in the cache or it has expired.\n return if key.nil?\n\n entry = @cache[key]\n return unless entry\n entry.object\n end", "def get(key); end", "def get(key); end", "def get(key); end", "def get(key); end", "def fetch( key )\n key = key.to_s.strip unless key.nil?\n raise \"Invalid key\" if key.nil? or key == ''\n\n id,value,hits = @db.get_first_row(\n \"SELECT id,value,hits \"+\n \"FROM #{TABLE_NAME} \"+\n \"WHERE key=?\",\n key.to_s.strip\n )\n\n # Return nil if there is cache MISS.\n return nil if value.nil?\n \n # Increment the number of hits\n if @count_hits\n @db.execute(\n \"UPDATE #{TABLE_NAME} SET hits=?, updated_at=? WHERE id=?\",\n hits.to_i+1, Time.now.to_i, id\n )\n end\n\n # Otherwise if there is a HIT, parse the YAML into an object\n return YAML::load(value)\n end", "def get_cache(key)\n treecache.fetch(key)\n end", "def fetch(key, options = nil) \n if caching_enabled\n result = Rails.cache.fetch(key, options) do\n yield\n end\n Rails.cache.delete(key) unless result\n else\n result = yield\n end\n result\n end", "def fetch key, exp=60, &block\n get(key) or block.().tap {|x| set(key, x, exp)}\n end", "def fetch(key, force: false)\n if force\n value = yield if block_given?\n write(key, value) if value\n else\n value = @cache.read(key)\n unless value\n value = yield if block_given?\n @cache.write(key, value) if value\n end\n end\n value\n end", "def cache_fetch(key, default = nil)\n value = @store[key]\n value.nil? ? default : value\n rescue ::MemCache::MemCacheError => e\n Log.error(e)\n nil\n end", "def cache_get(key)\n cache_file = @config[:cache_directory] / \"#{key}.cache\"\n if File.file?(cache_file)\n _data, _expire = Marshal.load(cache_read(cache_file))\n if _expire.nil? || Time.now < _expire\n Merb.logger.info(\"cache: hit (#{key})\")\n return _data\n end\n FileUtils.rm_f(cache_file)\n end\n Merb.logger.info(\"cache: miss (#{key})\")\n nil\n end", "def get(key, &block)\n @store.synchronize do\n @store.get(key, &block)\n end\n end", "def get key; call key; end", "def [](key)\n resolve(key)\n end", "def fetch_from_cache(id=nil, force_write=false)\n key = cache_key id\n expiration = self.expires_in\n Rails.logger.debug \"#{self.name} cache_key will be #{key}, expiration #{expiration}, forced: #{force_write}\"\n value = Rails.cache.fetch(\n key,\n :expires_in => expiration,\n :force => force_write\n ) do\n if block_given?\n response = yield\n response = process_response_before_caching(response, {id: id, force_write: force_write})\n cached_entry = response.nil? ? NilClass : response\n cached_entry\n end\n end\n (value == NilClass) ? nil : value\n end", "def lookup(key)\n return nil if @capacity <= 0\n\n @cache_mutex.synchronize do\n return nil unless @map.include?(key)\n\n element = @map.delete(key)\n return nil if element.stale?(@timeout)\n\n @map[key] = element\n\n element.value\n end\n end", "def cache_key(load_key)\n load_key\n end", "def get(key)\n code = @backend.get(key)\n return nil unless code\n parser.decode(code)\n rescue ::Memcached::Error\n nil\n end", "def cached_client(type, key)\n return yield unless cache_enabled?(type)\n\n @cache[type][key] ||= yield\n end", "def get(key, ttl=60)\n if !enabled?\n return (block_given? ? yield : nil)\n end\n k = namespaced key\n cached = @r[k]\n return JSON.parse(cached) if cached\n if block_given?\n val = yield\n put(key, val, ttl)\n val\n else\n nil\n end\n end", "def fetch(key, value = nil)\n if read = self[key]\n return read\n end\n block_given? ? yield(key) : value\n end", "def get(key)\n # Return nothing if not in the cache or it has expired.\n return if key.nil?\n\n entry = @cache[key]\n return unless entry\n return if entry.expired?\n\n # Otherwise return the cached object.\n # We don't delete the cached entry because we might need to force its use if its expired and offline\n entry.object\n end", "def value(key)\n return @memoized[key] if @memoized.include?(key)\n\n @memoized[key] = if respond_to?(key)\n value = __send__(key)\n\n if parts?(key)\n parts_for(key)\n else\n value\n end\n else\n @object[key]\n end\n end", "def get(key, &block)\n return if key.nil?\n @_lock.synchronize do\n if !has_key?(key.to_sym) && block_given?\n value = yield\n _publish(key.to_sym, :set, nil, value)\n store(key.to_sym, value)\n else\n self[key.to_sym]\n end\n end\n end", "def fetch(*key); end", "def cache_fetch(key, default = nil)\n value = @client.get(key)\n value.nil? ? default : ::Marshal.load(value)\n end", "def cached(key:, ttl: 5.minutes)\n redis = CertManager::Configuration.redis_client\n redis_key = \"User_#{id}_#{key}\"\n value = redis.get(redis_key)\n value = JSON.parse(value) if value\n unless value\n value = yield\n redis.setex(redis_key, ttl, value.to_json)\n end\n value\n end", "def get_cached(cache_key, proc, expiry_time = 5.minute)\n @data = Rails.cache.fetch(cache_key) || proc.call\n @data && Rails.cache.write(cache_key, @data, expires_in: expiry_time)\n\n @data\n end", "def find_cached_entry(key, name, options)\n instrument(:read, name, options) do |payload|\n payload[:super_operation] = :fetch if payload\n res = read_entry(key, options)\n payload[:hit] = !!res if payload\n res\n end\n end", "def cache_get(key)\n @messages[key] if @messages.has_key?(key)\n end", "def fetch_from_cache\n get_cache_object().get make_key\n end", "def get_set_memcached(key, ttl = 0, marshaling = true)\n raise 'block not given to get_set_memcached' unless block_given?\n\n Rails.cache.fetch(key, {expires_in: get_ttl(ttl), raw: !marshaling}) do\n yield\n end\n\n rescue => exc\n Rails.logger.error { \"MEMCACHE-ERROR: fetch: K: #{key.inspect}. M: #{exc.message}, I: #{exc.inspect}\" }\n nil\n end", "def get_set_memcached(key, ttl = 0, marshaling = true)\n raise 'block not given to get_set_memcached' unless block_given?\n\n Rails.cache.fetch(key, {expires_in: get_ttl(ttl), raw: !marshaling}) do\n yield\n end\n\n rescue => exc\n Rails.logger.error { \"MEMCACHE-ERROR: fetch: K: #{key.inspect}. M: #{exc.message}, I: #{exc.inspect}\" }\n nil\n end", "def cache_get(target_class, *args)\n key = args.dup << target_class\n value_wrapper = @@cache[key]\n if value_wrapper.nil?\n #@@misses += 1\n #puts \"miss (#{@@hits}, #{@@misses}, #{(100.0 * @@hits / (@@hits + @@misses)).round(0)}%)\"\n return nil\n end\n #@@hits += 1\n #puts \"hit (#{@@hits}, #{@@misses}, #{(100.0 * @@hits / (@@hits + @@misses)).round(0)}%)\"\n value_wrapper[0]\n end", "def get_cache(key: nil, prefix: nil, **additional_args)\n fallback = additional_args[:fallback]\n key = \"#{prefix}::#{key}\" if prefix\n value = @cache.get(key) if @cache\n value || fallback\n end", "def get_cached_value(key)\n case key\n when String\n key =~ /^\\$/ ? @cached_values.fetch(key.gsub(/[\\$\\{\\}]/, ''), key) : key\n when Hash\n key.inject({}) do |hash, (k, v)|\n k = k.to_s if [Float, Integer].include? k.class\n if v.is_a?(String)\n hash.merge(@cached_values.fetch(k.gsub(/[\\$\\{\\}]/, ''), k) => @cached_values.fetch(v.gsub(/[\\$\\{\\}]/, ''), v))\n else\n hash.merge(@cached_values.fetch(k.gsub(/[\\$\\{\\}]/, ''), k) => v)\n end\n end\n when Array\n key.collect do |k|\n k.is_a?(String) ? @cached_values.fetch(k.gsub(/[\\$\\{\\}]/, ''), k) : k\n end\n else\n key\n end\n end", "def cache(key)\n @cache ||= {}\n timestamp, data = @cache[key]\n if timestamp && data && Time.now - timestamp < 1\n puts 'CACHE HIT'\n data\n else\n data = yield\n @cache[key] = [Time.now, data]\n data\n end\n end", "def get(key, expires_in = 0, &block)\n\n end", "def get_value (key)\r\n @redis.get key\r\n end" ]
[ "0.76635665", "0.75998867", "0.75475943", "0.74763376", "0.7297723", "0.7232896", "0.72085845", "0.7202707", "0.7192883", "0.7160279", "0.71391076", "0.7123286", "0.7102351", "0.70252365", "0.69601166", "0.6928163", "0.69242096", "0.6866633", "0.6859613", "0.68550414", "0.68515533", "0.6825164", "0.6810216", "0.6801973", "0.6790477", "0.6788896", "0.6774875", "0.67730343", "0.6771686", "0.67693573", "0.676722", "0.67589134", "0.6748784", "0.67460924", "0.6731521", "0.67199767", "0.670583", "0.670583", "0.66859573", "0.66685003", "0.6667105", "0.66545916", "0.6653164", "0.665116", "0.66395736", "0.66107684", "0.66009086", "0.6578362", "0.6568277", "0.6552909", "0.6552909", "0.6542926", "0.6537082", "0.6537082", "0.65120417", "0.6511169", "0.6510358", "0.6509536", "0.6506717", "0.6502384", "0.6493872", "0.6451363", "0.6451363", "0.6451363", "0.6451363", "0.6437609", "0.6425617", "0.6417125", "0.6411967", "0.64061266", "0.64006096", "0.63955927", "0.63885075", "0.63808066", "0.63532275", "0.6352741", "0.63387966", "0.6337513", "0.6325361", "0.6320422", "0.6317739", "0.631618", "0.63108563", "0.6303273", "0.6298188", "0.62875044", "0.62854767", "0.6277112", "0.6274849", "0.62738734", "0.62733763", "0.626216", "0.6255797", "0.6255797", "0.62532425", "0.6252607", "0.62487674", "0.6240726", "0.6239308", "0.6220481" ]
0.70476294
13
Same as +fetch+, except that it will try a collection of keys, using the multiget operation of the cache adaptor == Parameters +keys+ A collection of key strings
def fetch_multi(*keys, &block) return {} if keys.size == 0 result = {} result = cache.read_multi(*keys) if should_cache? missed_keys = keys - result.select {|key, value| value.present? }.keys if missed_keys.size > 0 if block_given? replacement_results = nil ActiveRecord::Base.connection.with_master do replacement_results = yield missed_keys end missed_keys.zip(replacement_results) do |(key, replacement_result)| if should_cache? replacement_result = map_cached_nil_for(replacement_result ) cache.write(key, replacement_result) logger.debug "[IdentityCache] cache miss for #{key} (multi)" end result[key] = replacement_result end end else result.keys.each do |key| logger.debug "[IdentityCache] cache hit for #{key} (multi)" end end result.keys.each do |key| result[key] = unmap_cached_nil_for(result[key]) end result end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fetch_multi(*keys)\n keys.flatten!(1)\n return {} if keys.empty?\n\n result = if should_use_cache?\n fetch_in_batches(keys.uniq) do |missed_keys|\n results = yield missed_keys\n results.map { |e| map_cached_nil_for(e) }\n end\n else\n results = yield keys\n Hash[keys.zip(results)]\n end\n\n result.each do |key, value|\n result[key] = unmap_cached_nil_for(value)\n end\n\n result\n end", "def get(keys)\n log(\"get :Cache, #{keys.inspect}\")\n connection.multi_get(:Cache, Array(keys)).values.map { |v| v['blob'] }\n end", "def multiget(keys)\n data = @client.get_multi(keys)\n keys.map { |k| Marshal.load data[k] }\n end", "def get_multi(*keys)\n codes = @backend.get(keys)\n return [] if codes.empty?\n parser.decode_multi(codes.values)\n rescue ::Memcached::Error\n nil\n end", "def mget(*keys); end", "def get_set_memcached_multi(keys, ttl = 0, marshaling = true)\n raise 'block not given to get_set_memcached' unless block_given?\n\n Rails.cache.fetch_multi(*keys, {expires_in: get_ttl(ttl), raw: !marshaling}) do\n yield\n end\n\n rescue => exc\n Rails.logger.error { \"MEMCACHE-ERROR: fetch_multi: K: #{keys.inspect}. M: #{exc.message}, I: #{exc.inspect}\" }\n nil\n end", "def read_multi(keys, _marshaling = true)\n t_start = Time.now.to_f\n ret = Rails.cache.read_multi(*keys)\n Rails.logger.debug \"Memcache multi get took #{Time.now.to_f - t_start} s\"\n return ret\n rescue => exc\n Rails.logger.error { \"MEMCACHE-ERROR: read_multi: K: #{keys}. M: #{exc.message}, I: #{exc.inspect}\" }\n return {}\n end", "def mget(*keys, &blk); end", "def get(*keys)\n unless keys.length == @num_keys\n arg_count = keys.length\n fail \"Opscode::Rackspace::Monitoring::CMCache.get: Key count mismatch (#{@num_keys}:#{arg_count})\"\n end\n\n unless defined?(@cache)\n return nil\n end\n\n eval_str = '@cache'\n (0...@num_keys).each do |i|\n key = keys[i]\n cval = eval(eval_str)\n unless cval.key?(key.to_s)\n return nil\n end\n\n eval_str += \"[\\\"#{key}\\\"]\"\n end\n\n Chef::Log.debug(\"Opscode::Rackspace::Monitoring::CMCache.get: Returning cached value from #{eval_str}\")\n return eval(eval_str)\n end", "def prefetch_multiple_keys(cache_keys)\n if controller.should_refresh_cache or !Rails.configuration.action_controller.perform_caching\n {}\n else\n Rails.cache.read_multi(cache_keys.collect { |key| timestamp_key(key[0],key[1]) })\n end\n end", "def fetch_items(*keys, **kwargs)\n keys.flatten.map do |key|\n fetch_item(key, method: :all, **kwargs)\n end.flatten\n end", "def fetch_all(key); end", "def fetch_multi(*ids)\n options = ids.extract_options!\n if IdentityCache.should_cache?\n\n require_if_necessary do\n cache_keys = ids.map {|id| rails_cache_key(id) }\n key_to_id_map = Hash[ cache_keys.zip(ids) ]\n\n objects_by_key = IdentityCache.fetch_multi(*key_to_id_map.keys) do |unresolved_keys|\n ids = unresolved_keys.map {|key| key_to_id_map[key] }\n records = find_batch(ids, options)\n records.compact.each(&:populate_association_caches)\n records\n end\n\n cache_keys.map {|key| objects_by_key[key] }.compact\n end\n\n else\n find_batch(ids, options)\n end\n end", "def mget(*keys, &blk)\n keys.flatten!(1)\n send_command([:mget, *keys], &blk)\n end", "def fetch(*key); end", "def get(keys, decode=true)\n if keys.is_a? Array\n multi_get(keys, decode).first\n else\n single_get(keys, decode).first\n end\n rescue => e\n tries ||= 0\n raise unless tries < options[:exception_retry_limit] && should_retry(e)\n tries += 1\n retry\n end", "def me_mget( *keys )\n pipelined { keys.each{ |key| me_get( key ) } }\n end", "def get(*keys)\n if keys.size == 0\n nil\n elsif keys.size == 1\n @store[keys.first]\n else\n @store.lget(keys)\n end\n end", "def batch_get(keys, bin_names = nil, options = nil)\n policy = create_policy(options, BatchPolicy, default_batch_policy)\n results = Array.new(keys.length)\n info_flags = INFO1_READ\n\n case bin_names\n when :all, nil, []\n info_flags |= INFO1_GET_ALL\n bin_names = nil\n when :none\n info_flags |= INFO1_NOBINDATA\n bin_names = nil\n end\n\n if policy.use_batch_direct\n key_map = BatchItem.generate_map(keys)\n execute_batch_direct_commands(policy, keys) do |node, batch|\n BatchDirectCommand.new(node, batch, policy, key_map, bin_names, results, info_flags)\n end\n else\n execute_batch_index_commands(policy, keys) do |node, batch|\n BatchIndexCommand.new(node, batch, policy, bin_names, results, info_flags)\n end\n end\n\n results\n end", "def read_multi(*names)\n options = names.extract_options!\n return {} if names == []\n\n keys = names.map{|name| normalize_key(name, options)}\n args = [keys, options]\n args.flatten!\n\n instrument(:read_multi, names) do |payload|\n failsafe(:read_multi, returning: {}) do\n values = with { |c| c.mget(*args) }\n values.map! { |v| v.is_a?(ActiveSupport::Cache::Entry) ? v.value : v }\n\n Hash[names.zip(values)].reject{|k,v| v.nil?}.tap do |result|\n payload[:hits] = result.keys if payload\n end\n end\n end\n end", "def execute_gets_command(stored_keys)\n if(stored_keys == nil)\n return \"You need to specify one key at least. You can specify more than one separated by blank space character.\"\n else\n pStoredKeys = stored_keys.split(\" \")\n return @dalliMemcachedClient.get_multi(pStoredKeys)\n end\n end", "def multi_zget(key, members)\n members = Array(members) unless members.is_a?(Array)\n mon_synchronize do\n perform [\"multi_zget\", key, *members], multi: true, proc: T_MAPINT, args: [members]\n end\n end", "def fetch_values(*key_list, &block)\n if array_index?(key_list)\n key_list.map { |key| fetch(key, &block) }\n elsif block_given?\n __fetch_values__(*key_list) { |key| yield(key) }\n else\n __fetch_values__(*key_list)\n end\n end", "def gets(keys)\n get(keys, true)\n end", "def [](*key_list)\n fetch_or_init_keys(Array(key_list).flatten) { |key| new_collection(key) }\n end", "def fetch_data(key_list)\n data = self\n key_list.each { |key| data = fetch_key_with_initialization(key, data) }\n data\n end", "def me_mget_p( *keys )\n ftr = []\n pipelined { keys.each{ |key| ftr << me_get( key ) } }\n ftr\n end", "def slice(*keys)\n FlexHash[keys.map { |key| [key, fetch(key)] }]\n end", "def multi_zget(key, members)\n members = Array(members) unless members.is_a?(Array)\n mon_synchronize do\n perform [\"multi_zget\", key, *members], :multi => true, :proc => T_MAPINT, :args => [members]\n end\n end", "def fetch_multi(*ids)\n ensure_base_model\n raise_if_scoped\n raise NotImplementedError, \"fetching needs the primary index enabled\" unless primary_cache_index_enabled\n options = ids.extract_options!\n ids.flatten!(1)\n records = if IdentityCache.should_use_cache?\n require_if_necessary do\n cache_keys = ids.map {|id| rails_cache_key(id) }\n key_to_id_map = Hash[ cache_keys.zip(ids) ]\n key_to_record_map = {}\n\n coders_by_key = IdentityCache.fetch_multi(cache_keys) do |unresolved_keys|\n ids = unresolved_keys.map {|key| key_to_id_map[key] }\n records = find_batch(ids)\n key_to_record_map = records.compact.index_by{ |record| rails_cache_key(record.id) }\n records.map {|record| coder_from_record(record) }\n end\n\n cache_keys.map{ |key| key_to_record_map[key] || record_from_coder(coders_by_key[key]) }\n end\n else\n find_batch(ids)\n end\n records.compact!\n prefetch_associations(options[:includes], records) if options[:includes]\n records\n end", "def getMany(*ks)\n\t \tself.ready\n self.evict(*ks) if @evictWhen[:get]\n self.instance_exec(ks, &@getMany)\n end", "def cache_on_keys(*key_arr)\n # normalize arguments\n if key_arr.class == Array\n key_arr.flatten!\n key = key_arr.join(\"_\")\n elsif key_arr.class == String || key_arr.class == Symbol\n key = key_arr.to_s\n key_arr = [key_arr]\n else\n raise ArgumentError, \"passed argument(s), must be a string/symbol or an array of strings/symbols\"\n end \n arg_list = key_arr.map{|k| (k.to_s + \"_arg\")} \n tests = []\n key_arr.each_with_index do |val, index|\n tests << \"rec.#{val} == #{arg_list[index]}\"\n end \n \n # build the methods\n class_eval %{\n def self.find_on_#{key}(#{arg_list.join(\", \")})\n @cache_#{key} ||= {}\n @cache_#{key}[ #{ arg_list.collect{|a| a + '.to_s' }.join(\" + '_'+ \")} ] ||= all.select{|rec| #{tests.join(\" && \")}}\n end \n \n # register this cache as something that needs to be deleted when the cache expires\n register_cache('cache_#{key}') \n }\n end", "def mapped_mget(*keys)\n mget(*keys) do |response|\n result = {}\n response.each do |value|\n key = keys.shift\n result.merge!(key => value) unless value.nil?\n end\n yield result if block_given?\n end\n end", "def fetch(key); end", "def mget(msg_id, keys)\n keys = keys.map{|suffix| key(msg_id, suffix)}\n with_failover { redis.mget(*keys) }\n end", "def fetch(*key)\n @cache[key] ||= yield\n end", "def fetch(*key)\n if block_given?\n @cache[key] ||= yield\n else\n @cache[key]\n end\n end", "def mapped_mget(*keys); end", "def mget(*keys)\n keys.flatten!(1)\n mapped_mget(*keys).values_at(*keys)\n end", "def get(*keys)\n get_from_params(*keys) || get_from_values(*keys)\n end", "def fetch\n\n set_id_to_cache_key_map\n\n cache_keys_to_fetch = []\n @id_to_cache_key_map.each do |_, keys|\n cache_keys_to_fetch.push(keys[:kit])\n end\n\n data_from_cache = Memcache.read_multi(cache_keys_to_fetch)\n\n ids_for_cache_miss = []\n @ids.each do |id|\n ids_for_cache_miss << id if data_from_cache[@id_to_cache_key_map[id][:kit]].nil?\n end\n\n if ids_for_cache_miss.any?\n\n fetch_data_rsp = fetch_from_db(ids_for_cache_miss)\n\n data_to_set = fetch_data_rsp.data || {}\n\n # to ensure we do not always query DB for invalid ids being cached, we would set {} in cache against such ids\n @ids.each do |id|\n data_to_set[id] = {} if data_from_cache[@id_to_cache_key_map[id][:kit]].nil? && data_to_set[id].nil?\n end\n\n set_cache(data_to_set) if fetch_data_rsp.success?\n\n end\n\n @ids.inject({}) do |data, id|\n data[id] = data_from_cache[@id_to_cache_key_map[id][:kit]] || data_to_set[id]\n data\n end\n\n end", "def multi_get(column_family, keys, *columns_and_options)\n column_family, column, sub_column, options = \n extract_and_validate_params(column_family, keys, columns_and_options, READ_DEFAULTS)\n\n hash = _multiget(column_family, keys, column, sub_column, options[:count], options[:start], options[:finish], options[:reversed], options[:consistency])\n # Restore order\n ordered_hash = OrderedHash.new\n keys.each { |key| ordered_hash[key] = hash[key] || (OrderedHash.new if is_super(column_family) and !sub_column) }\n ordered_hash\n end", "def get_many_with_keys(keys)\n keys.map {|key| get_with_key(key)}\n end", "def find_all *keys\n ensure_service!\n lookup_res = service.lookup(*Array(keys).flatten.map(&:to_grpc),\n transaction: @id)\n LookupResults.from_grpc lookup_res, service, nil, @id\n end", "def values_at(*keys)\n values = []\n keys.each {|key| values << fetch(key) }\n values\n end", "def eager_load_keys(keys)\n # Speed up pulls by priming the page's placeholder keys\n end", "def cache_delete(*keys)\n @client.del(*keys)\n end", "def fetch_params(key, *subkeys)\n params[key].instance_eval do\n case subkeys.size\n when 0 then self\n when 1 then self[subkeys.first]\n else subkeys.map{|k| self[k] }\n end\n end\n end", "def cache_delete(key, *keys)\n # Remove a single key\n if keys.empty?\n nkey = namespaced(key)\n result = @dataset.select(:value).filter(:key => nkey).limit(1)\n\n # Ramaze expects nil values\n if result.empty?\n result = nil\n else\n result = deserialize(result.first[:value])\n end\n\n @dataset.filter(:key => nkey).delete\n # Remove multiple keys\n else\n nkeys = [key, keys].flatten.map! { |nkey| namespaced(nkey) }\n result = dataset.select(:value).filter(:key => nkeys)\n\n result.map! do |row|\n deserialize(row[:value])\n end\n\n @dataset.filter(:key => nkeys).delete\n end\n \n return result\n end", "def cache_delete(key, *keys)\n # Remove a single key\n if keys.empty?\n nkey = namespaced(key)\n result = @dataset.select(:value).filter(:key => nkey).limit(1)\n\n # Ramaze expects nil values\n if result.empty?\n result = nil\n else\n result = deserialize(result.first[:value])\n end\n\n @dataset.filter(:key => nkey).delete\n # Remove multiple keys\n else\n nkeys = [key, keys].flatten.map! { |n| namespaced(n) }\n result = dataset.select(:value).filter(:key => nkeys)\n\n result.map! do |row|\n deserialize(row[:value])\n end\n\n @dataset.filter(:key => nkeys).delete\n end\n\n return result\n end", "def _cache(*keys, &block)\n key = _cache_key(keys)\n unless cached = Rails.cache.read( key )\n if block_given?\n cached = yield(block)\n Rails.cache.write(key, cached)\n end\n end\n cached\n end", "def cache_fetch(*args)\n super { |key| @store[key] }\n end", "def fetch_keys_for(keys = EMPTY_ARRAY)\n return [\n with_prefixes_namespaces_targets_key_for(keys),\n with_namespaces_targets_key_for(keys),\n with_prefixes_namespaces_key_for(keys),\n with_namespaces_key_for(keys),\n with_prefixes_key_for(keys),\n with_key_for(keys)\n ]\n end", "def fetch_keys_for(keys = EMPTY_ARRAY)\n return [\n with_prefixes_namespaces_targets_key_for(keys),\n with_namespaces_targets_key_for(keys),\n with_prefixes_namespaces_key_for(keys),\n with_namespaces_key_for(keys),\n with_prefixes_key_for(keys),\n with_key_for(keys)\n ]\n end", "def get(*key)\n key = model.typecast_key(key)\n return if key.any? { |v| v.blank? }\n\n if resource = @cache[key]\n # find cached resource\n resource\n elsif !loaded? && (query.limit || query.offset > 0)\n # current query is exclusive, find resource within the set\n\n # TODO: use a subquery to retrieve the Collection and then match\n # it up against the key. This will require some changes to\n # how subqueries are generated, since the key may be a\n # composite key. In the case of DO adapters, it means subselects\n # like the form \"(a, b) IN(SELECT a,b FROM ...)\", which will\n # require making it so the Query condition key can be a\n # Property or an Array of Property objects\n\n # use the brute force approach until subquery lookups work\n lazy_load\n @cache[key]\n else\n # current query is all inclusive, lookup using normal approach\n first(model.key(repository.name).zip(key).to_hash)\n end\n end", "def fetch(*keys)\n (key = keys.flatten.find { |k| key?(k) }) && find(key) ||\n fail(DocumentNotFoundError.new(keys, document_class))\n end", "def multi_get(column_family, keys, column = nil, sub_column = nil, limit = 100, column_range = ''..'', reversed = false, consistency = Consistency::WEAK)\n OrderedHash[*keys.map do |key| \n [key, get(column_family, key, column, sub_column, limit, column_range, reversed, consistency)]\n end._flatten_once]\n end", "def fetch(*args)\n hash.fetch(*args)\n end", "def get_many(type, key, opts)\n\n opts[:task] ||= self #if task.is_a?(OffTask)\n\n @storage.store.get_many(type, key, opts)\n end", "def get_many(type, key=nil, opts={})\n\n (opts[:task] || task).get_many(type, key, opts)\n end", "def cache_delete(*keys)\n if keys\n keys.each do |key|\n record = @store[:key => namespaced(key)]\n record.delete if record \n end\n end\n end", "def read_multi(names)\n @redis.mget(*names).map{|value| Oj.load(value)}\n end", "def lookup *keys, consistency: nil, transaction: nil, read_time: nil\n read_options = generate_read_options consistency, transaction, read_time\n service.lookup project_id: project, database_id: database, keys: keys, read_options: read_options\n end", "def fetch(ids)\n data = nil\n\n model.synchronize do\n ids.each do |id|\n redis.queue(\"HGETALL\", namespace[id])\n end\n\n data = redis.commit\n end\n\n return [] if data.nil?\n\n [].tap do |result|\n data.each_with_index do |atts, idx|\n result << model.new(Utils.dict(atts).update(:id => ids[idx]))\n end\n end\n end", "def fetch_from_db(cache_miss_ids)\n fail 'sub class to implement'\n end", "def fetch(key)\n result.fetch(key)\n end", "def [](key)\n fetch(key)\n end", "def fetch( key, &block )\n fail NotImplementedError\n end", "def get(hash, *keys)\n eat = Mash.new\n hash.each_key {|k| eat[k]=hash[k] if keys.include?(k)}\n return eat\n end", "def fetch(*args)\n fail ArgumentError, \"Expected 1-2 arguments, got #{args.length}\" \\\n unless (1..2).cover?(args.length)\n\n key, default = args\n\n all(key) do |value|\n return value\n end\n\n if block_given?\n yield key\n elsif default\n default\n else\n fail KeyError, \"key not found: #{key.inspect}\"\n end\n end", "def slice!(*keys); end", "def fetch_multi(*names)\n options = names.extract_options!\n mapping = names.inject({}) { |memo, name| memo[namespaced_key(name, options)] = name; memo }\n\n instrument_with_log(:fetch_multi, mapping.keys) do\n with do |connection|\n results = connection.get_multi(mapping.keys)\n\n connection.multi do\n mapping.inject({}) do |memo, (expanded, name)|\n memo[name] = results[expanded]\n if memo[name].nil?\n value = yield(name)\n memo[name] = value\n options = options.merge(:connection => connection)\n write_entry(expanded, value, options)\n end\n\n memo\n end\n end\n end\n end\n end", "def get(key, default = nil)\n return default unless servers?\n if key.kind_of? Array\n @cache.get_multi(key_in_ns(key))\n else\n @cache.get(key_in_ns(key)) || default \n end\n end", "def find_by_keys(keys, options = {})\n records = find_records_by_keys(keys, options)\n resources_for(records, options[:context])\n end", "def fetch_from_db(cache_miss_ids)\n\n aggregated_cache_data = {}\n\n cache_miss_ids.each do |client_id|\n\n get_credentials_rsp = ClientManagement::GetClientApiCredentials.new(client_id: client_id).perform\n return get_credentials_rsp unless get_credentials_rsp.success?\n\n api_credentials = get_credentials_rsp.data[:api_credentials]\n\n encrypt_rsp = encryptor_obj.encrypt(api_credentials[:api_secret])\n return encrypt_rsp unless encrypt_rsp.success?\n\n cache_data = {\n api_key: api_credentials[:api_key],\n api_secret: encrypt_rsp.data[:ciphertext_blob]\n }\n\n aggregated_cache_data[client_id] = cache_data\n\n end\n\n success_with_data(aggregated_cache_data)\n\n end", "def fetch(key)\n send(:[], key){return(yield if defined?(yield))}\n end", "def _get_all(keys)\r\n\t\treq = VoldemortRequest.new\r\n\t\treq.should_route = true\r\n\t\treq.store = @store_name\r\n\t\treq.type = RequestType::GET_ALL\r\n req.getAll = GetAllRequest.new\r\n\t\tfor key in keys\r\n\t\t\treq.getAll.keys << key\r\n end\r\n\r\n\t\t# send request\r\n\t\t_send_request(@connection, req.serialize_to_string())\r\n\r\n\t\t# read and parse response\r\n\t\tresp_str = _receive_response(@connection)\r\n\t\tresp = GetAllResponse.new\r\n\t\tresp = resp.parse_from_string(resp_str)\r\n\t\t_check_error(resp)\r\n\t\tvalues = {}\r\n\t\tfor key_val in resp.values\r\n\t\t\tvalues[key_val.key] = _extract_versions(key_val.versions)\r\n end\r\n\t\treturn values\r\n end", "def [](key)\n timeout_retry(3, 3){\n write \"GET #{key}\\r\\n\"\n redis_unmarshal(bulk_reply)\n }\n end", "def expire_cache_keys *keys\r\n keys.each { |k| @cache.delete k.to_sym }\r\n end", "def [](*keys)\n if value = get(*keys)\n value.is_a?(Hash) ? value[:value] : value\n end\n end", "def read_multi(*names)\n options = names.extract_options!\n names = names.flatten.map{|name| expanded_key(name)}\n options[:assemble_hash] = true\n if options.delete(:raw)\n options[:format] = :plain\n end\n instrument(:read_multi, names, options) do\n @data.get(names, options)\n end\n rescue ::Couchbase::Error::Base => e\n logger.error(\"#{e.class}: #{e.message}\") if logger\n raise if @raise_errors\n false\n end", "def cached_fetch(key)\n fetch(key) do\n return yield unless h = self[:cache]\n Sequel.synchronize{return h[key] if h.has_key?(key)}\n value = yield\n Sequel.synchronize{h[key] = value}\n end\n end", "def cache_key(*ids)\n ids.join(':')\n end", "def fetch_from_db(cache_miss_ids)\n\n data_to_cache = ::ClientToken.where(id: cache_miss_ids).all.inject({}) do |cache_data, client_token|\n\n cache_data[client_token.id] = client_token.formated_cache_data\n\n cache_data\n\n end\n\n success_with_data(data_to_cache)\n\n end", "def delete_from_cache(*keys, **opts)\n base_key = self.base_redis_key opts\n keys.each do |key|\n Cachable::redis.del \"#{base_key}_#{key}\"\n end\n end", "def keys(*keys)\n if keys.empty?\n rows.map{|r| r.key}\n else\n raise \"View#keys cannot by used when key or startkey/endkey have been set\" unless query[:key].nil? && query[:startkey].nil? && query[:endkey].nil?\n update_query(:keys => keys.first)\n end\n end", "def cache_fetch(key, expires_in:, &block)\n if ret = mload(key)\n ret\n else\n val = block.call\n mdump(key, val)\n expire(key, expires_in)\n val\n end\n end", "def hmget(key, *fields); end", "def comp(*keys)\n result = keys.map { |key| get(key) }\n yield(*result) if result.all? if block_given?\n result\n end", "def real_get(k, opt = {})\n if k.is_a?(Array)\n do_op(:multi_get, column_family, k, opt)\n elsif opt[:count]\n do_op(:get, column_family, k, opt)\n else\n opt = opt.clone\n opt[:count] = DEFAULT_COUNT\n columns = Cassandra::OrderedHash.new\n loop do\n chunk = do_op(:get, column_family, k, opt)\n columns.merge!(chunk)\n if chunk.size == opt[:count]\n # Assume there are more chunks, use last key as start of next get\n opt[:start] = chunk.keys.last\n else\n # This must be the last chunk\n break\n end\n end\n columns\n end\n end", "def real_get(k, opt = {})\n if k.is_a?(Array)\n do_op(:multi_get, column_family, k, opt)\n elsif opt[:count]\n do_op(:get, column_family, k, opt)\n else\n opt = opt.clone\n opt[:count] = DEFAULT_COUNT\n columns = Cassandra::OrderedHash.new\n loop do\n chunk = do_op(:get, column_family, k, opt)\n columns.merge!(chunk)\n if chunk.size == opt[:count]\n # Assume there are more chunks, use last key as start of next get\n opt[:start] = chunk.keys.last\n else\n # This must be the last chunk\n break\n end\n end\n columns\n end\n end", "def get(key, *args, &block)\n raise ArgumentError, 'block required by not given' unless block_given?\n digest = hashed_key_and_args(key, *args)\n client.get(digest) || set(key, *args, &block)\n end", "def decide_for_keys(keys, options = nil)\n @optimizely_client&.decide_for_keys(clone, keys, options)\n end", "def decide_for_keys(keys, options = nil)\n @optimizely_client&.decide_for_keys(clone, keys, options)\n end", "def read_multi(*names)\n options = names.extract_options!\n mapping = names.inject({}) { |memo, name| memo[namespaced_key(name, options)] = name; memo }\n instrument_with_log(:read_multi, mapping.keys) do\n results = {}\n if local_cache\n mapping.each_key do |key|\n if value = local_cache.read_entry(key, options)\n results[key] = value\n end\n end\n end\n\n data = with { |c| c.get_multi(mapping.keys - results.keys) }\n results.merge!(data)\n results.inject({}) do |memo, (inner, _)|\n entry = results[inner]\n # NB Backwards data compatibility, to be removed at some point\n value = (entry.is_a?(ActiveSupport::Cache::Entry) ? entry.value : entry)\n memo[mapping[inner]] = value\n local_cache.write_entry(inner, value, options) if local_cache\n memo\n end\n end\n end", "def fetch key, exp=60, &block\n get(key) or block.().tap {|x| set(key, x, exp)}\n end", "def get(*keys)\n keys = key_for(keys)\n\n if keys.size <= 1\n if !self.has_key?(keys.first) && block_given?\n return yield\n else\n return self[keys.first]\n end\n end\n\n keys, key = keys[0..-2], keys[-1]\n collection = self\n\n keys.each do |k|\n if MotionMap::Map.collection_has?(collection, k)\n collection = MotionMap::Map.collection_key(collection, k)\n else\n collection = nil\n end\n\n unless collection.respond_to?('[]')\n leaf = collection\n return leaf\n end\n end\n\n if !MotionMap::Map.collection_has?(collection, key) && block_given?\n default_value = yield\n else\n MotionMap::Map.collection_key(collection, key)\n end\n end", "def fetch_data(key)\n map { |om| om.fetch_data(key) }.flatten.compact\n end", "def _smart_cache(expires_in, *keys, &block)\n key = _cache_key(keys)\n unless cached = Rails.cache.read( key )\n cached = yield(block) \n Rails.cache.write(key, cached, expires_in: expires_in) \n end\n cached\n end", "def fetch(&block)\n Rails.cache.fetch(cache_key, &block)\n end" ]
[ "0.76002806", "0.7560183", "0.7371465", "0.72819227", "0.7221198", "0.7219979", "0.7171256", "0.71348906", "0.71203774", "0.7083447", "0.7018356", "0.6982066", "0.69421977", "0.6888042", "0.67754287", "0.6617798", "0.6563602", "0.64887345", "0.648532", "0.64705306", "0.6453602", "0.64490634", "0.64379704", "0.64076024", "0.63811105", "0.63736016", "0.6364136", "0.63591284", "0.63532156", "0.6316914", "0.6314487", "0.6289449", "0.6287729", "0.6265083", "0.6254814", "0.62391436", "0.6218568", "0.62113506", "0.6181026", "0.61281466", "0.6112167", "0.6078505", "0.60766387", "0.6074186", "0.6064538", "0.6052437", "0.60118484", "0.6010302", "0.60068876", "0.6004761", "0.59740293", "0.5954299", "0.5938232", "0.5938232", "0.59255606", "0.5925251", "0.5919241", "0.58837146", "0.58812094", "0.5831775", "0.58174896", "0.57790554", "0.57663864", "0.57438636", "0.5743032", "0.5739296", "0.5733397", "0.57259923", "0.5723983", "0.5717866", "0.5712802", "0.57009643", "0.5694735", "0.56901866", "0.5688597", "0.5685996", "0.5677985", "0.56675", "0.56661737", "0.56568456", "0.5639074", "0.5631956", "0.56215423", "0.56154275", "0.5604524", "0.5582858", "0.55648136", "0.5551814", "0.55364233", "0.5530055", "0.5530055", "0.5517231", "0.551304", "0.551304", "0.5512932", "0.5505894", "0.54997694", "0.54856503", "0.5482019", "0.54764366" ]
0.76531976
0
Will cache an association to the class including IdentityCache. The embed option, if set, will make IdentityCache keep the association values in the same cache entry as the parent. Embedded associations are more effective in offloading database work, however they will increase the size of the cache entries and make the whole entry expire when any of the embedded members change. == Example: class Product cached_has_many :options, :embed => false cached_has_many :orders cached_has_many :buyers, :inverse_name => 'line_item' end == Parameters +association+ Name of the association being cached as a symbol == Options embed: If set will cause IdentityCache to keep the values for this association in the same cache entry as the parent, instead of its own. inverse_name: The name of the parent in the association if the name is not the lowercase pluralization of the parent object's class
def cache_has_many(association, options = {}) options[:embed] ||= false options[:inverse_name] ||= self.name.underscore.to_sym raise InverseAssociationError unless self.reflect_on_association(association) self.cached_has_manys[association] = options if options[:embed] build_denormalized_association_cache(association, options) else build_normalized_has_many_cache(association, options) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cache_has_one(association, options = {})\n options[:embed] ||= true\n options[:inverse_name] ||= self.name.underscore.to_sym\n raise InverseAssociationError unless self.reflect_on_association(association)\n self.cached_has_ones[association] = options\n\n build_denormalized_association_cache(association, options)\n end", "def cache_has_one(association, embed:)\n ensure_base_model\n check_association_for_caching(association)\n reflection = reflect_on_association(association)\n association_class = case embed\n when :id\n Cached::Reference::HasOne\n when true\n Cached::Recursive::HasOne\n else\n raise NotImplementedError\n end\n\n cached_has_ones[association] = association_class.new(\n association,\n reflection: reflection,\n ).tap(&:build)\n end", "def association_instance_set(name, association)\n @association_cache[name] = association\n end", "def association_instance_set(name, association)\n @association_cache[name] = association\n end", "def association_instance_set(name, association)\n @association_cache[name] = association\n end", "def eager_loading_use_associated_key?\n true\n end", "def association(name)\n association = super\n reflection = self.class.reflect_on_association(name)\n case reflection.try(:macro)\n when :belongs_to\n association.extend(HasAggregatedExtension) if reflection.options[:aggregated]\n when :has_one\n association.extend(HasCurrentExtension) if reflection.options[:is_current]\n else # do nothing\n end\n association\n end", "def represent_association_as(association, mode)\n # get association type to differentiate if its singular or plural\n type = self.class.association_reflection(association)[:type]\n singular = (type == :many_to_one || type == :one_to_one)\n\n if associations.key?(association)\n # if association data are already loaded (cached)\n return unless (data = send(association))\n singular ? data.represent_as(mode) : data.map { |d| d.represent_as(mode) }\n else\n # if not, load its dataset and represent it\n repre = send(\"#{association}_dataset\").represent_as(mode)\n singular ? repre[0] : repre\n end\n end", "def association_instance_get(name)\n @association_cache[name]\n end", "def association_instance_get(name)\n @association_cache[name]\n end", "def eager_loading_use_associated_key?\n false\n end", "def association(name) #:nodoc:\n association = association_instance_get(name)\n\n if association.nil?\n reflection = self.class.reflect_on_association(name)\n association = reflection.association_class.new(self, reflection)\n association_instance_set(name, association)\n end\n\n association\n end", "def association!(association, record_id)\n if preloadable_association?(association.name)\n associations.register(association, record_id)\n end\n end", "def associate(embed)\n embed.embed_will_change = lambda { embeds_will_change! }\n embed\n end", "def association_instance_get(name)\n @association_cache[name.to_sym]\n end", "def cache_attribute_for_association(klass,association_name,association_method)\n if klass.respond_to?(:value_cache_options)\n klass.value_cache_options.settings.detect{|k,v| v[:from_entity] == association_name.to_sym && v[:to_entity] == association_method.to_sym }.first\n end\n end", "def clear_association_cache #:nodoc:\n @association_cache.clear if persisted?\n end", "def has_many(association_name, metadata={})\n\n add_association association_name, :has_many, metadata\n\n association_class_name = metadata.try(:fetch, :class_name, [name.split('::')[0..-2].join('::'), association_name.to_s.classify].reject(&:blank?).join('::'))\n\n # foos\n define_method(association_name) do |*query|\n association_class = association_class_name.constantize\n\n # TODO: Support a more generic version of lazy-loading\n if query.empty? # Ex: Books.all, so we want to cache it.\n ivar = \"@#{association_name}\"\n if instance_variable_defined?(ivar)\n instance_variable_get(ivar)\n elsif self.class.autoload_associations? && association_class.respond_to?(:all)\n instance_variable_set(ivar, Array(association_class.all(\"#{self.class.name.underscore}_id\" => id)))\n else\n []\n end\n else # Ex: Book.all(:name => \"The...\"), so we do not want to cache it\n if self.class.autoload_associations? && association_class.respond_to?(:all)\n Array(association_class.all({\"#{self.class.name.demodulize.underscore}_id\" => id}.merge(query.first)))\n end\n end\n end\n\n # foos=\n define_method(\"#{association_name}=\") do |arg|\n association_class = association_class_name.constantize\n\n attr_name = self.class.name.demodulize.underscore\n objs = (arg.is_a?(Hash) ? arg.values : Array(arg)).map do |obj|\n o = association_class.cast(obj)\n\n if o.respond_to?(\"#{attr_name}=\")\n o.send(\"#{attr_name}=\", self)\n end\n\n if o.respond_to?(\"#{attr_name}_id=\") && respond_to?(:id)\n o.send(\"#{attr_name}_id=\", id)\n end\n\n o\n end\n instance_variable_set(\"@#{association_name}\", objs)\n end\n end", "def clear_association_cache #:nodoc:\n association_cache.clear if _persisted_obj\n end", "def to_hash(embedded_contents = nil)\n if object.embedded?\n # select the relation for the parent object\n parent_relation = object.relations.select do |k,v|\n v.macro == :embedded_in && v.class_name == object._parent.class.name\n end.values.first\n # embed this in the parent's hash\n result = {\n association: parent_relation.inverse_of,\n id: object.id\n }\n result = result.merge(embedded: embedded_contents) if embedded_contents\n self.class.new(object._parent).to_hash(result)\n else # !embedded?\n result = { class_name: object.class.name, id: object.id }\n result[:embedded] = embedded_contents if embedded_contents\n result\n end\n end", "def store_association(server_url, association)\n serialized = serialize(association)\n [nil, association.handle].each do |handle|\n key = assoc_key(server_url, handle)\n @cache_client.set(key, serialized, expiry(association.lifetime))\n end\n end", "def association(name) #:nodoc:\n association = association_instance_get(name)\n\n if association.nil?\n unless reflection = self.class._reflect_on_association(name)\n raise AssociationNotFoundError.new(self, name)\n end\n association = reflection.association_class.new(self, reflection)\n association_instance_set(name, association)\n end\n\n association\n end", "def association(name) # :nodoc:\n association = association_instance_get(name)\n\n if association.nil?\n unless reflection = self.class._reflect_on_association(name)\n raise AssociationNotFoundError.new(self, name)\n end\n association = reflection.association_class.new(self, reflection)\n association_instance_set(name, association)\n end\n\n association\n end", "def association_scope_cache(klass, owner, &block)\n key = self\n key = [key, owner._read_attribute(@foreign_type)] if polymorphic?\n key = [key, shard(owner).id].flatten\n klass.cached_find_by_statement(key, &block)\n end", "def load!(includes, options = {})\r\n case includes\r\n when Array\r\n includes.each { |association|\r\n load! association, :limit => options[:limit]\r\n }\r\n when Hash\r\n includes.each { |association, subassociation|\r\n associated = load! association, :include => subassociation,\r\n :limit => options[:limit]\r\n }\r\n when String, Symbol\r\n name = self.class.associations(version)[includes = includes.to_sym]\r\n return unless name\r\n macro = self.class.model.reflect_on_association(name).macro\r\n\r\n @loaded[includes] ||= if [:belongs_to, :has_one].include?(macro)\r\n associated = send(includes).target\r\n if options[:include]\r\n associated.load! options[:include], :limit => options[:limit]\r\n end\r\n associated\r\n else\r\n configuration = {}\r\n configuration[:limit] = options[:limit] || MAXIMUM_LIMIT\r\n configuration[:include] = options[:include] if options[:include]\r\n collection = send(includes).scoped(configuration).to_collection\r\n\r\n if collection.pagination\r\n collection.pagination.path = attributes[includes] || includes\r\n end\r\n\r\n if options[:include]\r\n collection.each { |record|\r\n record.load! options[:include], :limit => options[:limit]\r\n }\r\n end\r\n\r\n collection\r\n end\r\n end\r\n end", "def association_reflection(association)\n uar = used_association_reflections\n Sequel.synchronize{uar[association] ||= true}\n super\n end", "def association_instance_get(cypher_string, association_obj)\n return if association_cache.nil? || association_cache.empty?\n lookup_obj = cypher_hash(cypher_string)\n reflection = association_reflection(association_obj)\n return if reflection.nil?\n association_cache[reflection.name] ? association_cache[reflection.name][lookup_obj] : nil\n end", "def reflect_on_association(name)\n if orm_association = klass.reflect_on_association(name)\n self.class.const_get(:Association).new(orm_association,self)\n end\n end", "def clear_association_cache\n @association_cache.clear if persisted?\n end", "def reverse_reflection(association_name)\n refl = reflections[association_name]\n return nil if refl.options[:conditions]\n \n reverse_macro = if refl.macro == :has_many\n :belongs_to\n elsif refl.macro == :belongs_to\n :has_many\n end\n refl.klass.reflections.values.find do |r|\n r.macro == reverse_macro and\n r.klass == self and \n !r.options[:conditions] and\n r.primary_key_name == refl.primary_key_name\n end\n end", "def reflect_on_association(name)\n ActiveRecordAssociationAdapter.for_association(associations[name]) if associations[name]\n end", "def embed(parent, attribute, *args)\n this = self.piece(*args)\n this.candy_adopt(parent, attribute)\n end", "def association\n @association ||= model.reflect_on_association(@name)\n end", "def _association(args, default_options={})\n return if options.nil?\n\n options = args.first\n\n if options.is_a?(Hash)\n options = {}.merge(options)\n name = options.keys.first\n properties = options.delete(name)\n\n @associations[name] = default_options.merge({ :include => properties }).merge(options)\n elsif options.is_a?(Array)\n options.each do |option|\n association option\n end\n else\n @associations[options] = args[1] || {}\n end\n end", "def association\n @association ||= options[:association]\n end", "def association(association_name,\n as: nil,\n viewmodel: nil,\n viewmodels: nil,\n external: false,\n read_only: false,\n through: nil,\n through_order_attr: nil)\n\n vm_association_name = (as || association_name).to_s\n\n if through\n direct_association_name = through\n indirect_association_name = association_name\n else\n direct_association_name = association_name\n indirect_association_name = nil\n end\n\n target_viewmodels = Array.wrap(viewmodel || viewmodels)\n\n association_data = AssociationData.new(\n owner: self,\n association_name: vm_association_name,\n direct_association_name: direct_association_name,\n indirect_association_name: indirect_association_name,\n target_viewmodels: target_viewmodels,\n external: external,\n read_only: read_only,\n through_order_attr: through_order_attr)\n\n _members[vm_association_name] = association_data\n\n @generated_accessor_module.module_eval do\n define_method vm_association_name do\n _read_association(vm_association_name)\n end\n\n define_method :\"serialize_#{vm_association_name}\" do |json, serialize_context: self.class.new_serialize_context|\n _serialize_association(vm_association_name, json, serialize_context: serialize_context)\n end\n end\n end", "def _load_associated_objects(opts, dynamic_opts={})\n if opts.can_have_associated_objects?(self) && opts[:type] == :many_to_one && opts.associated_class.respond_to?(:cache_get_pk)\n _load_associated_object(opts, dynamic_opts)\n else\n super\n end\n end", "def association(name,context,version,options={})\n attribute_name = options[:attribute_name] || name\n\n if(@direction == :to_json)\n hash[attribute_name] = QJSON.render_collection(@object.send(name),context,version,options)\n elsif(@direction == :from_json)\n # by default, associations are not parsed out - that is a dangerous,\n # unexpected (to me) behavior!\n else\n raise \"InvalidDirection\"\n end\n end", "def preload(association, as: nil, order_by: nil, limit: nil)\n expect! association => Symbol\n expect! as => [nil, Symbol]\n\n # resolve oid into table and schema name.\n #\n # [TODO] is this still correct?\n schema, host_table = connection.reflection.lookup_pg_class @pg_source_oid\n\n AssociationLoader.preload connection,\n @hash_records, association,\n host_table: host_table, schema: schema, as: as,\n order_by: order_by, limit: limit\n\n @associations << association\n\n materialize\n end", "def association (name, options = {})\n name = name.to_sym\n options = symbolize_keys(options)\n association_factory = options[:factory] || name\n\n add_attribute(name) {|a| a.association(association_factory) }\n end", "def association(name, options = {})\n define_method \"associated_#{name}\" do\n @result[options.fetch(:from, name).to_s]\n end\n end", "def reflect_on_association(name)\n self.class.reflect_on_association(name)\n end", "def cache_attribute(attribute, options = {})\n options[:by] ||= :id\n fields = Array(options[:by])\n\n self.cache_attributes.push [attribute, fields]\n\n field_list = fields.join(\"_and_\")\n arg_list = (0...fields.size).collect { |i| \"arg#{i}\" }.join(',')\n where_list = fields.each_with_index.collect { |f, i| \"#{f} = \\#{quote_value(arg#{i})}\" }.join(\" AND \")\n\n self.instance_eval(ruby = <<-CODE, __FILE__, __LINE__)\n def fetch_#{attribute}_by_#{field_list}(#{arg_list})\n sql = \"SELECT #{attribute} FROM #{table_name} WHERE #{where_list} LIMIT 1\"\n attribute_dynamic_fetcher(#{attribute.inspect}, #{fields.inspect}, [#{arg_list}], sql)\n end\n CODE\n end", "def associated_dataset\n cached_fetch(:_dataset){apply_dataset_changes(_associated_dataset)}\n end", "def associations\n # is caching ok?\n unless @associations\n @associations = {}\n klass.relations.each{|name,association|\n @associations[name.to_s] = Association.new(association,self)\n }\n end\n @associations\n end", "def embedded_associations\n associations.values.select(&:embedded?)\n end", "def assoc_options\n # Wait to implement this in Phase IVa. Modify `belongs_to`, too.\n @assoc_options ||= {}\n @assoc_options\n end", "def add_association(model_name, association_name, association_meta, association_class=nil)\n @associations[model_name] ||= {}\n @associations[model_name][association_name] = {\"meta\" => association_meta, \"class_name\" => association_class || association_name.classify}\n end", "def eager(*associations)\n opts = @opts[:eager]\n association_opts = eager_options_for_associations(associations)\n opts = opts ? Hash[opts].merge!(association_opts) : association_opts\n clone(:eager=>opts)\n end", "def has_one(association_name, options = {})\n database.schema[self].associations << HasManyAssociation.new(self, association_name, options)\n end", "def association (name, options = {})\n name = name.to_sym\n options = options.symbolize_keys\n association_factory = options[:factory] || name\n\n add_attribute(name) {|a| a.association(association_factory) }\n end", "def initialize_association_cache(objects)\n name = self[:name]\n if assign_singular?\n objects.each{|object| object.associations[name] = nil}\n else\n objects.each{|object| object.associations[name] = []}\n end\n end", "def embed_record(name, options = {})\n klass = options[:class] || EmbeddedRecord.constantize(name.to_s)\n\n unless klass.included_modules.include? Record\n raise ArgumentError, \"Class must include EmbeddedRecord::Record\"\n end\n\n attr = options[:mask_attr] || \"#{name}_mask\"\n\n define_method name do\n if val = send(attr)\n klass.all[val]\n elsif klass.null_record\n klass.null_record\n end\n end\n\n define_method \"#{name}_id\" do\n if val = send(attr)\n klass.all[val].id\n end\n end\n\n define_method \"#{name}_id=\" do |id|\n type_method = embed_id_type_method(klass)\n index = klass.all.index { |obj| obj.id == id.send(type_method) }\n send \"#{attr}=\", index\n index\n end\n\n if options[:scope] == true\n embed_record_scope name\n end\n end", "def decorates_association(relation_name, with: :__guess__)\n relation_name = relation_name.to_sym\n\n define_method(relation_name) do\n @_decorated_associations[relation_name] ||= decorate(__getobj__.public_send(relation_name), with: with)\n end\n end", "def attributes_for_persistence\n self.class.embedded_associations.inject(super) do |attrs, association|\n documents = instance_variable_get(association.ivar)\n # We must explicitly check #nil? (rather than just saying `if documents`)\n # because documents can be an association proxy that is proxying nil.\n # In this case ruby treats documents as true because it is not _really_ nil,\n # but #nil? will tell us if it is proxying nil.\n\n unless documents.nil?\n attrs[association.name] = documents.is_a?(Array) ? documents.map(&:attributes_for_persistence) : documents.attributes_for_persistence\n end\n attrs\n end\n end", "def build(options)\n item = association.associated_constant.new(options)\n self << item\n item\n end", "def association(name, *options); end", "def association_chain\n @association_chain ||=\n symbols_for_association_chain.inject([begin_of_association_chain]) do |chain, symbol|\n chain << evaluate_parent(symbol, resources_configuration[symbol], chain.last)\n end.compact.freeze\n end", "def association\n self.parent && self.parent.dbi.reflect_on_association(self.association_name)\n end", "def with_local_cache(key, force_refresh, &block)\n raise ScriptError unless block_given?\n if force_refresh || @associations_cache[key].nil?\n results = yield\n @associations_cache[key] = results\n end\n @associations_cache[key]\n end", "def cache_supported_on_inverse_model?\n inverse_of && inverse_of.belongs_to?\n end", "def association\n a = element.dataset[:association]\n # send is spoopy, make sure the message you're sending is actually an association\n return unless safe?(session[:model], a)\n\n session[:model].send(a)\n end", "def add_solr_eager_loaded_association association_name\n name = association_name.to_s\n unless self.solr_eager_loaded_associations.include?(name)\n self.solr_eager_loaded_associations << name\n end\n end", "def association(association_name); end", "def cache(options = {})\n self._cache =\n options.delete(:cache_store) ||\n ActiveModelSerializers.config.cache_store ||\n ActiveSupport::Cache.lookup_store(:null_store)\n self._cache_key = options.delete(:key)\n self._cache_only = options.delete(:only)\n self._cache_except = options.delete(:except)\n self._cache_options = options.empty? ? nil : options\n end", "def cache(options = {})\n self._cache =\n options.delete(:cache_store) ||\n ActiveModelSerializers.config.cache_store ||\n ActiveSupport::Cache.lookup_store(:null_store)\n self._cache_key = options.delete(:key)\n self._cache_only = options.delete(:only)\n self._cache_except = options.delete(:except)\n self._cache_options = options.empty? ? nil : options\n end", "def recursively_embeds_one(options = {})\n embeds_one(\n cyclic_child_name(false),\n options.merge(class_name: self.name, cyclic: true)\n )\n embedded_in cyclic_parent_name, class_name: self.name, cyclic: true\n end", "def association(name)\n if reflection = _scope.reflect_on_association(name)\n Association.new(self, reflection)\n else\n raise AssociationNotFoundError.new(_scope.model_name, name)\n end\n end", "def def_association(opts)\n if !opts[:is_used] && @unused_associations_data && (data = @unused_associations_data[name]) && (unused = data[opts[:name].to_s])\n set_unused_options_for_association(opts, unused)\n end\n \n super\n end", "def create_association(macro, association, **options, &block)\n association = association.to_s if association.is_a?(Symbol)\n\n # Shove in additional fabulous options!\n options.reverse_merge!(macro: macro, name: association.camelize(:lower), association: association)\n\n # Reflection on the association & ensure that the world is still round (eg: make sure the association is what we are expecting)\n reflection = @model.reflect_on_association(association)\n raise ArgumentError, \"Could not find association `#{association}` on `#{@model.name}`\" unless reflection\n raise ArgumentError, \"Association `#{association}` on `#{@model.name}` is polymorphic and not supported\" if reflection.polymorphic?\n raise ArgumentError, \"Association `#{association}` on `#{@model.name}` expected to be `#{macro}`, but was `#{reflection.macro}` instead\" unless reflection.macro == macro\n\n # Automatically add the foreign key as an input for optional belongs_to associations\n # if macro == :belongs_to && !options[:required]\n # input(reflection.foreign_key, type: types.ID)\n # end\n\n if macro == :has_many && options.key?(:id_field)\n options[:id_field] = :id\n end\n\n field_map = FieldMap.new(reflection.klass, options)\n field_map.instance_exec(&block) if block_given?\n nested.push(field_map)\n self\n end", "def reflect_on_association(name)\n association_by_name[name.to_sym]\n end", "def expire_associated(order)\n expirable = EXPIRABLE_FIELDS.any? do |key|\n order.changed_attributes.include?(key)\n end\n\n if expirable\n ASSOCIATED_CLASSES.each {|ac|\n publish :purge_cache, ActiveSupport::JSON.encode( {:subject_class => order.class.name, :subject_id => order.id, :associated_class => \"#{ac}\" }) \n }\n end\n end", "def association(key)\n @associations[key] ||= Association.children(@model, key)\n end", "def include_associations(hash, associations, assocs)\n associations.each do |name, attrs|\n instance = assocs[name.to_sym]\n\n foreign_key = attrs[:foreign_key]\n\n # for cases where instance is:\n # - association is empty (nil)\n # - association is present\n #\n # update hash with the foreign_key\n hash[foreign_key.to_sym] = (instance.id if instance.present?)\n end\n\n hash\n end", "def construct_association(parent, reflection, attributes, seen, model_cache)\n return if attributes.nil?\n\n klass = if reflection.polymorphic?\n parent.send(reflection.foreign_type).constantize.base_class\n else\n reflection.klass\n end\n id = attributes[klass.primary_key]\n model = seen[parent.class.base_class][parent.id][klass][id]\n\n if model\n construct(model, attributes.select{|k,v| !klass.column_names.include?(k.to_s) }, seen, model_cache)\n\n other = parent.association(reflection.name)\n\n if reflection.collection?\n other.target.push(model)\n else\n other.target = model\n end\n\n other.set_inverse_instance(model)\n else\n model = construct_model(parent, reflection, id, attributes.select{|k,v| klass.column_names.include?(k.to_s) }, seen, model_cache)\n seen[parent.class.base_class][parent.id][model.class.base_class][id] = model\n construct(model, attributes.select{|k,v| !klass.column_names.include?(k.to_s) }, seen, model_cache)\n end\n end", "def assoc_searchable(*args)\n opts = args.extract_options!\n args.flatten.each do |assoc|\n assoc = assoc.to_s\n raise(ArgumentError, \"No such association #{assoc} in #{self}\") unless self.reflect_on_all_associations.map {|a| a.name.to_s}.include?(assoc)\n self._metasearch_include_associations = self._metasearch_include_associations.merge(\n assoc => {\n :if => opts[:if]\n }\n )\n end\n end", "def construct(parent, relations, seen, model_cache)\n relations.each do |key, attributes|\n reflection = parent.class.reflect_on_association(key)\n next unless reflection\n\n if reflection.collection?\n other = parent.association(reflection.name)\n other.loaded!\n else\n if parent.association_cached?(reflection.name)\n model = parent.association(reflection.name).target\n construct(model, attributes.select{|k,v| !reflection.klass.column_names.include?(k.to_s) }, seen, model_cache)\n end\n end\n\n if !reflection.collection?\n construct_association(parent, reflection, attributes, seen, model_cache)\n else\n attributes.each do |row|\n construct_association(parent, reflection, row, seen, model_cache)\n end\n end\n\n end\n end", "def set_association(key, value)\n _associations[key.to_sym] = _cast_association(key, value)\n end", "def embed_attribute(name)\n accepts_nested_attributes_for name, :allow_destroy => true\n attr_accessible \"#{ name }_attributes\".to_sym if _accessible_attributes?\n self.embeddings << name\n end", "def embedded\n {\n _embedded: {\n @name => decorated_collection\n }\n }\n end", "def enqueue_association(anAssociation, aScope = nil)\n if aScope\n raise NotImplementedError\n else\n blackboard.enqueue_association(anAssociation)\n end\n end", "def has_many(association, **options, &block)\n create_association(:has_many, association, options, &block)\n end", "def association_changeset(name)\n association = self.item.send(name)\n # association = association.source if association.decorated?\n\n self.changeset_class(association).new(association, self.data['associations'].fetch(name.to_s).try(:fetch, 'changes'))\n end", "def create_has_many_reflection(association_id, options, &extension)\n options.assert_valid_keys(\n :class_name, :table_name, :foreign_key,\n :dependent,\n :select, :conditions, :include, :order, :group, :limit, :offset,\n :as, :through, :source, :source_type,\n :uniq,\n :finder_sql, :counter_sql,\n :before_add, :after_add, :before_remove, :after_remove,\n :extend,\n :scope\n )\n\n options[:extend] = create_extension_modules(association_id, extension, options[:extend]) if block_given?\n\n create_reflection(:has_many, association_id, options, self)\n end", "def embedded_in(name, *args)\n metadata = set_up_relation('embedded_in', name, *args)\n metadata.owner_class = self\n create_embedded_in_accessors(metadata)\n end", "def load_associated_objects(opts, reload=false)\n name = opts[:name]\n if @associations.include?(name) and !reload\n @associations[name]\n else\n objs = if opts.returns_array?\n send(opts.dataset_method).all\n else\n if !opts[:key]\n send(opts.dataset_method).all.first\n elsif send(opts[:key])\n send(opts.dataset_method).first\n end\n end\n run_association_callbacks(opts, :after_load, objs)\n # Only one_to_many associations should set the reciprocal object\n objs.each{|o| add_reciprocal_object(opts, o)} if opts.set_reciprocal_to_self?\n @associations[name] = objs\n end\n end", "def includes(*associations)\n # Normalize association list to strict nested hash.\n normalize = ->(list) {\n if list.is_a? Array\n list.map(&normalize).reduce(:merge)\n elsif list.is_a? Symbol\n { list => {} }\n elsif list.is_a? Hash\n hash = {}\n list.each do |key, value|\n hash[key] = normalize.(value)\n end\n hash\n end\n }\n associations = normalize.(associations)\n\n current_scope = @scope.includes(associations)\n\n add_conditions = ->(associations, scope) {\n associations.each do |association, nested|\n reflection = scope.reflect_on_association(association)\n if reflection && !reflection.options[:polymorphic]\n associated_klass = reflection.klass\n\n if associated_klass.respond_to? :restrict\n nested_scope = associated_klass.restrictions(@context).request_scope(:fetch)\n\n where_values = nested_scope.where_values\n if where_values.any?\n current_scope = current_scope.where(*where_values)\n end\n\n add_conditions.(nested, associated_klass)\n end\n end\n end\n }\n\n unless Heimdallr.skip_eager_condition_injection\n add_conditions.(associations, current_scope)\n end\n\n options = @options.merge(eager_loaded:\n @options[:eager_loaded].merge(associations))\n\n Proxy::Collection.new(@context, current_scope, options)\n end", "def belongs_to(association_name, metadata={})\n # foo_id\n id_getter = \"#{association_name}_id\".to_sym\n add_attribute(id_getter, :integer, metadata)\n add_association association_name, :belongs_to, metadata\n association_class_name = metadata.try(:fetch, :class_name, [name.split('::')[0..-2].join('::'), association_name.to_s.classify].reject(&:blank?).join('::'))\n\n define_method(id_getter) do\n ivar = \"@#{id_getter}\"\n if instance_variable_defined?(ivar)\n instance_variable_get(ivar)\n else\n if obj = send(association_name)\n instance_variable_set(ivar, obj.id)\n else\n instance_variable_set(ivar, nil)\n end\n end\n end\n\n # foo_id=\n define_method(\"#{id_getter}=\") do |arg|\n instance_variable_set(\"@#{id_getter}\", arg.to_i)\n end\n\n # foo\n define_method(association_name) do\n if instance_variable_defined?(\"@#{association_name}\")\n instance_variable_get(\"@#{association_name}\")\n elsif id = instance_variable_get(\"@#{association_name}_id\")\n association_class = association_class_name.constantize\n\n if self.class.autoload_associations? && association_class.respond_to?(:find)\n instance_variable_set(\"@#{association_name}\", association_class.find(id))\n end\n else\n instance_variable_set(\"@#{association_name}\", nil)\n end\n end\n\n # foo=\n define_method(\"#{association_name}=\") do |arg|\n association_class = association_class_name.constantize\n\n if instance_variable_defined?(\"@#{association_name}_id\")\n remove_instance_variable(\"@#{association_name}_id\")\n end\n instance_variable_set(\"@#{association_name}\", association_class.cast(arg))\n end\n end", "def clear_relationships_cache(*args)\n options = args.extract_options!\n to_clear = RelationshipMixin::MEMOIZED_METHODS - Array.wrap(options[:except])\n flush_cache(*to_clear) unless to_clear.empty?\n\n @association_cache.delete(:all_relationships)\n end", "def embed(type, options={})\n self._embed = type\n self._root_embed = true if options[:include]\n end", "def eager_graph_build_associations(hashes)\n hashes.replace(EagerGraphLoader.new(self).load(hashes))\n end", "def association_changeset(name)\n association = item.send(name)\n # association = association.source if association.decorated?\n\n changeset_class(association).new(association, data['associations'].fetch(name.to_s).try(:fetch, 'changes'))\n end", "def belongs_to(association_name, options = {})\n database.schema[self].associations << BelongsToAssociation.new(self, association_name, options)\n end", "def load_associated_objects(opts, dynamic_opts=nil, &block)\n dynamic_opts = load_association_objects_options(dynamic_opts, &block)\n name = opts[:name]\n if associations.include?(name) && !dynamic_opts[:callback] && !dynamic_opts[:reload]\n associations[name]\n else\n objs = _load_associated_objects(opts, dynamic_opts)\n if opts.set_reciprocal_to_self?\n if opts.returns_array?\n objs.each{|o| add_reciprocal_object(opts, o)}\n elsif objs\n add_reciprocal_object(opts, objs)\n end\n end\n\n # If the current object is frozen, you can't update the associations\n # cache. This can cause issues for after_load procs that expect\n # the objects to be already cached in the associations, but\n # unfortunately that case cannot be handled.\n associations[name] = objs unless frozen?\n run_association_callbacks(opts, :after_load, objs)\n frozen? ? objs : associations[name]\n end\n end", "def define_association(assoc, options = {:view => {}, :summary => {}})\n return {:summary => :none} if options[:summary] == :none\n case assoc.macro\n when :has_one, :belongs_to\n if assoc.options[:polymorphic]\n [:polymorphic_select, :name]\n else\n [:select, :name]\n end\n when :has_many, :has_and_belongs_to_many\n if assoc.options[:polymorphic]\n [:polymorphic_membership, :count]\n else\n [:membership, :count]\n end \n end\n end", "def process_association(class_name, assoc)\n\n STDERR.print \"\\t\\tProcessing model association #{assoc.name.to_s}\\n\" if @options.verbose\n\n # Skip \"belongs_to\" associations\n return if assoc.macro.to_s == 'belongs_to'\n\n # Only non standard association names needs a label\n \n # from patch #12384\n # if assoc.class_name == assoc.name.to_s.singularize.camelize\n \n assoc_class_name = (assoc.class_name.respond_to? 'underscore') ? assoc.class_name.pluralize.singularize.camelize : assoc.class_name \n if assoc_class_name == assoc.name.to_s.singularize.camelize\n assoc_name = ''\n else\n assoc_name = assoc.name.to_s\n end \n\n if assoc.macro.to_s == 'has_one' \n assoc_type = 'one-one'\n elsif assoc.macro.to_s == 'has_many' && (! assoc.options[:through])\n assoc_type = 'one-many'\n else # habtm or has_many, :through\n return if @habtm.include? [assoc.class_name, class_name, assoc_name]\n assoc_type = 'many-many'\n @habtm << [class_name, assoc.class_name, assoc_name]\n end \n # from patch #12384 \n # @graph.add_edge [assoc_type, class_name, assoc.class_name, assoc_name]\n @graph.add_edge [assoc_type, class_name, assoc_class_name, assoc_name] \n end", "def promote_cached(**options)\n promote(**options) if promote?\n end", "def build_collection_proxy(target, association_name:, class_name:, embedded:)\n CollectionProxy.new(**{\n parent: self,\n target: target,\n embedded: embedded,\n class_name: class_name,\n association_name: association_name\n })\n end", "def preloadable_association?( association )\n @klass.preloadable_associations.include?( association.to_sym )\n end", "def _load_associated_object(opts, dynamic_opts)\n klass = opts.associated_class\n cache_lookup = opts.fetch(:many_to_one_pk_lookup) do \n opts[:many_to_one_pk_lookup] = opts[:type] == :many_to_one &&\n opts[:key] &&\n opts.primary_key == klass.primary_key\n end\n if cache_lookup &&\n !dynamic_opts[:callback] &&\n (o = klass.send(:primary_key_lookup, ((fk = opts[:key]).is_a?(Array) ? fk.map{|c| send(c)} : send(fk))))\n o\n else\n super\n end\n end" ]
[ "0.71046513", "0.6648191", "0.59606844", "0.59606844", "0.59606844", "0.55167073", "0.5480567", "0.5457248", "0.5451366", "0.5451366", "0.5412294", "0.54065233", "0.5348217", "0.5344842", "0.53327286", "0.53274757", "0.5314365", "0.52985233", "0.52745104", "0.5255052", "0.5252923", "0.52415574", "0.5215036", "0.51595956", "0.513951", "0.5066081", "0.5058162", "0.50511783", "0.50510377", "0.5028254", "0.5023313", "0.5022078", "0.49769795", "0.4973873", "0.49207148", "0.48961568", "0.48858047", "0.48707622", "0.48655164", "0.48649606", "0.4851073", "0.48476875", "0.48319915", "0.48263946", "0.48208982", "0.48188746", "0.48163167", "0.4812213", "0.48089474", "0.4808031", "0.48008147", "0.479677", "0.47874138", "0.4753003", "0.474702", "0.47440994", "0.4733972", "0.47297838", "0.47248045", "0.47088653", "0.4692199", "0.46915695", "0.46776247", "0.46734864", "0.46724704", "0.46724704", "0.46673143", "0.46587154", "0.46384454", "0.4634201", "0.46339035", "0.46303695", "0.46285453", "0.4627613", "0.46262535", "0.4624699", "0.4614432", "0.4612555", "0.4609627", "0.4604851", "0.4597832", "0.459063", "0.45890307", "0.45862526", "0.45843714", "0.45752606", "0.45736498", "0.4571516", "0.4571055", "0.45623076", "0.45582244", "0.45570078", "0.45552945", "0.4544246", "0.45437336", "0.45273292", "0.45269892", "0.45267653", "0.45223004", "0.45065495" ]
0.75957143
0
Will cache an association to the class including IdentityCache. The embed option if set will make IdentityCache keep the association values in the same cache entry as the parent. Embedded associations are more effective in offloading database work, however they will increase the size of the cache entries and make the whole entry expire with the change of any of the embedded members == Example: class Product cached_has_one :store, :embed => false cached_has_one :vendor end == Parameters +association+ Symbol with the name of the association being cached == Options embed: If set will cause IdentityCache to keep the values for this association in the same cache entry as the parent, instead of its own. inverse_name: The name of the parent in the association ( only necessary if the name is not the lowercase pluralization of the parent object's class)
def cache_has_one(association, options = {}) options[:embed] ||= true options[:inverse_name] ||= self.name.underscore.to_sym raise InverseAssociationError unless self.reflect_on_association(association) self.cached_has_ones[association] = options build_denormalized_association_cache(association, options) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cache_has_many(association, options = {})\n options[:embed] ||= false\n options[:inverse_name] ||= self.name.underscore.to_sym\n raise InverseAssociationError unless self.reflect_on_association(association)\n self.cached_has_manys[association] = options\n\n if options[:embed]\n build_denormalized_association_cache(association, options)\n else\n build_normalized_has_many_cache(association, options)\n end\n end", "def cache_has_one(association, embed:)\n ensure_base_model\n check_association_for_caching(association)\n reflection = reflect_on_association(association)\n association_class = case embed\n when :id\n Cached::Reference::HasOne\n when true\n Cached::Recursive::HasOne\n else\n raise NotImplementedError\n end\n\n cached_has_ones[association] = association_class.new(\n association,\n reflection: reflection,\n ).tap(&:build)\n end", "def association_instance_set(name, association)\n @association_cache[name] = association\n end", "def association_instance_set(name, association)\n @association_cache[name] = association\n end", "def association_instance_set(name, association)\n @association_cache[name] = association\n end", "def association(name)\n association = super\n reflection = self.class.reflect_on_association(name)\n case reflection.try(:macro)\n when :belongs_to\n association.extend(HasAggregatedExtension) if reflection.options[:aggregated]\n when :has_one\n association.extend(HasCurrentExtension) if reflection.options[:is_current]\n else # do nothing\n end\n association\n end", "def association_instance_get(name)\n @association_cache[name]\n end", "def association_instance_get(name)\n @association_cache[name]\n end", "def clear_association_cache #:nodoc:\n @association_cache.clear if persisted?\n end", "def cache_attribute_for_association(klass,association_name,association_method)\n if klass.respond_to?(:value_cache_options)\n klass.value_cache_options.settings.detect{|k,v| v[:from_entity] == association_name.to_sym && v[:to_entity] == association_method.to_sym }.first\n end\n end", "def clear_association_cache #:nodoc:\n association_cache.clear if _persisted_obj\n end", "def association(name) #:nodoc:\n association = association_instance_get(name)\n\n if association.nil?\n reflection = self.class.reflect_on_association(name)\n association = reflection.association_class.new(self, reflection)\n association_instance_set(name, association)\n end\n\n association\n end", "def association!(association, record_id)\n if preloadable_association?(association.name)\n associations.register(association, record_id)\n end\n end", "def represent_association_as(association, mode)\n # get association type to differentiate if its singular or plural\n type = self.class.association_reflection(association)[:type]\n singular = (type == :many_to_one || type == :one_to_one)\n\n if associations.key?(association)\n # if association data are already loaded (cached)\n return unless (data = send(association))\n singular ? data.represent_as(mode) : data.map { |d| d.represent_as(mode) }\n else\n # if not, load its dataset and represent it\n repre = send(\"#{association}_dataset\").represent_as(mode)\n singular ? repre[0] : repre\n end\n end", "def eager_loading_use_associated_key?\n true\n end", "def association_instance_get(name)\n @association_cache[name.to_sym]\n end", "def association(name) #:nodoc:\n association = association_instance_get(name)\n\n if association.nil?\n unless reflection = self.class._reflect_on_association(name)\n raise AssociationNotFoundError.new(self, name)\n end\n association = reflection.association_class.new(self, reflection)\n association_instance_set(name, association)\n end\n\n association\n end", "def eager_loading_use_associated_key?\n false\n end", "def association(name) # :nodoc:\n association = association_instance_get(name)\n\n if association.nil?\n unless reflection = self.class._reflect_on_association(name)\n raise AssociationNotFoundError.new(self, name)\n end\n association = reflection.association_class.new(self, reflection)\n association_instance_set(name, association)\n end\n\n association\n end", "def clear_association_cache\n @association_cache.clear if persisted?\n end", "def store_association(server_url, association)\n serialized = serialize(association)\n [nil, association.handle].each do |handle|\n key = assoc_key(server_url, handle)\n @cache_client.set(key, serialized, expiry(association.lifetime))\n end\n end", "def association_scope_cache(klass, owner, &block)\n key = self\n key = [key, owner._read_attribute(@foreign_type)] if polymorphic?\n key = [key, shard(owner).id].flatten\n klass.cached_find_by_statement(key, &block)\n end", "def associate(embed)\n embed.embed_will_change = lambda { embeds_will_change! }\n embed\n end", "def association_instance_get(cypher_string, association_obj)\n return if association_cache.nil? || association_cache.empty?\n lookup_obj = cypher_hash(cypher_string)\n reflection = association_reflection(association_obj)\n return if reflection.nil?\n association_cache[reflection.name] ? association_cache[reflection.name][lookup_obj] : nil\n end", "def reflect_on_association(name)\n if orm_association = klass.reflect_on_association(name)\n self.class.const_get(:Association).new(orm_association,self)\n end\n end", "def has_many(association_name, metadata={})\n\n add_association association_name, :has_many, metadata\n\n association_class_name = metadata.try(:fetch, :class_name, [name.split('::')[0..-2].join('::'), association_name.to_s.classify].reject(&:blank?).join('::'))\n\n # foos\n define_method(association_name) do |*query|\n association_class = association_class_name.constantize\n\n # TODO: Support a more generic version of lazy-loading\n if query.empty? # Ex: Books.all, so we want to cache it.\n ivar = \"@#{association_name}\"\n if instance_variable_defined?(ivar)\n instance_variable_get(ivar)\n elsif self.class.autoload_associations? && association_class.respond_to?(:all)\n instance_variable_set(ivar, Array(association_class.all(\"#{self.class.name.underscore}_id\" => id)))\n else\n []\n end\n else # Ex: Book.all(:name => \"The...\"), so we do not want to cache it\n if self.class.autoload_associations? && association_class.respond_to?(:all)\n Array(association_class.all({\"#{self.class.name.demodulize.underscore}_id\" => id}.merge(query.first)))\n end\n end\n end\n\n # foos=\n define_method(\"#{association_name}=\") do |arg|\n association_class = association_class_name.constantize\n\n attr_name = self.class.name.demodulize.underscore\n objs = (arg.is_a?(Hash) ? arg.values : Array(arg)).map do |obj|\n o = association_class.cast(obj)\n\n if o.respond_to?(\"#{attr_name}=\")\n o.send(\"#{attr_name}=\", self)\n end\n\n if o.respond_to?(\"#{attr_name}_id=\") && respond_to?(:id)\n o.send(\"#{attr_name}_id=\", id)\n end\n\n o\n end\n instance_variable_set(\"@#{association_name}\", objs)\n end\n end", "def to_hash(embedded_contents = nil)\n if object.embedded?\n # select the relation for the parent object\n parent_relation = object.relations.select do |k,v|\n v.macro == :embedded_in && v.class_name == object._parent.class.name\n end.values.first\n # embed this in the parent's hash\n result = {\n association: parent_relation.inverse_of,\n id: object.id\n }\n result = result.merge(embedded: embedded_contents) if embedded_contents\n self.class.new(object._parent).to_hash(result)\n else # !embedded?\n result = { class_name: object.class.name, id: object.id }\n result[:embedded] = embedded_contents if embedded_contents\n result\n end\n end", "def association\n @association ||= model.reflect_on_association(@name)\n end", "def reverse_reflection(association_name)\n refl = reflections[association_name]\n return nil if refl.options[:conditions]\n \n reverse_macro = if refl.macro == :has_many\n :belongs_to\n elsif refl.macro == :belongs_to\n :has_many\n end\n refl.klass.reflections.values.find do |r|\n r.macro == reverse_macro and\n r.klass == self and \n !r.options[:conditions] and\n r.primary_key_name == refl.primary_key_name\n end\n end", "def association(association_name,\n as: nil,\n viewmodel: nil,\n viewmodels: nil,\n external: false,\n read_only: false,\n through: nil,\n through_order_attr: nil)\n\n vm_association_name = (as || association_name).to_s\n\n if through\n direct_association_name = through\n indirect_association_name = association_name\n else\n direct_association_name = association_name\n indirect_association_name = nil\n end\n\n target_viewmodels = Array.wrap(viewmodel || viewmodels)\n\n association_data = AssociationData.new(\n owner: self,\n association_name: vm_association_name,\n direct_association_name: direct_association_name,\n indirect_association_name: indirect_association_name,\n target_viewmodels: target_viewmodels,\n external: external,\n read_only: read_only,\n through_order_attr: through_order_attr)\n\n _members[vm_association_name] = association_data\n\n @generated_accessor_module.module_eval do\n define_method vm_association_name do\n _read_association(vm_association_name)\n end\n\n define_method :\"serialize_#{vm_association_name}\" do |json, serialize_context: self.class.new_serialize_context|\n _serialize_association(vm_association_name, json, serialize_context: serialize_context)\n end\n end\n end", "def association_reflection(association)\n uar = used_association_reflections\n Sequel.synchronize{uar[association] ||= true}\n super\n end", "def _association(args, default_options={})\n return if options.nil?\n\n options = args.first\n\n if options.is_a?(Hash)\n options = {}.merge(options)\n name = options.keys.first\n properties = options.delete(name)\n\n @associations[name] = default_options.merge({ :include => properties }).merge(options)\n elsif options.is_a?(Array)\n options.each do |option|\n association option\n end\n else\n @associations[options] = args[1] || {}\n end\n end", "def has_one(association_name, options = {})\n database.schema[self].associations << HasManyAssociation.new(self, association_name, options)\n end", "def reflect_on_association(name)\n ActiveRecordAssociationAdapter.for_association(associations[name]) if associations[name]\n end", "def _load_associated_objects(opts, dynamic_opts={})\n if opts.can_have_associated_objects?(self) && opts[:type] == :many_to_one && opts.associated_class.respond_to?(:cache_get_pk)\n _load_associated_object(opts, dynamic_opts)\n else\n super\n end\n end", "def preload(association, as: nil, order_by: nil, limit: nil)\n expect! association => Symbol\n expect! as => [nil, Symbol]\n\n # resolve oid into table and schema name.\n #\n # [TODO] is this still correct?\n schema, host_table = connection.reflection.lookup_pg_class @pg_source_oid\n\n AssociationLoader.preload connection,\n @hash_records, association,\n host_table: host_table, schema: schema, as: as,\n order_by: order_by, limit: limit\n\n @associations << association\n\n materialize\n end", "def cache(options = {})\n self._cache =\n options.delete(:cache_store) ||\n ActiveModelSerializers.config.cache_store ||\n ActiveSupport::Cache.lookup_store(:null_store)\n self._cache_key = options.delete(:key)\n self._cache_only = options.delete(:only)\n self._cache_except = options.delete(:except)\n self._cache_options = options.empty? ? nil : options\n end", "def cache(options = {})\n self._cache =\n options.delete(:cache_store) ||\n ActiveModelSerializers.config.cache_store ||\n ActiveSupport::Cache.lookup_store(:null_store)\n self._cache_key = options.delete(:key)\n self._cache_only = options.delete(:only)\n self._cache_except = options.delete(:except)\n self._cache_options = options.empty? ? nil : options\n end", "def association\n @association ||= options[:association]\n end", "def load!(includes, options = {})\r\n case includes\r\n when Array\r\n includes.each { |association|\r\n load! association, :limit => options[:limit]\r\n }\r\n when Hash\r\n includes.each { |association, subassociation|\r\n associated = load! association, :include => subassociation,\r\n :limit => options[:limit]\r\n }\r\n when String, Symbol\r\n name = self.class.associations(version)[includes = includes.to_sym]\r\n return unless name\r\n macro = self.class.model.reflect_on_association(name).macro\r\n\r\n @loaded[includes] ||= if [:belongs_to, :has_one].include?(macro)\r\n associated = send(includes).target\r\n if options[:include]\r\n associated.load! options[:include], :limit => options[:limit]\r\n end\r\n associated\r\n else\r\n configuration = {}\r\n configuration[:limit] = options[:limit] || MAXIMUM_LIMIT\r\n configuration[:include] = options[:include] if options[:include]\r\n collection = send(includes).scoped(configuration).to_collection\r\n\r\n if collection.pagination\r\n collection.pagination.path = attributes[includes] || includes\r\n end\r\n\r\n if options[:include]\r\n collection.each { |record|\r\n record.load! options[:include], :limit => options[:limit]\r\n }\r\n end\r\n\r\n collection\r\n end\r\n end\r\n end", "def reflect_on_association(name)\n self.class.reflect_on_association(name)\n end", "def initialize_association_cache(objects)\n name = self[:name]\n if assign_singular?\n objects.each{|object| object.associations[name] = nil}\n else\n objects.each{|object| object.associations[name] = []}\n end\n end", "def cache_supported_on_inverse_model?\n inverse_of && inverse_of.belongs_to?\n end", "def association\n self.parent && self.parent.dbi.reflect_on_association(self.association_name)\n end", "def association (name, options = {})\n name = name.to_sym\n options = symbolize_keys(options)\n association_factory = options[:factory] || name\n\n add_attribute(name) {|a| a.association(association_factory) }\n end", "def associated_dataset\n cached_fetch(:_dataset){apply_dataset_changes(_associated_dataset)}\n end", "def add_association(model_name, association_name, association_meta, association_class=nil)\n @associations[model_name] ||= {}\n @associations[model_name][association_name] = {\"meta\" => association_meta, \"class_name\" => association_class || association_name.classify}\n end", "def construct_association(parent, reflection, attributes, seen, model_cache)\n return if attributes.nil?\n\n klass = if reflection.polymorphic?\n parent.send(reflection.foreign_type).constantize.base_class\n else\n reflection.klass\n end\n id = attributes[klass.primary_key]\n model = seen[parent.class.base_class][parent.id][klass][id]\n\n if model\n construct(model, attributes.select{|k,v| !klass.column_names.include?(k.to_s) }, seen, model_cache)\n\n other = parent.association(reflection.name)\n\n if reflection.collection?\n other.target.push(model)\n else\n other.target = model\n end\n\n other.set_inverse_instance(model)\n else\n model = construct_model(parent, reflection, id, attributes.select{|k,v| klass.column_names.include?(k.to_s) }, seen, model_cache)\n seen[parent.class.base_class][parent.id][model.class.base_class][id] = model\n construct(model, attributes.select{|k,v| !klass.column_names.include?(k.to_s) }, seen, model_cache)\n end\n end", "def association (name, options = {})\n name = name.to_sym\n options = options.symbolize_keys\n association_factory = options[:factory] || name\n\n add_attribute(name) {|a| a.association(association_factory) }\n end", "def eager_load_belongs_to(obj)\n association = self.class.associations.select{|k,v| v == obj.class.name}.first or return\n name = association.first\n return unless name\n @associations[name] = obj\n end", "def association(name)\n if reflection = _scope.reflect_on_association(name)\n Association.new(self, reflection)\n else\n raise AssociationNotFoundError.new(_scope.model_name, name)\n end\n end", "def belongs_to(association_name, metadata={})\n # foo_id\n id_getter = \"#{association_name}_id\".to_sym\n add_attribute(id_getter, :integer, metadata)\n add_association association_name, :belongs_to, metadata\n association_class_name = metadata.try(:fetch, :class_name, [name.split('::')[0..-2].join('::'), association_name.to_s.classify].reject(&:blank?).join('::'))\n\n define_method(id_getter) do\n ivar = \"@#{id_getter}\"\n if instance_variable_defined?(ivar)\n instance_variable_get(ivar)\n else\n if obj = send(association_name)\n instance_variable_set(ivar, obj.id)\n else\n instance_variable_set(ivar, nil)\n end\n end\n end\n\n # foo_id=\n define_method(\"#{id_getter}=\") do |arg|\n instance_variable_set(\"@#{id_getter}\", arg.to_i)\n end\n\n # foo\n define_method(association_name) do\n if instance_variable_defined?(\"@#{association_name}\")\n instance_variable_get(\"@#{association_name}\")\n elsif id = instance_variable_get(\"@#{association_name}_id\")\n association_class = association_class_name.constantize\n\n if self.class.autoload_associations? && association_class.respond_to?(:find)\n instance_variable_set(\"@#{association_name}\", association_class.find(id))\n end\n else\n instance_variable_set(\"@#{association_name}\", nil)\n end\n end\n\n # foo=\n define_method(\"#{association_name}=\") do |arg|\n association_class = association_class_name.constantize\n\n if instance_variable_defined?(\"@#{association_name}_id\")\n remove_instance_variable(\"@#{association_name}_id\")\n end\n instance_variable_set(\"@#{association_name}\", association_class.cast(arg))\n end\n end", "def association(name, options = {})\n define_method \"associated_#{name}\" do\n @result[options.fetch(:from, name).to_s]\n end\n end", "def associations\n # is caching ok?\n unless @associations\n @associations = {}\n klass.relations.each{|name,association|\n @associations[name.to_s] = Association.new(association,self)\n }\n end\n @associations\n end", "def embed(parent, attribute, *args)\n this = self.piece(*args)\n this.candy_adopt(parent, attribute)\n end", "def association\n a = element.dataset[:association]\n # send is spoopy, make sure the message you're sending is actually an association\n return unless safe?(session[:model], a)\n\n session[:model].send(a)\n end", "def cache_attribute(attribute, options = {})\n options[:by] ||= :id\n fields = Array(options[:by])\n\n self.cache_attributes.push [attribute, fields]\n\n field_list = fields.join(\"_and_\")\n arg_list = (0...fields.size).collect { |i| \"arg#{i}\" }.join(',')\n where_list = fields.each_with_index.collect { |f, i| \"#{f} = \\#{quote_value(arg#{i})}\" }.join(\" AND \")\n\n self.instance_eval(ruby = <<-CODE, __FILE__, __LINE__)\n def fetch_#{attribute}_by_#{field_list}(#{arg_list})\n sql = \"SELECT #{attribute} FROM #{table_name} WHERE #{where_list} LIMIT 1\"\n attribute_dynamic_fetcher(#{attribute.inspect}, #{fields.inspect}, [#{arg_list}], sql)\n end\n CODE\n end", "def association(key)\n @associations[key] ||= Association.children(@model, key)\n end", "def assoc_options\n # Wait to implement this in Phase IVa. Modify `belongs_to`, too.\n @assoc_options ||= {}\n @assoc_options\n end", "def decorates_association(relation_name, with: :__guess__)\n relation_name = relation_name.to_sym\n\n define_method(relation_name) do\n @_decorated_associations[relation_name] ||= decorate(__getobj__.public_send(relation_name), with: with)\n end\n end", "def with_local_cache(key, force_refresh, &block)\n raise ScriptError unless block_given?\n if force_refresh || @associations_cache[key].nil?\n results = yield\n @associations_cache[key] = results\n end\n @associations_cache[key]\n end", "def set_association(key, value)\n _associations[key.to_sym] = _cast_association(key, value)\n end", "def association(name,context,version,options={})\n attribute_name = options[:attribute_name] || name\n\n if(@direction == :to_json)\n hash[attribute_name] = QJSON.render_collection(@object.send(name),context,version,options)\n elsif(@direction == :from_json)\n # by default, associations are not parsed out - that is a dangerous,\n # unexpected (to me) behavior!\n else\n raise \"InvalidDirection\"\n end\n end", "def eager(*associations)\n opts = @opts[:eager]\n association_opts = eager_options_for_associations(associations)\n opts = opts ? Hash[opts].merge!(association_opts) : association_opts\n clone(:eager=>opts)\n end", "def belongs_to(association_name, options = {})\n database.schema[self].associations << BelongsToAssociation.new(self, association_name, options)\n end", "def reflect_on_association(name)\n association_by_name[name.to_sym]\n end", "def _load_associated_object(opts, dynamic_opts)\n klass = opts.associated_class\n cache_lookup = opts.fetch(:many_to_one_pk_lookup) do \n opts[:many_to_one_pk_lookup] = opts[:type] == :many_to_one &&\n opts[:key] &&\n opts.primary_key == klass.primary_key\n end\n if cache_lookup &&\n !dynamic_opts[:callback] &&\n (o = klass.send(:primary_key_lookup, ((fk = opts[:key]).is_a?(Array) ? fk.map{|c| send(c)} : send(fk))))\n o\n else\n super\n end\n end", "def enqueue_association(anAssociation, aScope = nil)\n if aScope\n raise NotImplementedError\n else\n blackboard.enqueue_association(anAssociation)\n end\n end", "def association(association_name); end", "def association(name, *options); end", "def promote_cached(**options)\n promote(**options) if promote?\n end", "def process_association(class_name, assoc)\n\n STDERR.print \"\\t\\tProcessing model association #{assoc.name.to_s}\\n\" if @options.verbose\n\n # Skip \"belongs_to\" associations\n return if assoc.macro.to_s == 'belongs_to'\n\n # Only non standard association names needs a label\n \n # from patch #12384\n # if assoc.class_name == assoc.name.to_s.singularize.camelize\n \n assoc_class_name = (assoc.class_name.respond_to? 'underscore') ? assoc.class_name.pluralize.singularize.camelize : assoc.class_name \n if assoc_class_name == assoc.name.to_s.singularize.camelize\n assoc_name = ''\n else\n assoc_name = assoc.name.to_s\n end \n\n if assoc.macro.to_s == 'has_one' \n assoc_type = 'one-one'\n elsif assoc.macro.to_s == 'has_many' && (! assoc.options[:through])\n assoc_type = 'one-many'\n else # habtm or has_many, :through\n return if @habtm.include? [assoc.class_name, class_name, assoc_name]\n assoc_type = 'many-many'\n @habtm << [class_name, assoc.class_name, assoc_name]\n end \n # from patch #12384 \n # @graph.add_edge [assoc_type, class_name, assoc.class_name, assoc_name]\n @graph.add_edge [assoc_type, class_name, assoc_class_name, assoc_name] \n end", "def construct(parent, relations, seen, model_cache)\n relations.each do |key, attributes|\n reflection = parent.class.reflect_on_association(key)\n next unless reflection\n\n if reflection.collection?\n other = parent.association(reflection.name)\n other.loaded!\n else\n if parent.association_cached?(reflection.name)\n model = parent.association(reflection.name).target\n construct(model, attributes.select{|k,v| !reflection.klass.column_names.include?(k.to_s) }, seen, model_cache)\n end\n end\n\n if !reflection.collection?\n construct_association(parent, reflection, attributes, seen, model_cache)\n else\n attributes.each do |row|\n construct_association(parent, reflection, row, seen, model_cache)\n end\n end\n\n end\n end", "def inverse_association(other = nil)\n (other || relation_class).relations[inverse(other)]\n end", "def embed_record(name, options = {})\n klass = options[:class] || EmbeddedRecord.constantize(name.to_s)\n\n unless klass.included_modules.include? Record\n raise ArgumentError, \"Class must include EmbeddedRecord::Record\"\n end\n\n attr = options[:mask_attr] || \"#{name}_mask\"\n\n define_method name do\n if val = send(attr)\n klass.all[val]\n elsif klass.null_record\n klass.null_record\n end\n end\n\n define_method \"#{name}_id\" do\n if val = send(attr)\n klass.all[val].id\n end\n end\n\n define_method \"#{name}_id=\" do |id|\n type_method = embed_id_type_method(klass)\n index = klass.all.index { |obj| obj.id == id.send(type_method) }\n send \"#{attr}=\", index\n index\n end\n\n if options[:scope] == true\n embed_record_scope name\n end\n end", "def define_association(assoc, options = {:view => {}, :summary => {}})\n return {:summary => :none} if options[:summary] == :none\n case assoc.macro\n when :has_one, :belongs_to\n if assoc.options[:polymorphic]\n [:polymorphic_select, :name]\n else\n [:select, :name]\n end\n when :has_many, :has_and_belongs_to_many\n if assoc.options[:polymorphic]\n [:polymorphic_membership, :count]\n else\n [:membership, :count]\n end \n end\n end", "def recursively_embeds_one(options = {})\n embeds_one(\n cyclic_child_name(false),\n options.merge(class_name: self.name, cyclic: true)\n )\n embedded_in cyclic_parent_name, class_name: self.name, cyclic: true\n end", "def include_associations(hash, associations, assocs)\n associations.each do |name, attrs|\n instance = assocs[name.to_sym]\n\n foreign_key = attrs[:foreign_key]\n\n # for cases where instance is:\n # - association is empty (nil)\n # - association is present\n #\n # update hash with the foreign_key\n hash[foreign_key.to_sym] = (instance.id if instance.present?)\n end\n\n hash\n end", "def cache( object = nil )\n return @cache unless object\n @cache[ object.id ] = object\n end", "def preloadable_association?( association )\n @klass.preloadable_associations.include?( association.to_sym )\n end", "def association_chain\n @association_chain ||=\n symbols_for_association_chain.inject([begin_of_association_chain]) do |chain, symbol|\n chain << evaluate_parent(symbol, resources_configuration[symbol], chain.last)\n end.compact.freeze\n end", "def load_associated_objects(opts, reload=false)\n name = opts[:name]\n if @associations.include?(name) and !reload\n @associations[name]\n else\n objs = if opts.returns_array?\n send(opts.dataset_method).all\n else\n if !opts[:key]\n send(opts.dataset_method).all.first\n elsif send(opts[:key])\n send(opts.dataset_method).first\n end\n end\n run_association_callbacks(opts, :after_load, objs)\n # Only one_to_many associations should set the reciprocal object\n objs.each{|o| add_reciprocal_object(opts, o)} if opts.set_reciprocal_to_self?\n @associations[name] = objs\n end\n end", "def expire_associated(order)\n expirable = EXPIRABLE_FIELDS.any? do |key|\n order.changed_attributes.include?(key)\n end\n\n if expirable\n ASSOCIATED_CLASSES.each {|ac|\n publish :purge_cache, ActiveSupport::JSON.encode( {:subject_class => order.class.name, :subject_id => order.id, :associated_class => \"#{ac}\" }) \n }\n end\n end", "def attributes_for_persistence\n self.class.embedded_associations.inject(super) do |attrs, association|\n documents = instance_variable_get(association.ivar)\n # We must explicitly check #nil? (rather than just saying `if documents`)\n # because documents can be an association proxy that is proxying nil.\n # In this case ruby treats documents as true because it is not _really_ nil,\n # but #nil? will tell us if it is proxying nil.\n\n unless documents.nil?\n attrs[association.name] = documents.is_a?(Array) ? documents.map(&:attributes_for_persistence) : documents.attributes_for_persistence\n end\n attrs\n end\n end", "def add_solr_eager_loaded_association association_name\n name = association_name.to_s\n unless self.solr_eager_loaded_associations.include?(name)\n self.solr_eager_loaded_associations << name\n end\n end", "def clear_relationships_cache(*args)\n options = args.extract_options!\n to_clear = RelationshipMixin::MEMOIZED_METHODS - Array.wrap(options[:except])\n flush_cache(*to_clear) unless to_clear.empty?\n\n @association_cache.delete(:all_relationships)\n end", "def embedded_associations\n associations.values.select(&:embedded?)\n end", "def def_association(opts)\n if !opts[:is_used] && @unused_associations_data && (data = @unused_associations_data[name]) && (unused = data[opts[:name].to_s])\n set_unused_options_for_association(opts, unused)\n end\n \n super\n end", "def association_for(reflection)\n inverse = inverse_association_name(reflection)\n Registry[reflection.klass].detect do |mapping|\n association = mapping.associations.detect { |a| a.name == inverse }\n break association if association\n end\n end", "def create_association(macro, association, **options, &block)\n association = association.to_s if association.is_a?(Symbol)\n\n # Shove in additional fabulous options!\n options.reverse_merge!(macro: macro, name: association.camelize(:lower), association: association)\n\n # Reflection on the association & ensure that the world is still round (eg: make sure the association is what we are expecting)\n reflection = @model.reflect_on_association(association)\n raise ArgumentError, \"Could not find association `#{association}` on `#{@model.name}`\" unless reflection\n raise ArgumentError, \"Association `#{association}` on `#{@model.name}` is polymorphic and not supported\" if reflection.polymorphic?\n raise ArgumentError, \"Association `#{association}` on `#{@model.name}` expected to be `#{macro}`, but was `#{reflection.macro}` instead\" unless reflection.macro == macro\n\n # Automatically add the foreign key as an input for optional belongs_to associations\n # if macro == :belongs_to && !options[:required]\n # input(reflection.foreign_key, type: types.ID)\n # end\n\n if macro == :has_many && options.key?(:id_field)\n options[:id_field] = :id\n end\n\n field_map = FieldMap.new(reflection.klass, options)\n field_map.instance_exec(&block) if block_given?\n nested.push(field_map)\n self\n end", "def _set_associated_object(opts, o)\n a = associations[opts[:name]]\n return if a && a == o && !set_associated_object_if_same?\n run_association_callbacks(opts, :before_set, o)\n remove_reciprocal_object(opts, a) if a\n send(opts._setter_method, o)\n associations[opts[:name]] = o\n add_reciprocal_object(opts, o) if o\n run_association_callbacks(opts, :after_set, o)\n o\n end", "def def_one_to_many(opts)\n one_to_one = opts[:type] == :one_to_one\n name = opts[:name]\n key = (opts[:key] ||= opts.default_key)\n km = opts[:key_method] ||= opts[:key]\n cks = opts[:keys] = Array(key)\n opts[:key_methods] = Array(opts[:key_method])\n primary_key = (opts[:primary_key] ||= self.primary_key)\n opts[:eager_loader_key] = primary_key unless opts.has_key?(:eager_loader_key)\n cpks = opts[:primary_keys] = Array(primary_key)\n pkc = opts[:primary_key_column] ||= primary_key\n pkcs = opts[:primary_key_columns] ||= Array(pkc)\n raise(Error, \"mismatched number of keys: #{cks.inspect} vs #{cpks.inspect}\") unless cks.length == cpks.length\n uses_cks = opts[:uses_composite_keys] = cks.length > 1\n opts[:dataset] ||= opts.association_dataset_proc\n opts[:eager_loader] ||= proc do |eo|\n h = eo[:id_map]\n reciprocal = opts.reciprocal\n assign_singular = opts.assign_singular?\n delete_rn = opts.delete_row_number_column\n\n eager_load_results(opts, eo) do |assoc_record|\n assoc_record.values.delete(delete_rn) if delete_rn\n hash_key = uses_cks ? km.map{|k| assoc_record.get_column_value(k)} : assoc_record.get_column_value(km)\n next unless objects = h[hash_key]\n if assign_singular\n objects.each do |object| \n unless object.associations[name]\n object.associations[name] = assoc_record\n assoc_record.associations[reciprocal] = object if reciprocal\n end\n end\n else\n objects.each do |object| \n object.associations[name].push(assoc_record)\n assoc_record.associations[reciprocal] = object if reciprocal\n end\n end\n end\n end\n \n join_type = opts[:graph_join_type]\n select = opts[:graph_select]\n use_only_conditions = opts.include?(:graph_only_conditions)\n only_conditions = opts[:graph_only_conditions]\n conditions = opts[:graph_conditions]\n opts[:cartesian_product_number] ||= one_to_one ? 0 : 1\n graph_block = opts[:graph_block]\n opts[:eager_grapher] ||= proc do |eo|\n ds = eo[:self]\n ds = ds.graph(opts.apply_eager_graph_limit_strategy(eo[:limit_strategy], eager_graph_dataset(opts, eo)), use_only_conditions ? only_conditions : cks.zip(pkcs) + conditions, Hash[eo].merge!(:select=>select, :join_type=>eo[:join_type]||join_type, :qualify=>:deep, :from_self_alias=>eo[:from_self_alias]), &graph_block)\n # We only load reciprocals for one_to_many associations, as other reciprocals don't make sense\n ds.opts[:eager_graph][:reciprocals][eo[:table_alias]] = opts.reciprocal\n ds\n end\n \n return if opts[:read_only]\n\n save_opts = {:validate=>opts[:validate]}\n ck_nil_hash ={}\n cks.each{|k| ck_nil_hash[k] = nil}\n\n if one_to_one\n opts[:setter] ||= proc do |o|\n up_ds = _apply_association_options(opts, opts.associated_dataset.where(cks.zip(cpks.map{|k| get_column_value(k)})))\n if o\n up_ds = up_ds.exclude(o.pk_hash) unless o.new?\n cks.zip(cpks).each{|k, pk| o.set_column_value(:\"#{k}=\", get_column_value(pk))}\n end\n checked_transaction do\n up_ds.skip_limit_check.update(ck_nil_hash)\n o.save(save_opts) || raise(Sequel::Error, \"invalid associated object, cannot save\") if o\n end\n end\n opts[:_setter] = proc{|o| set_one_to_one_associated_object(opts, o)}\n else \n save_opts[:raise_on_failure] = opts[:raise_on_save_failure] != false\n\n opts[:adder] ||= proc do |o|\n cks.zip(cpks).each{|k, pk| o.set_column_value(:\"#{k}=\", get_column_value(pk))}\n o.save(save_opts)\n end\n \n opts[:remover] ||= proc do |o|\n cks.each{|k| o.set_column_value(:\"#{k}=\", nil)}\n o.save(save_opts)\n end\n\n opts[:clearer] ||= proc do\n _apply_association_options(opts, opts.associated_dataset.where(cks.zip(cpks.map{|k| get_column_value(k)}))).update(ck_nil_hash)\n end\n end\n end", "def assoc_searchable(*args)\n opts = args.extract_options!\n args.flatten.each do |assoc|\n assoc = assoc.to_s\n raise(ArgumentError, \"No such association #{assoc} in #{self}\") unless self.reflect_on_all_associations.map {|a| a.name.to_s}.include?(assoc)\n self._metasearch_include_associations = self._metasearch_include_associations.merge(\n assoc => {\n :if => opts[:if]\n }\n )\n end\n end", "def autosave_nested_attributes(association)\n # In order for the autosave functionality to work properly, the association needs to be\n # marked as autosave despite the fact that the option isn't present. Because the method\n # Association#autosave? is implemented by checking the autosave option, this is the most\n # straightforward way to mark it.\n if association.autosave? || (association.options[:autosave].nil? && !association.embedded?)\n association.options[:autosave] = true\n Association::Referenced::AutoSave.define_autosave!(association)\n end\n end", "def allow_lazy_load_for_static_cache_associations\n # :nocov:\n if defined?(::Sequel::Plugins::StaticCache::ClassMethods)\n # :nocov:\n @association_reflections.each_value do |ref|\n if ref.associated_class.is_a?(::Sequel::Plugins::StaticCache::ClassMethods)\n ref[:forbid_lazy_load] = false\n end\n end\n end\n end", "def association_changeset(name)\n association = self.item.send(name)\n # association = association.source if association.decorated?\n\n self.changeset_class(association).new(association, self.data['associations'].fetch(name.to_s).try(:fetch, 'changes'))\n end", "def clear_association_scope_cache # :nodoc:\n @association_scope_cache.clear\n end", "def presents_one(association)\n define_method association do\n present(__getobj__.__send__(association))\n end\n\n association\n end", "def cache_attribute(attribute, by: :id, unique: true)\n cache_attribute_by_alias(attribute, alias_name: attribute, by: by, unique: unique)\n end", "def as_json_cached(options = {})\n keys, json = as_json_partial(options)\n Mongoid::CachedJson.materialize_json_references_with_read_multi(keys, json)\n end" ]
[ "0.7499939", "0.7109111", "0.6008026", "0.6008026", "0.6008026", "0.56056744", "0.55715984", "0.55715984", "0.55703366", "0.5540463", "0.55291826", "0.55284053", "0.55261415", "0.5523675", "0.54644144", "0.5436557", "0.5364033", "0.5353333", "0.53311867", "0.5272194", "0.52717835", "0.52383125", "0.5175086", "0.5139635", "0.5128964", "0.5125243", "0.5098221", "0.508564", "0.5054718", "0.5031557", "0.5024829", "0.50170344", "0.49965078", "0.49229497", "0.49133965", "0.49016756", "0.48886085", "0.48886085", "0.4866482", "0.48633438", "0.48628107", "0.4857344", "0.48485032", "0.48423904", "0.48231438", "0.4821975", "0.4806046", "0.47814262", "0.4766842", "0.47513565", "0.47466588", "0.47356987", "0.47243112", "0.4723813", "0.47134778", "0.46993285", "0.46882913", "0.46864578", "0.46833104", "0.46661076", "0.4651334", "0.46497658", "0.46429288", "0.46292078", "0.4627412", "0.4619253", "0.46152443", "0.46149465", "0.46021253", "0.4587416", "0.458264", "0.45777372", "0.45775947", "0.45760837", "0.4569673", "0.45641154", "0.4561005", "0.4559757", "0.45549318", "0.45333755", "0.45332518", "0.45316774", "0.45263478", "0.45245486", "0.45238918", "0.45172113", "0.45077002", "0.45039716", "0.44978756", "0.44928217", "0.44855806", "0.4484352", "0.44760954", "0.4464885", "0.44642782", "0.44587556", "0.44497854", "0.44459298", "0.44376644", "0.44287407" ]
0.75980335
0
Will cache a single attribute on its own blob, it will add a fetch_attribute_by_id (or the value of the by option). == Example: class Product cache_attribute :quantity, :by => :name cache_attribute :quantity :by => [:name, :vendor] end == Parameters +attribute+ Symbol with the name of the attribute being cached == Options by: Other attribute or attributes in the model to keep values indexed. Default is :id
def cache_attribute(attribute, options = {}) options[:by] ||= :id fields = Array(options[:by]) self.cache_attributes.push [attribute, fields] field_list = fields.join("_and_") arg_list = (0...fields.size).collect { |i| "arg#{i}" }.join(',') where_list = fields.each_with_index.collect { |f, i| "#{f} = \#{quote_value(arg#{i})}" }.join(" AND ") self.instance_eval(ruby = <<-CODE, __FILE__, __LINE__) def fetch_#{attribute}_by_#{field_list}(#{arg_list}) sql = "SELECT #{attribute} FROM #{table_name} WHERE #{where_list} LIMIT 1" attribute_dynamic_fetcher(#{attribute.inspect}, #{fields.inspect}, [#{arg_list}], sql) end CODE end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cache_attribute(attribute, by: :id, unique: true)\n cache_attribute_by_alias(attribute, alias_name: attribute, by: by, unique: unique)\n end", "def define_cache(attribute: to_sym)\n attr = \"config_#{attribute}\"\n\n define_method(attr) do\n if instance_variable_defined?(\"@#{attr}\")\n instance_variable_get(\"@#{attr}\")\n else\n instance_variable_set(\"@#{attr}\", config.fetch(attribute))\n end\n end\n end", "def for(attribute)\n cache = self\n\n Class.new do\n define_singleton_method :[] do |locale|\n cache[locale].send(attribute)\n end\n\n define_singleton_method :[]= do |locale, value|\n cache[locale].send(\"#{attribute}=\", value)\n end\n end\n end", "def cache_attribute?(attr_name)\n cached_attributes.include?(attr_name)\n end", "def cache_attribute?(attr_name)\n cached_attributes.include?(attr_name)\n end", "def cache_attributes(*attribute_names)\n attribute_names.each {|attr| cached_attributes << attr.to_s}\n end", "def call(attribute)\n @attributes[attribute]\n end", "def attr(attribute = nil)\n case attribute\n when Hash\n attribute.each { |key, value| Element.attr self, key, value }\n self\n when String, Symbol\n Element.attr self, attribute\n when nil\n @attr ||= AttributeAccessor.new self\n end\n end", "def get_attribute(attribute)\n\t\t@attributes[attribute.intern]\n\tend", "def query_for(attribute, &block)\n unless loaded? attribute\n assign attribute, block.call\n end\n @attributes[attribute]\n end", "def cached_attributes\n @cached_attributes ||= columns.select { |c| cacheable_column?(c) }.map { |col| col.name }.to_set\n end", "def cache(name, opts={}, &block)\n cache = opts[:cache]\n if cache then\n if redis.exists name then\n redis.get name\n else\n value = yield\n redis.set name, value\n value\n end\n else\n value = yield\n redis.set \"last_request\", Time.now\n end\n end", "def read_attribute(attr_name)\n attr_name = attr_name.to_sym\n\n @attributes_cache[attr_name] || @attributes_cache.fetch(attr_name) do\n data = @attributes.fetch(attr_name) do\n # This statement overrides id to return the primary key\n # if it is set to something other than :id\n if attr_name == :id && self.class.primary_key != attr_name\n return read_attribute(self.class.primary_key)\n end\n\n # For some reason hashes return false for key? if the value\n # at that key is nil. It also executes this block for fetch\n # when it really shouldn't. Detect that error here and give\n # back nil for data\n if @attributes.keys.include?(attr_name)\n nil\n else\n # In this case the attribute was truly not found, if we're\n # given a block execute that otherwise return nil\n return block_given? ? yield(attr_name) : nil\n end\n end\n # This sets and returns the typecasted value\n @attributes_cache[attr_name] = self.typecast_attribute_for_read(\n attr_name,\n data\n )\n end\n end", "def [](attribute)\n get(attribute.to_sym) || set(attribute.to_sym, [])\n end", "def [](attribute)\n get(attribute.to_sym) || set(attribute.to_sym, [])\n end", "def increment(attribute, by = 1)\n attributes[attribute] ||= 0\n attributes[attribute] += by\n self\n end", "def put(cache_method, value)\n cache.send(\"#{cache_method}=\", value)\n end", "def cache_key\r\n attributes.to_s\r\n end", "def get(attribute)\n @attributes[attribute.to_s]\n end", "def [](attribute)\n get(attribute.to_sym) || set(attribute.to_sym, [])\n end", "def [](attribute)\n ensure_loaded! unless self.class[attribute].present_in(@_data)\n self.class[attribute].get(@_data)\n end", "def get attribute\n attributes[attribute]\n end", "def []=(sha, attrs)\n cache[sha] = attrs\n end", "def increment(attribute, by = 1)\n self[attribute] ||= 0\n self[attribute] += by\n self\n end", "def _cached_field(field)\n cached_obj = self.class._cache[\"#{object.id}.#{object.updated_at.to_i}\"] || {}\n cached_obj[field]\n end", "def [](attribute)\n @attributes[attribute.to_s]\n end", "def attribute(locator, attribute)\n find_element(locator).attribute(attribute)\n end", "def increment(attribute, by = 1)\n self[attribute] ||= 0\n self[attribute] += by\n self\n end", "def cache_attribute_for_association(klass,association_name,association_method)\n if klass.respond_to?(:value_cache_options)\n klass.value_cache_options.settings.detect{|k,v| v[:from_entity] == association_name.to_sym && v[:to_entity] == association_method.to_sym }.first\n end\n end", "def cache(key, &block)\n fail 'Block required!' unless block_given?\n Rails.cache.fetch(key, cache_config, &block)\n end", "def cache_key(id); end", "def cache(key = nil)\n key ||= BasicCache.caller_name\n key = key.to_sym\n if include? key\n @store[key].value\n else\n value = yield\n @store[key] = TimeCacheItem.new Time.now, value\n value\n end\n end", "def set_attribute(attribute, value)\n if MojeID.is_attribute_available?(attribute)\n fetch_request.set_values(attribute, value)\n bundle_to_request\n end\n end", "def increment!(attribute, by = 1)\n increment(attribute, by).update_attribute(attribute, self[attribute])\n end", "def increment(attribute, by = 1)\n attribute = attribute.to_s\n self[attribute] ||= 0\n self[attribute] += by\n self\n end", "def attr(attribute, name: attribute.to_s.camelize(:lower), nullable: nil, description: nil, deprecation_reason: nil, &block)\n name = name.to_sym unless name.is_a?(Symbol)\n\n # Get the description from the column, if it's not provided. Doesn't work in Rails 4 :(\n unless description\n column = @model_type.columns_hash[attribute.to_s]\n description = column.comment if column&.respond_to?(:comment)\n end\n\n options = {\n name: name,\n nullable: nullable,\n description: description,\n deprecation_reason: deprecation_reason,\n }\n\n DefinitionHelpers.define_attribute(@graph_type, @base_model_type, @model_type, @path, attribute, @object_to_model, options, @detect_nulls, &block)\n end", "def cache( name, value, created_on )\n meter = Meter.new( :name => name, :value => value, :created_on => created_on, :created_at => Time.now )\n store( name, meter )\n end", "def fetch_attribute_from_object_and_resource(obj, attribute)\n _fetch_attribute_from_object_first(obj, attribute)\n end", "def order_by(attribute)\n @order_by = Dynamicloud::API::Criteria::OrderByClause.asc(attribute)\n self\n end", "def cache_fetch(*args)\n super { |key| @store[key] }\n end", "def read_attribute(attribute)\n @object.send(:read_attribute, attribute.to_sym)\n end", "def sorted(attribute = :bit_rate)\n @sorted ||= {}\n @sorted[attribute] ||= sort_by { |p| p.send(attribute) }\n end", "def cache_key(name, attr_ary)\n \"#{name}:#{attr_ary.inspect}\" # TODO: OK, this can be improved\n end", "def increment!(attribute, by = 1, touch: nil)\n increment(attribute, by)\n change = public_send(attribute) - (public_send(:\"#{attribute}_in_database\") || 0)\n self.class.update_counters(id, attribute => change, touch: touch)\n public_send(:\"clear_#{attribute}_change\")\n self\n end", "def attr(column, attr)\n @attrs[column] = attr\n end", "def []=(name, attribute)\n @attributes << attribute\n update_index(name, attribute)\n end", "def ordered_by(attribute_name)\n ordering[attribute_name]\n end", "def get(cache_method)\n cache.send(cache_method)\n end", "def attribute(attribute_name, options={})\n fauxsql_options[attribute_name] = normalize_options!(options)\n class_eval <<EORUBY, __FILE__, __LINE__\n def #{attribute_name}\n get_fauxsql_attribute(:#{attribute_name})\n end\n\n def #{attribute_name}=(value)\n set_fauxsql_attribute(:#{attribute_name}, value)\n end\nEORUBY\n\n if options[:nest]\n class_eval <<EORUBY, __FILE__, __LINE__\n def #{attribute_name}_attributes=(vals)\n vals = Fauxsql::DSL.normalize_nested_vals!(vals)\n #{attribute_name} = #{attribute_name}.get_nested_record(vals)\n end\nEORUBY\n end\n end", "def __read_memoize(attribute, at_attribute, callable, **opts)\n var = instance_variable_get(at_attribute)\n return var if var && !__reload?(opts)\n\n with_lock { __assign_value(attribute, at_attribute, callable, **opts) }\n instance_variable_get(at_attribute)\n end", "def attribute name, *attr\n\n # Add the attribute\n _attr = AttributeDefinition.new( name, *attr )\n attribute_definitions << _attr\n\n # Inject object with getter and setter for attribute\n define_setter_and_getter(name, _attr)\n end", "def attribute(attribute_name, options = T.unsafe(nil), &block); end", "def cache(resource, identifier, reload = false, &block)\n if CostAgent.cache_provider.nil?\n block.call\n else\n if (!reload && CostAgent.cache_provider.exists?(self.subdomain, resource, identifier))\n CostAgent.cache_provider.get(self.subdomain, resource, identifier)\n else\n CostAgent.cache_provider.set(self.subdomain, resource, identifier, block.call)\n end\n end\n end", "def attributes\n @cache[:attributes]\n end", "def [](*args)\n args = args.first if (args.size == 1)\n return super(args) if args.is_a?(Hash)\n ck = cache_key(args)\n if obj = @cache_store.get(ck)\n return obj\n end\n if obj = super(args)\n @cache_store.set(ck, obj, @cache_ttl)\n end \n obj\n end", "def attribute_get(attribute)\n check_attribute!(attribute)\n send(attribute.to_s)\n end", "def attribute_get(attribute)\n check_attribute!(attribute)\n send(attribute.to_s)\n end", "def get(att)\n @attributes[att] = key.call(\"HGET\", att)\n end", "def [](attribute)\n self.send(attribute)\n end", "def cache(key, opts = {}, &block)\n instance.cache(key, opts, &block)\n end", "def set attribute, value\n attributes[attribute] = value\n end", "def [](attribute)\n `c$Element.prototype.m$get_property.call(#{@element},attribute)`\n end", "def set_attribute(x)\n if attr_name = attribute(x)\n if collection?(x)\n send(attr_name) << yield\n else\n send(\"#{attr_name}=\", yield)\n end\n end\n end", "def [](property)\n if self.class::ATTRIBUTES_FOR_LIQUID.include?(property)\n send(property)\n else\n data[property]\n end\n end", "def attribute(name)\n @attributes ||= {}\n @attributes[name]\n end", "def cache(opts = {}, &block)\n expiration_time = (opts[:expires_in] || default_expire_time).to_i\n stale_time = (opts[:stale_for] || default_stale_if_error_time).to_i\n cache_key = opts[:key]\n\n set_headers(expiration_time, stale_time)\n\n if expiration_time > 0\n ::Rails.cache.fetch(cache_key, raw: true, expires_in: expiration_time) do\n block.call.to_json\n end\n else\n block.call.to_json\n end\n end", "def method_missing(method, *args, &block)\n \n # The getter\n if @metadata.has_key?(method)\n return attribute_get(method)\n else\n # The setter\n \n if (attribute=method.to_s.match(/(.+)=$/).to_a.last)\n attribute_set(attribute, args.first)\n return\n end\n end\n \n super\n \n end", "def attribute(key, type = nil)\n reader = :\"#{key}\"\n writer = :\"#{key}=\"\n\n define_method(reader) do\n self.attributes[reader]\n end\n\n define_method(writer) do |value|\n self.attributes[reader] = value\n end\n end", "def key_value(attribute)\n define_method :\"#{attribute}\" do \n instance_variable_set(:\"@#{attribute}\", Hash.new) unless instance_variable_get(:\"@#{attribute}\")\n instance_variable_get(:\"@#{attribute}\")\n end\n end", "def cache_for(expires, *args, &blk)\n @cache_data ||= CacheData.new\n @cache_data.value caller_locations(1,1)[0].label.to_sym, expires, args, &blk\n end", "def preloadable_attribute(*args)\n args.each do |arg|\n @@preloadable_attributes ||= []\n @@preloadable_attributes << arg\n define_method(arg.to_sym) do |*args|\n preload\n super(*args)\n end\n define_method(\"#{arg}=\".to_sym) do |*args|\n preload\n super(*args)\n end\n end\n end", "def update!(**args)\n @attribute = args[:attribute] if args.key?(:attribute)\n end", "def [](attribute)\n @aliases.fetch(attribute, attribute)\n end", "def attribute(*args)\n @attributes = attributes\n @attributes += args\n @attributes.uniq!\n end", "def set_attribute(id, attribute, value)\n\t\to = getObject(id)\n\t\tif (o != nil && o.respond_to?(:[]))\n\t\t\to[attribute] = value\n\t\telse\n\t\t\tputs \"Could not find object with id = #{id}\"\n\t\tend\n\tend", "def attribute(*args)\n if args.first.is_a?(Hash)\n args.first.each_pair { |k,v| self.attribute(k, :as => v) }\n else # array of attributes\n options = args.extract_options!\n @_options[:attributes] ||= {}\n args.each { |name| @_options[:attributes][name] = options[:as] || name }\n end\n end", "def update!(**args)\n @attribute_id = args[:attribute_id] if args.key?(:attribute_id)\n end", "def cached_value(issue, attr)\n issue_id = issue.is_a?(Integer) ? issue : issue.id\n cache_change(issue_id) unless @changes[issue_id]\n @changes[issue_id][attr] || @changes[issue_id][:start_date]\n end", "def method_missing(method_name, *args)\n @cache ||= Rails.cache.instance_variable_get(\"@data\")\n @cache.send(method_name, *args)\n end", "def cache key, opts = {}\n if opts[:ttl]\n # cache globaly if ttl provided\n Lux.cache.fetch(key, opts) { yield }\n else\n data = @var[:cache] ||= {}\n data = @var[:cache][key]\n return data if data\n @var[:cache][key] = yield\n end\n end", "def set_attribute\n @attribute = Attribute.find(params[:id])\n end", "def set_attribute\n @attribute = Attribute.find(params[:id])\n end", "def cache key, value=nil, &block\n return self[key] if self.has_key?(key)\n @lock.write_sync{ @data[key] = block_given? ? yield() : value }\n end", "def cache(name, value)\n @cache = {} if @cache.nil?\n @cache[name] = value\n end", "def accessor_for(attribute)\n attribute = attribute.to_sym\n\n if table.has_key?(attribute)\n attribute\n\n elsif pair = pair_for(attribute)\n pair.first\n\n else\n send_to_translation(:accessor_for, attribute)\n end\n end", "def cache_key(*args)\n timestamp_columns = args.empty? ? [:updated_at] : args\n\n if (timestamp = max_updated_column_timestamp_for_cache_key(timestamp_columns))\n timestamp_str = timestamp.utc.yield_self do |utc_time|\n if utc_time.respond_to?(:to_fs)\n utc_time.to_fs(cache_timestamp_format)\n else\n utc_time.to_s(cache_timestamp_format)\n end\n end\n \"#{model_name.cache_key}/all/#{count}-#{timestamp_str}\"\n else\n cache_key_without_timestamp\n end\n end", "def cache( object = nil )\n return @cache unless object\n @cache[ object.id ] = object\n end", "def define_redis_attribute_method(attribute_name, klass)\n define_method(attribute_name) do\n klass.new(parent: self).to_value\n end\n\n define_method(\"#{attribute_name}=\") do |value|\n klass.new(parent: self).set(value)\n end\n end", "def cache(key, options = {}, &block)\n name = cache_name(key)\n tags = options.delete(:tags) || []\n check_tags_existance(name, tags)\n if ActionController::Base.perform_caching\n cache = read(name, options)\n if cache && cache.is_a?(Hash) && cache[:data] && is_cache_actual?(cache) \n # Overwriting the cache with the same data for avoiding its expiration\n # when 'freeze cache' option is enabled.\n write(name, cache, options) if AstroConfig.freeze_cache?\n data = modify_cache_by_personalized_data(cache[:data], options)\n data.is_a?(String) ? data.html_safe : data\n else\n self.class.do_not_cache_block = false\n output = execute_block(&block)\n unless self.class.do_not_cache_block\n tags_hash = generate_tags_hash(tags)\n write(name, { :data => output, :tags => tags_hash }, options)\n end\n self.class.do_not_cache_block = false\n output.is_a?(String) ? output.html_safe : output\n end\n else\n execute_block(&block)\n end\n end", "def attribute(name)\n attributes << name\n\n if !method_defined?(name) || name == :id\n attr_accessor name\n end\n end", "def []( attrname )\n\t\tattrsym = attrname.to_sym\n\n\t\tif @values.key?( attrsym )\n\t\t\t# self.log.debug \" value for %p is cached (%p).\" % [ attrname, @values[attrsym] ]\n\t\telse\n\t\t\tself.log.debug \" value for %p is NOT cached.\" % [ attrsym ]\n\t\t\tvalue = self.get_converted_object( attrsym )\n\t\t\tself.log.debug \" converted value is: %p\" % [ value ]\n\t\t\tvalue.freeze if\n\t\t\t\tself.class.freeze_converted_values? &&\n\t\t\t\tvalue.respond_to?( :freeze )\n\t\t\t@values[ attrsym ] = value if value\n\t\tend\n\n\t\treturn @values[ attrsym ]\n\tend", "def update_cache(type, id, data)\n end", "def update_cache(type, id, data)\n end", "def _set_cached_field(field, value)\n cached_obj = self.class._cache[\"#{object.id}.#{object.updated_at.to_i}\"] || {}\n cached_obj[field] = Rails.cache.fetch([object.cache_key, field]) { value }\n end", "def cache_tag(tag)\n # We are down in the cached model so the \"auto-fetch magic\" does\n # not work. We have to check for nil in all the various fields\n t = Time.now\n t = last_fetched unless last_fetched.nil?\n t = pmr.last_fetched unless pmr.nil? || pmr.last_fetched.nil? || pmr.last_fetched < t\n q = queue\n c = queue.center\n \"#{q.queue_name},#{q.h_or_s},#{c.center},#{ppg}-#{t.tv_sec}.#{t.usec}-#{tag}\"\n end", "def fetch(&block)\n Rails.cache.fetch(cache_key, &block)\n end", "def cache_version\n return unless cache_versioning\n\n if has_attribute?(\"updated_at\")\n timestamp = updated_at_before_type_cast\n if can_use_fast_cache_version?(timestamp)\n raw_timestamp_to_cache_version(timestamp)\n\n elsif timestamp = updated_at\n timestamp.utc.to_fs(cache_timestamp_format)\n end\n elsif self.class.has_attribute?(\"updated_at\")\n raise ActiveModel::MissingAttributeError, \"missing attribute 'updated_at' for #{self.class}\"\n end\n end", "def attribute(attribute)\n send(\"#{attribute}=\", self.copies)\n end", "def []=(attribute, hint)\n self[attribute] << hint\n end", "def cache_if!(condition, *args, &block)\n condition ? cache!(*args, &block) : yield\n end" ]
[ "0.84327346", "0.62910044", "0.62597424", "0.61294657", "0.61114895", "0.5943057", "0.5901276", "0.5774308", "0.57650864", "0.57271767", "0.56748915", "0.5601818", "0.5591343", "0.5543306", "0.5543306", "0.5540423", "0.553313", "0.5527815", "0.5520861", "0.550085", "0.5493077", "0.54823524", "0.5481243", "0.5471409", "0.5469836", "0.5467208", "0.5440344", "0.5440115", "0.5440045", "0.542258", "0.5419635", "0.54162407", "0.5401833", "0.5396087", "0.5392479", "0.5364443", "0.53476834", "0.5344752", "0.5340724", "0.53303444", "0.53299963", "0.53289574", "0.53238547", "0.53163594", "0.53151417", "0.5299737", "0.5294911", "0.5293798", "0.528883", "0.5287066", "0.52831525", "0.52815765", "0.5278224", "0.5275893", "0.52755296", "0.52697355", "0.52697355", "0.5263558", "0.5224813", "0.5219853", "0.5211657", "0.5203681", "0.51925623", "0.51811147", "0.51783437", "0.5156848", "0.5150224", "0.5145037", "0.51445943", "0.51403743", "0.51387554", "0.5138587", "0.5137428", "0.5129706", "0.51224554", "0.5116353", "0.5113262", "0.5110694", "0.51052237", "0.50988126", "0.50959635", "0.50959635", "0.50949746", "0.50902355", "0.5088874", "0.5073363", "0.50726813", "0.506396", "0.5061807", "0.5057541", "0.50562674", "0.50556487", "0.50556487", "0.50540245", "0.5048177", "0.5039274", "0.5037771", "0.50364643", "0.5035587", "0.5027762" ]
0.83529663
1
Similar to ActiveRecord::Baseexists? will return true if the id can be found in the cache.
def exists_with_identity_cache?(id) !!fetch_by_id(id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exists?(cache_key)\n @pg.exec_prepared(@exists_statement_name, [object_to_cache_key(cache_key)]).ntuples.eql?(1)\n end", "def exists?(id)\n with_redis { |redis| !redis.get(id).nil? }\n end", "def record_cached?(id)\n _record_cache.has_key?(id.to_s)\n end", "def exists?\n model.exists?(@id)\n end", "def exists? args = {}\n RedisModelExtension::Database.redis {|r| r.exists(self.name.constantize.generate_key(args)) }\n end", "def exists?\n storage.exists?(id)\n end", "def check_cache(type, id)\n end", "def check_cache(type, id)\n end", "def exists?(classname, id)\n #Make sure the given data are in the correct types.\n classname = classname.to_sym\n id = id.to_i\n\n #Check if ID-cache is enabled for that classname. Avoid SQL-lookup by using that.\n if @ids_cache_should.key?(classname)\n if @ids_cache[classname].key?(id)\n return true\n else\n return false\n end\n end\n\n #If the object currently exists in cache, we dont have to do a lookup either.\n return true if @objects.key?(classname) and obj = @objects[classname].get!(id) and !obj.deleted?\n\n #Okay - no other options than to actually do a real lookup.\n begin\n table = @args[:module].const_get(classname).table\n row = @args[:db].single(table, {@args[:col_id] => id})\n\n if row\n return true\n else\n return false\n end\n rescue Errno::ENOENT\n return false\n end\n end", "def exists?\n !new? && self.class.exists?(id)\n end", "def existe_cache?(recurso)\n if Rails.cache.exist?(\"#{recurso}_#{id}\")\n cache = Rails.cache.read(\"#{recurso}_#{id}\")\n\n begin\n (cache[:created_at] + cache[:expires_in]) > Time.now.to_f\n rescue\n false\n end\n\n else\n false\n end\n end", "def exists?\r\n !new? && self.class.exists?(id, prefix_options)\r\n end", "def check_cache(type, id)\n end", "def exist?(key)\n File.exist?(cache_path(key))\n end", "def cache_exist?\n File.exist?(@cache_file)\n end", "def exists?\n !new? && self.class.exists?(id, prefix_options)\n end", "def has_key?(key)\n @cache.has_key?(key)\n end", "def cache?(key)\n auth_objects_cache.key? key\n end", "def exist?(key, options = nil)\n Rails.cache.exist?(key, options)\n rescue => exc\n Rails.logger.error { \"MEMCACHE-ERROR: exists?: K: #{key.inspect}. M: #{exc.message}, I: #{exc.inspect}\" }\n nil\n end", "def is_in_cache(var)\n Rails.cache.exist?(var)\nend", "def _in_cache?(field)\n return false if self.class._cache.blank?\n cached_obj = self.class._cache[\"#{object.id}.#{object.updated_at.to_i}\"]\n cached_obj.present? && cached_obj[field].present?\n end", "def exists?\n load!\n true\n rescue RecordNotFound\n false\n end", "def cache_exists?\n File.exist?(cached_file)\n end", "def exists?(key)\n # Use recommended binary-returning method create [with this redis-rb commit](https://github.com/redis/redis-rb/commit/bf42fc9e0db4a1719d9b1ecc65aeb20425d44427).\n return Lit.redis.exists?(key) if Lit.redis.respond_to?(:exists?)\n\n # Fall back with older gem\n Lit.redis.exists(key)\n end", "def exists?\n redis.exists(name)\n end", "def cached?(key)\n false\n end", "def exists?(path)\n return unless @cache_base\n\n File.exists?(@cache_base + path)\n end", "def exists?()\n #This is a stub, used for indexing\n end", "def cached? *key\n @cache.has_key? key\n end", "def exists?\n\t\treturn false\n\tend", "def cached?\n cache_path.exist?\n end", "def cached?\n cache_path.exist?\n end", "def batch_exist?(id)\n mutex(id) do |bid|\n redis.exists(bid)\n end\n end", "def exists?(id)\n rec = CONNECTION.execute(\"SELECT * FROM #{table_name} WHERE id = #{id};\").first\n if rec.nil?\n false\n else\n self.new(rec)\n end\n end", "def exists?\n true\n end", "def cached?(key)\n not @memcache.get(key).nil?\n end", "def exists?\n false\n end", "def exists?\n false\n end", "def exist?\n @exists\n end", "def exists_by_primary_key?(primary_key)\n qry = \"SELECT COUNT(*) AS `c` FROM `#{@table_name}` WHERE \"+build_where({@primary_key => primary_key})\n res = cached_query(qry,[@table_name])\n res[0]['c'] != 0\n end", "def exist?\n true\n end", "def exists?()\n end", "def exists?\n retrieve\n true\n rescue Error::NoSuchKey\n false\n end", "def exists?(object); end", "def exists?(object); end", "def cache_table_exists?\n @pg.exec(%{SELECT 1 FROM pg_class WHERE pg_class.relname = '#{@table_name}';}).ntuples.eql?(1)\n end", "def exists?(id)\n path(id).exist?\n end", "def exists?(id)\n path(id).exist?\n end", "def exist?\n !find_exists.nil?\n end", "def exist?(name)\n @redis.exists(name)\n end", "def cached?\n Report::Table::CachedRow.exists_for_table?(table_key)\n end", "def exists?(key)\n @redis.exists(prefix(key))\n end", "def exists?(id)\n Stal.solve(redis, [\"SISMEMBER\", key, id]) == 1\n end", "def exist?(key)\n store.key?(key)\n end", "def exists?\n this.count > 0\n end", "def exists?\n !count.zero?\n end", "def lut_cache_exists?(name)\n !lut_read_cache_item(name, 0).nil?\n end", "def exists?(id, options = {})\n id && !find_single(id, options).nil?\n rescue ActiveResource::ResourceNotFound\n false\n end", "def exists?\n @exists\n end", "def exists?(id, options = {})\r\n id && !find_single(id, options).nil?\r\n rescue ActiveResource::ResourceNotFound\r\n false\r\n end", "def exists?(id)\n !index[id.to_s].nil?\n end", "def exists?\n [email protected]? && @exists\n end", "def exists?\n [email protected]? && @exists\n end", "def include?(entry)\n @cache.has_key?(key_for(entry))\n end", "def exists?\n !@not_found\n end", "def cached?(file_id)\n synchronize do\n return @cached_files.include?(file_id)\n end\n end", "def exists?\n rec = run_sql(\"SELECT * FROM #{table} WHERE id = #{@id};\")\n if rec.empty?\n @errors << \"That id does not exist in the table.\"\n false\n else\n true\n end\n end", "def cache?\n persisted?\n end", "def exists?; end", "def exist?(key)\n\n end", "def exists?\n _redis.exists(_batch_key)\n end", "def exists?\n [email protected]? && @exists\n end", "def exists?\n [email protected]? && @exists\n end", "def exists?\n [email protected]? && @exists\n end", "def exists?\n @redis.sismember md5_list, @md5_sum\n end", "def exists?\n return id.to_s =~ /\\d+/\n end", "def exists?\n\t\treturn self.entry ? true : false\n\tend", "def exists?(id)\n return Regulate::Git::Interface.exists?(id)\n end", "def exist?(*args)\n find(*args) && true\n rescue NotFoundError\n false\n end", "def cacheable?\n @cacheable\n end", "def exists?\n !!@exists\n end", "def is_key_exist(key)\r\n (@redis.exists key) ? true : false \r\n end", "def exist?\n raise NotImplementedError\n end", "def exist?\n nil\n end", "def cacheable?\n true\n end", "def exist?\n @lock.synchronize { valid? }\n end", "def exists(key)\n call(key, [:exists, key], transform: Redis::Boolify, read: true)\n end", "def exists?\n @exists == true\n end", "def exist(key)\n check_return_code(\n Lib.memcached_exist(@struct, key),\n key\n )\n end", "def exist?\n !count.zero?\n end", "def exists?(id:nil, url:nil)\n !!Article.find(id: id, url: url)\n end", "def is_stored? (token, id)\n # guard clause for nil token, we just assume there is no entry\n if(token.nil?)\n return false\n end\n # check redis for id\n id_list = @redis.lrange(token, 0, -1)\n id_list.include?(id)\n end", "def exist\n\treturn true\n end", "def cache?\n caching && true\n end", "def exist? (name)\n @by_id[name.to_s]\n end", "def exists?()\n\t\t\treturn @metadata.exists?\n\t\tend", "def exists?\n fail NotImplementedError\n end", "def include?(key)\n File.exist?(cache_path(key))\n end", "def exists?(entity, id)\n repo = BaseRepo.new\n repo.exists?(entity, id: id)\n end", "def new_cache_needed?\n uses_slug_cache? && slug? && send(friendly_id_config.cache_column) != slug.to_friendly_id\n end" ]
[ "0.78093016", "0.7715993", "0.76719224", "0.7443368", "0.7342068", "0.73328525", "0.73315525", "0.73315525", "0.73269147", "0.73006266", "0.7258012", "0.72226185", "0.7202974", "0.7195096", "0.7189971", "0.71881694", "0.71802914", "0.71756184", "0.7149588", "0.7127933", "0.71244264", "0.71211743", "0.7111832", "0.70918584", "0.70130944", "0.7003571", "0.6990406", "0.69554764", "0.69553185", "0.6939654", "0.6927638", "0.69144684", "0.69122356", "0.68958575", "0.6872178", "0.6866669", "0.68410903", "0.68410903", "0.6804826", "0.6785213", "0.6776994", "0.6776297", "0.67709965", "0.67640054", "0.67640054", "0.67630166", "0.6757855", "0.6757855", "0.6746912", "0.6738991", "0.67323214", "0.67307925", "0.671998", "0.6714934", "0.6711546", "0.67112", "0.6699254", "0.6697185", "0.6686752", "0.66860485", "0.6675542", "0.66708475", "0.66708475", "0.6666377", "0.6664505", "0.66625065", "0.6662256", "0.66559285", "0.66541004", "0.6651856", "0.6651155", "0.6642596", "0.6642596", "0.6642596", "0.66425794", "0.6640512", "0.6636014", "0.6629495", "0.6606934", "0.66017836", "0.660059", "0.6598549", "0.658461", "0.6583253", "0.6583002", "0.6579576", "0.6570761", "0.655895", "0.65585303", "0.6553264", "0.65515506", "0.6548135", "0.65412736", "0.6531861", "0.6520557", "0.65189785", "0.6518969", "0.65154016", "0.65079266", "0.6500098" ]
0.87005544
0
Default fetcher added to the model on inclusion, it behaves like ActiveRecord::Base.find_by_id
def fetch_by_id(id) if IdentityCache.should_cache? require_if_necessary do object = IdentityCache.fetch(rails_cache_key(id)){ resolve_cache_miss(id) } IdentityCache.logger.error "[IDC id mismatch] fetch_by_id_requested=#{id} fetch_by_id_got=#{object.id} for #{object.inspect[(0..100)]} " if object && object.id != id.to_i object end else self.find_by_id(id) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find(id)\n fetch([name, id]) do\n super\n end\n end", "def entity load=true\n @entity ||= (klass.where(id: id).first if load)\n end", "def fetch!(id, options = {}, &block)\n fetch(id, options.merge(save: true), &block)\n end", "def fetch(id)\n fetch_by_id(id) or raise(ActiveRecord::RecordNotFound, \"Couldn't find #{self.class.name} with ID=#{id}\")\n end", "def fetch(id)\n fetch_by_id(id) or raise(ActiveRecord::RecordNotFound, \"Couldn't find #{self.name} with ID=#{id}\")\n end", "def load_commentable_first\n \t# /photos/1, or /articles/2,...\n \tresource, id = request.path.split('/')[1,2]\n\n \t# photos -> photo -> 'Photo' -> Photo -> Photo.find\n \t@commentable = resource.singularize.classify.constantize.find(id)\n end", "def fetch_by_id(id)\n ensure_base_model\n raise_if_scoped\n return unless id\n raise NotImplementedError, \"fetching needs the primary index enabled\" unless primary_cache_index_enabled\n if IdentityCache.should_use_cache?\n\n require_if_necessary do\n object = nil\n coder = IdentityCache.fetch(rails_cache_key(id)){ coder_from_record(object = resolve_cache_miss(id)) }\n object ||= record_from_coder(coder)\n IdentityCache.logger.error \"[IDC id mismatch] fetch_by_id_requested=#{id} fetch_by_id_got=#{object.id} for #{object.inspect[(0..100)]} \" if object && object.id != id.to_i\n object\n end\n\n else\n self.reorder(nil).where(primary_key => id).first\n end\n end", "def fetch_record_by_param\n model.find(params[:id])\n end", "def fetch_one(id, extra_controller_params)\n puts \"fetch one search helper\"\n old_solr_doc_params = Deprecation.silence(Blacklight::SearchHelper) do\n solr_doc_params(id)\n end\n\n if default_solr_doc_params(id) != old_solr_doc_params\n Deprecation.warn Blacklight::SearchHelper, \"The #solr_doc_params method is deprecated. Instead, you should provide a custom SolrRepository implementation for the additional behavior you're offering. The current behavior will be removed in Blacklight 6.0\"\n extra_controller_params = extra_controller_params.merge(old_solr_doc_params)\n end\n \n #Override id\n if params[\"DocId\"]\n id = params[\"DocId\"]\n #Rails.logger.debug(\"Found DocID #{params['DocId'].inspect} and id is #{id.inspect}\")\n else \n id ||= params[:id]\n #Rails.logger.debug(\"Using other id\")\n end\n \n\n solr_response = repository.find id, extra_controller_params\n [solr_response, solr_response.documents.first]\n end", "def find_locally(id)\n if @all.present?\n @all.find { |model| model.id == id }\n end\n end", "def find(id)\n raise NotImplementedError\n end", "def find_by_id(id, options={})\n name = self.class.name.demodulize.downcase\n route = Automatic::Client.routes.route_for(name)\n url = route.url_for(id: id)\n\n request = api_client.get(url, options)\n\n if request.success?\n self.class::INDIVIDUAL_MODEL.new(request.body)\n else\n nil\n end\n end", "def find(id, options = {})\n if model = find_locally(id)\n model\n else\n adapter(model_class).find(id, options)\n end\n end", "def find( id )\n model.get( id ).extend( InstanceMethods )\n end", "def find(id); end", "def find(id); end", "def find id\n model.find id\n end", "def load_by_id(name = nil)\n load_by(:id, name)\n end", "def load_by_id(_id, _context)\n raise NotImplementedError\n end", "def fetch(id)\n search(id: id)[:records].first\n end", "def find(id)\n klass.find(id)\n end", "def retrieve\n self.class.get( id )\n end", "def fetch_reference_by_id(id)\n Association::LazyEntityReference.new(id, self)\n end", "def fetch_by_id(model, id, filters = {})\n get_resource(\"/v1/public/#{model}/#{id}\", filters) if model_exists?(model) && validate_filters(filters)\n end", "def retrieve(id)\n instance = self.new(id)\n url = instance.url\n requestor = Requestor.new\n response = requestor.request(:get, url)\n instance.load_from(response)\n instance\n end", "def fetch\n raise NotImplementedError\n end", "def find_by_id(id)\n raise NotImplementedError.new\n end", "def fetch(*)\n raise NotImplementedError, 'This should be defined in a subclass'\n end", "def fetch\n raise NotImplementedError\n end", "def find(id, options = {})\n decorated = decorated_class.find(id)\n decorated ? resolve_associations([new(decorated)], options).first : nil\n end", "def find_single(id, *args)\n data = get(id.to_s, *args)\n return nil unless data && !data.empty?\n instantiate(id, data)\n end", "def fetch(id)\n build_resource(raw.fetch(id))\n end", "def find_by_id(client, id, options: {})\n\n self.new(parse(client.get(\"/stories/#{id}\", options: options)).first, client: client)\n end", "def find(id)\n end", "def find_one(id)\n response = request(:get, \"/#{resource_name}/#{id}\")\n #puts response\n construct_record_from_singular(response)\n end", "def fetch_item(id, api_url=ANN_API_URL)\n\t\tbatch_items([id], api_url).first\n\tend", "def find(id)\n\nend", "def fetch(dn = self.dn, options = {}) #:nodoc:\n find_one(dn, options)\n end", "def real(options={})\n @real ||= self.type.constantize.find(self.id, options)\n end", "def get!(id)\n klass.find(:all, params: { id: wrap_key(id) })\n end", "def fetch(id)\n # Pass in a proc that will return true if item with id is looked up\n # (pass in invItem as a param to lambda)\n return lookup(id, Proc.new { |invItem| return invItem } )\n end", "def by_id(id)\n raise NotImplementedError.new\n end", "def find(id)\n return nil if id.blank?\n path = build_association_path lambda { \"#{@owner.request_path(@params)}#{@opts[:path]}/#{id}\" }\n @klass.get(path, @params)\n end", "def fetch(id = nil, eds_params = nil)\n if id.is_a?(Array)\n fetch_many(id, search_state.to_h, eds_params)\n else\n fetch_one(id, eds_params)\n end\n end", "def find_by_id(id)\n find(id)\n end", "def find(id)\n finder_or_run(:find, id)\n end", "def find(id)\n return nil if id.blank?\n path = build_association_path -> { \"#{@parent.request_path(@params)}#{@opts[:path]}/#{id}\" }\n @klass.get_resource(path, @params)\n end", "def fetch(*args)\n raise NotImplementedError, 'Implement a method to fetch the resource.'\n end", "def load_commentable\n return @commentable if @commentable\n param = params.detect { |name, value| name.to_s =~ /(.+)_id$/ }\n if param\n @commentable = param[0].to_s.gsub(/_id$/,'').classify.constantize.find(param[1])\n else\n nil\n end\n end", "def find_by_param(value,args={})\n if permalink_options[:prepend_id]\n param = \"id\"\n value = value.to_i\n else\n param = permalink_options[:param]\n end\n self.send(\"find_by_#{param}\".to_sym, value, args)\n end", "def fetch(resource_type,identifier,params={})\n path = '/api/' + resource_type.to_s + '/' + slugify(identifier)\n hydrate(resource_type, http_get(path,params))\n end", "def find id, preserve_html=false\n check_for_falsy_id id\n Entity.new id, preserve_html\n end", "def find(id)\n find_result\n end", "def find_with_custom_id(*args)\n if block_given?\n return find_without_custom_id(*args) do |*block_args|\n yield(*block_args)\n end\n end\n\n if args.length != 1\n return find_without_custom_id(*args)\n end\n\n arg = args.first\n\n unless arg.is_a?(String)\n return find_without_custom_id(arg)\n end\n\n if arg.match UUIDTools::UUID_REGEXP\n return find_without_custom_id(arg)\n end\n\n joins(:custom_urls).where(custom_urls: { id: arg }).take!\n end", "def id_finder\n @id_finder ||= extract_id ? :all_of : :where\n end", "def include_by entity_type, entity_id, user_id\n if entity = entity_type.singularize.camelize.constantize.find(entity_id)\n include entity, user_id\n end\n end", "def fetch_model\n model_name.camelize.constantize.find( params[:id] )\n end", "def load_commentable\n \tresource, id = request.path.split('/')[1,2]\n \t@commentable = resource.singularize.classify.constantize.find(id)\n end", "def find\n super.first\n end", "def load_commentable\n klass = [Photo, Story].detect { |c| params[\"#{c.name.underscore}_id\"] }\n @commentable = klass.find(params[\"#{klass.name.underscore}_id\"])\n end", "def set_github_load\n @github_load = GithubLoad.find(params[:id])\n end", "def find id, params = {}, &block\n rel = relation params, &block\n rel.where!(config.document_unique_id_param => id) \n rel.load\n rel\n end", "def get(id)\n klass.find(:first, params: { klass.primary_key => wrap_key(id) })\n end", "def load_commentable\n klass = [Post, Comment].detect { |c| params[\"#{c.name.underscore}_id\"]}\n @commentable = klass.find(params[\"#{klass.name.underscore}_id\"])\n end", "def fetch\n end", "def fetch\n raise \"not implemented\"\n end", "def specific_show(model, id)\n model.find(id)\n end", "def fetcher\n @_fetcher ||= TspotFetcher.new(name)\n end", "def find(id, params = {})\n from_base id, params\n end", "def impressionable_find\n exeception_rescuer {\n @entity = impressionable_class.find(self.impressionable_id)\n }\n @entity\n\n end", "def find(id)\n # Used where so no exception will be raised if the instance\n # does not exist.\n @model.unscoped.where(@model_data['mappings']['id'].to_sym => id).first\n end", "def find_by_friendly_id(id); end", "def lookup(field)\n id = field.to_s\n Server.new_instance self, collection.find_one(id)\n rescue BSON::InvalidObjectId\n Server.new_instance self, collection.first(:display_name => field) || collection.first(:link => field)\n end", "def fetcher\n @fetcher ||=\n if source_type == :url && File.basename(source[:url], \"?*\").end_with?(*NetFetcher::ALL_EXTENSIONS)\n Fetcher.fetcher_class_for_source(source).new(manifest_entry, fetch_dir, build_dir)\n else\n Fetcher.fetcher_class_for_source(source).new(manifest_entry, project_dir, build_dir)\n end\n end", "def method_missing(id, *args, &block)\n # Figure out what kind of resource we're trying to get.\n klass = Scrumy::Models.const_get(id.to_s.capitalize.singularize)\n # Special case for handling id=:current - this really only applies to Sprint resources\n # but if other resources specified the `current` sub-resources then it should still work.\n if klass.current_url and args.first==:current\n @url = format(klass.current_url, :current)\n else\n # TODO\n # Figure out a better way of determining if the resource is singular or plural\n \n # The only argument that resources ever take is an ID, so pass the first arg as the ID.\n @url = format((id.to_s =~ /s$/ ? klass.list_url : klass.show_url), args.first)\n end\n\n # Here we request the resource using the singular of the resource name as the root\n # to extract from the returned JSON hash.\n response = get(@url, id.to_s.singularize)\n \n # Responses are of two types, either arrays of hashes or a single hash\n if response.kind_of? Array\n # If it's array collect a new array by constructing objects based on the resource\n # name capitalized and singularized.\n response.collect do |obj| \n klass.new(obj, self)\n end\n else\n # Otherwise create a single new object of the correct type.\n klass.new(response, self)\n end\n end", "def find id\n DynamicModel.new perform_request api_url \"summoners/#{id}\"\n end", "def find_by_id(id)\n find_by(:id, id)\n end", "def find_by_id(clazz, id)\n clazz.find(id)\n end", "def find(id)\n found_id = redis.get \"#{klass}:id:#{id}\"\n\n if found_id\n object = self.new\n object.send(:id=, found_id.to_i)\n object\n end\n end", "def find_by_ncbi_id_or_fetch!(ncbi_id)\n find_by_ncbi_id(ncbi_id) || fetch!(ncbi_id)\n end", "def find_by_id(id)\n resp = get(\"/#{exposed_as}/#{id}\")\n case resp.response.code.to_i\n when 200\n result = MultiJson.load resp.parsed_response\n new(result)\n when 404\n nil\n else\n raise \"#{self.class.name}#try_find with ID #{id.inspect} returned unexpected response: #{resp.inspect}\"\n end\n end", "def find(id, optional = {})\n find_all([id], optional).first\n end", "def find_by_id!(id)\n new(one.find_by_id(id) || raise(RecordNotFound, \"A #{name} record for #{id} does not exist.\"))\n end", "def id\n @id || @url\n end", "def getter_url\n\t self.class.resource_url + @id.to_s + '?' + self.class.getter_include.to_s\n end", "def lookup(field)\n id = BSON::ObjectId(field.to_s)\n Server.new_instance self, collection.find_one(id)\n rescue BSON::InvalidObjectId\n Server.new_instance self, collection.find_one({ :display_name=>field }) || collection.find_one({ :link=>field })\n end", "def load_favoritable\n @request = request\n @resource, @id = request.path.split('/')[1,2]\n @favoritable = @resource.singularize.classify.constantize.find(@id)\n end", "def fetch\n client.fetch(self)\n end", "def fetch\n @raw_result = opts_for_cache_proxy[:raw] == true\n\n result = if refresh_cache?\n execute_find(@raw_result)\n elsif cached.is_a?(AridCache::CacheProxy::Result)\n if cached.has_ids? && @raw_result\n self.cached # return it unmodified\n elsif cached.has_ids?\n fetch_from_cache # return a list of active records after applying options\n else # true if we have only calculated the count thus far\n execute_find(@raw_result)\n end\n else\n cached # some base type, return it unmodified\n end\n end", "def load_commentable\n resource, id = request.path.split('/')[1,2]\n @commentable = resource.singularize.classify.constantize.find(id)\n end", "def fetch\n self.class.new(@harvest_client.get(path), harvest_client: @harvest_client)\n end", "def find_each(opts={})\n if @site\n super.collect do |values|\n record = @site.cached_records[values['_id']]\n record ? record : @constructor.load(@site, values)\n end\n else\n super.collect {|values| @constructor.load(values)}\n end\n end", "def load(id)\n #find connction by identifier from .gift\n end", "def find(id, options = {})\n response = fetch({:key => id})\n response.parsed_response['id'] = id\n new(response.parsed_response)\n end", "def find_one\n return super if params[klass.primary_key].present?\n @find_one ||= klass.new_collection_from_result(limit(1).fetch).first\n rescue ::Spyke::ConnectionError => error\n fallback_or_reraise(error, default: nil)\n end", "def fetch(path, payload, id_type, id_number)\n request = unsent_request(path, payload)\n\n if has_id_info? id_type, id_number\n return request.send(id_type, id_number)\n end\n\n request\n end", "def fetch!(options = {}, &block)\n fetch(options.merge(save: true), &block)\n end", "def lazy\n Fetcher.new(self).lazy\n end", "def fetch_object(model, url, params = {}, options = {})\n raise ArgumentError, \"missing model to instantiate\" if model.nil?\n response = do_http_get(url, params, {'Content-Type' => 'text/xml'})\n collection = parse_collection(response, model)\n if collection.is_a?(Quickeebooks::Collection)\n collection.entries.first\n else\n nil\n end\n end", "def find_one(id, query = nil)\n response = request(:get, \"/#{resource_name}/#{id}\", query)\n construct_record_from_singular(response)\n end" ]
[ "0.64649", "0.63680106", "0.63459015", "0.62639517", "0.62422615", "0.6154044", "0.61412954", "0.6114526", "0.6114275", "0.61102635", "0.61093396", "0.60883635", "0.60883033", "0.60677725", "0.60673743", "0.60673743", "0.60553825", "0.6045216", "0.6038123", "0.5997502", "0.59884876", "0.5984336", "0.5971567", "0.5968462", "0.59113353", "0.5897149", "0.5893548", "0.58933717", "0.5890282", "0.587407", "0.584768", "0.5841737", "0.58356696", "0.58116674", "0.57803345", "0.577675", "0.5729688", "0.568649", "0.5680521", "0.56803226", "0.5665468", "0.56595975", "0.56528467", "0.564368", "0.56395066", "0.5639009", "0.5637013", "0.56317776", "0.5631498", "0.5626333", "0.5611636", "0.56088376", "0.56023437", "0.5587724", "0.5576778", "0.55746704", "0.5569678", "0.5556994", "0.55443454", "0.5529536", "0.55268526", "0.5525233", "0.55185986", "0.54997236", "0.54986", "0.5489496", "0.5488264", "0.5476526", "0.54684544", "0.5466427", "0.54647005", "0.5457884", "0.54544336", "0.5453114", "0.5446132", "0.5443562", "0.5436228", "0.5432715", "0.54322475", "0.54169095", "0.54096794", "0.54085994", "0.54071313", "0.5406953", "0.54050833", "0.54016006", "0.53975475", "0.5395627", "0.5386252", "0.5379634", "0.5375547", "0.53711617", "0.53706753", "0.53689516", "0.5367737", "0.53649", "0.5358747", "0.53518045", "0.53500575", "0.5346857" ]
0.6059114
16
Default fetcher added to the model on inclusion, it behaves like ActiveRecord::Base.find, will raise ActiveRecord::RecordNotFound exception if id is not in the cache or the db.
def fetch(id) fetch_by_id(id) or raise(ActiveRecord::RecordNotFound, "Couldn't find #{self.class.name} with ID=#{id}") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fetch_by_id(id)\n if IdentityCache.should_cache?\n\n require_if_necessary do\n object = IdentityCache.fetch(rails_cache_key(id)){ resolve_cache_miss(id) }\n IdentityCache.logger.error \"[IDC id mismatch] fetch_by_id_requested=#{id} fetch_by_id_got=#{object.id} for #{object.inspect[(0..100)]} \" if object && object.id != id.to_i\n object\n end\n\n else\n self.find_by_id(id)\n end\n end", "def fetch_by_id(id)\n ensure_base_model\n raise_if_scoped\n return unless id\n raise NotImplementedError, \"fetching needs the primary index enabled\" unless primary_cache_index_enabled\n if IdentityCache.should_use_cache?\n\n require_if_necessary do\n object = nil\n coder = IdentityCache.fetch(rails_cache_key(id)){ coder_from_record(object = resolve_cache_miss(id)) }\n object ||= record_from_coder(coder)\n IdentityCache.logger.error \"[IDC id mismatch] fetch_by_id_requested=#{id} fetch_by_id_got=#{object.id} for #{object.inspect[(0..100)]} \" if object && object.id != id.to_i\n object\n end\n\n else\n self.reorder(nil).where(primary_key => id).first\n end\n end", "def fetch(id)\n fetch_by_id(id) or raise(ActiveRecord::RecordNotFound, \"Couldn't find #{self.name} with ID=#{id}\")\n end", "def fetch_from_cache\n if paginate?\n\n # Return a paginated collection\n if cached.ids.empty?\n\n # No ids, return an empty WillPaginate result\n [].paginate(opts_for_paginate)\n\n elsif combined_options.include?(:order)\n\n # An order has been specified. We have to go to the database\n # and paginate there because the contents of the requested\n # page will be different.\n klass.paginate(cached.ids, { :total_entries => cached.ids.size }.merge(opts_for_find.merge(opts_for_paginate)))\n\n else\n\n # Order is unchanged. We can paginate in memory and only select\n # those ids that we actually need. This is the most efficient.\n paged_ids = cached.ids.paginate(opts_for_paginate)\n paged_ids.replace(klass.find_all_by_id(paged_ids, opts_for_find(paged_ids)))\n\n end\n\n elsif cached.ids.empty?\n\n # We are returning a regular (non-paginated) result.\n # If we don't have any ids, that's an empty result\n # in any language.\n []\n\n elsif combined_options.include?(:order)\n\n # An order has been specified, so use it.\n klass.find_all_by_id(cached.ids, opts_for_find)\n\n else\n\n # No order has been specified, so we have to maintain\n # the current order. We do this by passing some extra\n # SQL which orders by the current array ordering.\n offset, limit = combined_options.delete(:offset) || 0, combined_options.delete(:limit) || cached.count\n ids = cached.ids[offset, limit]\n\n klass.find_all_by_id(ids, opts_for_find(ids))\n end\n end", "def fetch\n @raw_result = opts_for_cache_proxy[:raw] == true\n\n result = if refresh_cache?\n execute_find(@raw_result)\n elsif cached.is_a?(AridCache::CacheProxy::Result)\n if cached.has_ids? && @raw_result\n self.cached # return it unmodified\n elsif cached.has_ids?\n fetch_from_cache # return a list of active records after applying options\n else # true if we have only calculated the count thus far\n execute_find(@raw_result)\n end\n else\n cached # some base type, return it unmodified\n end\n end", "def fetch!(id, options = {}, &block)\n fetch(id, options.merge(save: true), &block)\n end", "def fetch(name)\n load_cache(name)\n end", "def find(id, options = {})\n if model = find_locally(id)\n model\n else\n adapter(model_class).find(id, options)\n end\n end", "def _fetch\n cache_get(:_fetch) || @opts[:fetch]\n end", "def fetch_item(klass:, cache_key:, default: nil)\n memory_item = @memory_adapter.fetch_item(\n klass: klass,\n cache_key: cache_key,\n default: default\n )\n\n return memory_item if memory_item != default\n\n redis_item = @redis_adapter.fetch_item(\n klass: klass,\n cache_key: cache_key,\n default: default\n )\n\n return default if redis_item == default\n\n @memory_adapter.cache_item(\n klass: klass,\n cache_key: cache_key,\n item: redis_item\n )\n\n redis_item\n end", "def entity load=true\n @entity ||= (klass.where(id: id).first if load)\n end", "def fetch_from_db(cache_miss_ids)\n fail 'sub class to implement'\n end", "def fetch\n raise NotImplementedError\n end", "def fetch\n raise NotImplementedError\n end", "def fetch(key, options = {})\n retries = 2 \n begin\n super\n rescue ArgumentError, NameError => exc \n if retries == 2\n if exc.message.match /undefined class\\/module (.+)$/\n $1.constantize\n end\n retries -= 1\n retry \n elsif retries == 1\n retries -= 1\n preload_models\n retry\n else \n raise exc\n end\n end\n end", "def find(id)\n raise NotImplementedError\n end", "def load( id, object=nil )\n @cache[id] ||= read(id)\n end", "def find(id)\n fetch([name, id]) do\n super\n end\n end", "def cache_fetch(key, default = nil)\n # Retrieve the data and return it\n record = @store[:key => namespaced(key)]\n record.value rescue default\n end", "def smart_fetch_from_cache(opts={}, &block)\n id = opts[:id]\n key = cache_key id\n force_write = opts[:force_write]\n expiration = self.expires_in\n Rails.logger.debug \"#{self.name} cache_key will be #{key}, expiration #{expiration}\"\n unless force_write\n entry = Rails.cache.read key\n if entry\n Rails.logger.debug \"#{self.name} Entry is already in cache: #{key}\"\n return (entry == NilClass) ? nil : entry\n end\n end\n wrapped_response = handling_exceptions(key, opts, &block)\n response = wrapped_response[:response]\n if wrapped_response[:exception]\n Rails.logger.debug \"#{self.name} Error occurred; writing entry to cache with short lifespan: #{key}\"\n expiration = Settings.cache.expiration.failure\n else\n Rails.logger.debug \"#{self.name} Writing entry to cache: #{key}\"\n end\n response = process_response_before_caching(response, opts)\n cached_entry = (response.nil?) ? NilClass : response\n Rails.cache.write(key,\n cached_entry,\n :expires_in => expiration,\n :force => true)\n response\n end", "def fetch(key, &block)\n result = cache.read(key) if should_cache?\n\n if result.nil?\n if block_given?\n ActiveRecord::Base.connection.with_master do\n result = yield\n end\n result = map_cached_nil_for(result)\n\n if should_cache?\n cache.write(key, result)\n end\n end\n logger.debug \"[IdentityCache] cache miss for #{key}\"\n else\n logger.debug \"[IdentityCache] cache hit for #{key}\"\n end\n\n unmap_cached_nil_for(result)\n end", "def fetch(&block)\n Rails.cache.fetch(cache_key, &block)\n end", "def fetch_from_cache(id=nil, force_write=false)\n key = cache_key id\n expiration = self.expires_in\n Rails.logger.debug \"#{self.name} cache_key will be #{key}, expiration #{expiration}, forced: #{force_write}\"\n value = Rails.cache.fetch(\n key,\n :expires_in => expiration,\n :force => force_write\n ) do\n if block_given?\n response = yield\n response = process_response_before_caching(response, {id: id, force_write: force_write})\n cached_entry = response.nil? ? NilClass : response\n cached_entry\n end\n end\n (value == NilClass) ? nil : value\n end", "def fetch\n raise \"not implemented\"\n end", "def find_by_id(id)\n raise NotImplementedError.new\n end", "def load_commentable_first\n \t# /photos/1, or /articles/2,...\n \tresource, id = request.path.split('/')[1,2]\n\n \t# photos -> photo -> 'Photo' -> Photo -> Photo.find\n \t@commentable = resource.singularize.classify.constantize.find(id)\n end", "def find_locally(id)\n if @all.present?\n @all.find { |model| model.id == id }\n end\n end", "def fetch_record_by_param\n model.find(params[:id])\n end", "def load_by_id(_id, _context)\n raise NotImplementedError\n end", "def lazy\n Fetcher.new(self).lazy\n end", "def fetch_by_id(model, id, filters = {})\n get_resource(\"/v1/public/#{model}/#{id}\", filters) if model_exists?(model) && validate_filters(filters)\n end", "def get_if_cached(classname, id)\n classname = classname.to_sym\n id = id.to_i\n\n if @objects[classname] and obj = Wref::Map.get!(id)\n return obj\n end\n\n return nil\n end", "def fetch(dn = self.dn, options = {}) #:nodoc:\n find_one(dn, options)\n end", "def find( id )\n model.get( id ).extend( InstanceMethods )\n end", "def fetch(id)\n search(id: id)[:records].first\n end", "def get(data, ctx, lazy=false) # IDENTITY TRACKING AND LAZY LOADING\n entity_key = extract_key(data)\n key = [self, entity_key]\n # extract_key is generated ad-hoc by model compiler!\n if cached = ctx.entity_cache[key]\n cached\n else\n ctx.entity_cache[key] = get(*entity_key)\n # get is generated ad-hoc by model compiler\n end\n end", "def retrieve\n self.class.get( id )\n end", "def get!(key)\n model = get(key)\n return model if model\n\n raise ActiveRecord::ShardFor::RecordNotFound\n end", "def primary_key_lookup(pk)\n ck = cache_key(pk)\n unless obj = cache_get(ck)\n if obj = super(pk)\n cache_set(ck, obj)\n end\n end \n obj\n end", "def find(*ids)\n if Georeferencer.configuration.perform_caching && perform_object_caching != false\n ids.uniq!\n uncached_ids = ids.reject {|i| Georeferencer.configuration.cache.read(\"#{cache_key_base}/#{i}\").present?}\n [super(*uncached_ids)].flatten.reject(&:blank?).collect do |object|\n Georeferencer.configuration.logger.debug(\"Caching #{cache_key_base}/#{object.id}\")\n Georeferencer.configuration.cache.write(object.cache_key, object)\n end\n all_objects = ids.collect do |id|\n Georeferencer.configuration.cache.read(\"#{cache_key_base}/#{id}\")\n end\n\n all_objects.each {|o| o.run_callbacks(:find)}\n all_objects.length == 1 ? all_objects.first : all_objects\n else\n super\n end\n end", "def fetch(*)\n raise NotImplementedError, 'This should be defined in a subclass'\n end", "def _fetch(*)\n fail NotImplementedError\n end", "def fetch(*args)\n raise NotImplementedError, 'Implement a method to fetch the resource.'\n end", "def find(id, options = {})\n decorated = decorated_class.find(id)\n decorated ? resolve_associations([new(decorated)], options).first : nil\n end", "def find_each(opts={})\n if @site\n super.collect do |values|\n record = @site.cached_records[values['_id']]\n record ? record : @constructor.load(@site, values)\n end\n else\n super.collect {|values| @constructor.load(values)}\n end\n end", "def cache_fetch(key, default = nil)\n value = @client.get(key)\n value.nil? ? default : ::Marshal.load(value)\n end", "def find_single(id, *args)\n data = get(id.to_s, *args)\n return nil unless data && !data.empty?\n instantiate(id, data)\n end", "def fetch_one(id, extra_controller_params)\n puts \"fetch one search helper\"\n old_solr_doc_params = Deprecation.silence(Blacklight::SearchHelper) do\n solr_doc_params(id)\n end\n\n if default_solr_doc_params(id) != old_solr_doc_params\n Deprecation.warn Blacklight::SearchHelper, \"The #solr_doc_params method is deprecated. Instead, you should provide a custom SolrRepository implementation for the additional behavior you're offering. The current behavior will be removed in Blacklight 6.0\"\n extra_controller_params = extra_controller_params.merge(old_solr_doc_params)\n end\n \n #Override id\n if params[\"DocId\"]\n id = params[\"DocId\"]\n #Rails.logger.debug(\"Found DocID #{params['DocId'].inspect} and id is #{id.inspect}\")\n else \n id ||= params[:id]\n #Rails.logger.debug(\"Using other id\")\n end\n \n\n solr_response = repository.find id, extra_controller_params\n [solr_response, solr_response.documents.first]\n end", "def fetch_reference_by_id(id)\n Association::LazyEntityReference.new(id, self)\n end", "def fetch(key, default = :_fetch_default_, &block)\n if Dottie.dottie_key?(key)\n if default != :_fetch_default_\n Dottie.fetch(wrapped_object_or_self, key, default, &block)\n else\n Dottie.fetch(wrapped_object_or_self, key, &block)\n end\n else\n if default != :_fetch_default_\n wrapped_object_or_self.fetch(key, default, &block)\n else\n wrapped_object_or_self.fetch(key, &block)\n end\n end\n end", "def find id\n model.find id\n end", "def find_by_id!(id)\n new(one.find_by_id(id) || raise(RecordNotFound, \"A #{name} record for #{id} does not exist.\"))\n end", "def fetch\n\n set_id_to_cache_key_map\n\n cache_keys_to_fetch = []\n @id_to_cache_key_map.each do |_, keys|\n cache_keys_to_fetch.push(keys[:kit])\n end\n\n data_from_cache = Memcache.read_multi(cache_keys_to_fetch)\n\n ids_for_cache_miss = []\n @ids.each do |id|\n ids_for_cache_miss << id if data_from_cache[@id_to_cache_key_map[id][:kit]].nil?\n end\n\n if ids_for_cache_miss.any?\n\n fetch_data_rsp = fetch_from_db(ids_for_cache_miss)\n\n data_to_set = fetch_data_rsp.data || {}\n\n # to ensure we do not always query DB for invalid ids being cached, we would set {} in cache against such ids\n @ids.each do |id|\n data_to_set[id] = {} if data_from_cache[@id_to_cache_key_map[id][:kit]].nil? && data_to_set[id].nil?\n end\n\n set_cache(data_to_set) if fetch_data_rsp.success?\n\n end\n\n @ids.inject({}) do |data, id|\n data[id] = data_from_cache[@id_to_cache_key_map[id][:kit]] || data_to_set[id]\n data\n end\n\n end", "def promise_find(id)\n sid = id.to_s\n record_in_progress = if _record_cache.has_key?(sid)\n _record_cache[sid]\n else\n self.new(id: id)\n end\n _promise_find(id, record_in_progress)\n end", "def find_one(opts={})\n unless @site\n document = super\n return nil if document.nil?\n @constructor.load(document)\n else\n query = clone.amend(opts)\n \n # construct the criteria hash, and remove the keys allowed by a cacheable lookup\n criteria_hash = query.criteria.to_hash\n id = criteria_hash[:_id]\n keys = criteria_hash.keys\n keys -= [:_id, :_site_id, :model]\n \n # queries are cacheable if they are looking for a single ID\n cacheable = !id.nil? && id.is_a?(BSON::ObjectId) && keys.empty?\n \n # lookup the record in the cache\n if cacheable\n record = @site.cached_records[id]\n return record unless record.nil?\n end\n \n # lookup failed, so perform a query\n record = query.collection.find_one(criteria_hash, query.options.to_hash)\n if record\n record = @constructor.load(@site, record)\n @site.cached_records[id] = record if cacheable\n end\n \n record\n end\n end", "def retrieve(id)\n instance = self.new(id)\n url = instance.url\n requestor = Requestor.new\n response = requestor.request(:get, url)\n instance.load_from(response)\n instance\n end", "def impressionable_find\n exeception_rescuer {\n @entity = impressionable_class.find(self.impressionable_id)\n }\n @entity\n\n end", "def find(id); end", "def find(id); end", "def find(id)\n klass.find(id)\n end", "def find_one\n return super if params[klass.primary_key].present?\n @find_one ||= klass.new_collection_from_result(limit(1).fetch).first\n rescue ::Spyke::ConnectionError => error\n fallback_or_reraise(error, default: nil)\n end", "def read_entry(key, options)\n if cache = local_cache\n cache.fetch_entry(key) { super }\n else\n super\n end\n end", "def find_by_id(id, options={})\n name = self.class.name.demodulize.downcase\n route = Automatic::Client.routes.route_for(name)\n url = route.url_for(id: id)\n\n request = api_client.get(url, options)\n\n if request.success?\n self.class::INDIVIDUAL_MODEL.new(request.body)\n else\n nil\n end\n end", "def find(id)\n finder_or_run(:find, id)\n end", "def fetch(*key)\n @cache[key] ||= yield\n end", "def find_one_with_second_level_cache(id)\n return find_one_without_second_level_cache(id) unless second_level_cache_enabled?\n return find_one_without_second_level_cache(id) unless select_all_column?\n \n id = id.id if ActiveRecord::Base === id\n\n if cachable?\n if record = @klass.read_second_level_cache(id)\n return record\n end\n end\n \n if cachable_without_conditions?\n if record = @klass.read_second_level_cache(id)\n return record if where_match_with_cache?(where_values, record)\n end\n end\n \n record = find_one_without_second_level_cache(id)\n record.write_second_level_cache\n record\n end", "def find_by_ncbi_id_or_fetch!(ncbi_id)\n find_by_ncbi_id(ncbi_id) || fetch!(ncbi_id)\n end", "def get(*key)\n key = model.typecast_key(key)\n return if key.any? { |v| v.blank? }\n\n if resource = @cache[key]\n # find cached resource\n resource\n elsif !loaded? && (query.limit || query.offset > 0)\n # current query is exclusive, find resource within the set\n\n # TODO: use a subquery to retrieve the Collection and then match\n # it up against the key. This will require some changes to\n # how subqueries are generated, since the key may be a\n # composite key. In the case of DO adapters, it means subselects\n # like the form \"(a, b) IN(SELECT a,b FROM ...)\", which will\n # require making it so the Query condition key can be a\n # Property or an Array of Property objects\n\n # use the brute force approach until subquery lookups work\n lazy_load\n @cache[key]\n else\n # current query is all inclusive, lookup using normal approach\n first(model.key(repository.name).zip(key).to_hash)\n end\n end", "def cache_fetch(*args)\n super { |key| @store[key] }\n end", "def get!(id)\n klass.find(:all, params: { id: wrap_key(id) })\n end", "def load_document(id)\n cached = cache && id.is_a?(String) && cache[id]\n if cache\n if cached\n ActiveSupport::Notifications.instrument('couch_potato.load.cached') do\n cached\n end\n else\n cache[id] = load_document_without_caching(id)\n cache[id]\n end\n else\n load_document_without_caching(id)\n end\n end", "def fetch(id)\n # Pass in a proc that will return true if item with id is looked up\n # (pass in invItem as a param to lambda)\n return lookup(id, Proc.new { |invItem| return invItem } )\n end", "def cache_object\n if [email protected]? && @href =~ /^file:\\/\\//\n return nil\n end\n unless FeedTools.feed_cache.nil?\n if @cache_object.nil?\n begin\n if @href != nil\n begin\n @cache_object = FeedTools.feed_cache.find_by_href(@href)\n rescue RuntimeError => error\n if error.message =~ /sorry, too many clients already/\n warn(\"There are too many connections to the database open.\")\n raise error\n else\n raise error\n end\n rescue => error\n warn(\"The feed cache seems to be having trouble with the \" +\n \"find_by_href method. This may cause unexpected results.\")\n raise error\n end\n end\n if @cache_object.nil?\n @cache_object = FeedTools.feed_cache.new\n end\n rescue\n end \n end\n end\n return @cache_object\n end", "def load_by_id(name = nil)\n load_by(:id, name)\n end", "def find(id)\n # Used where so no exception will be raised if the instance\n # does not exist.\n @model.unscoped.where(@model_data['mappings']['id'].to_sym => id).first\n end", "def cache_fetch(key, default = nil)\n value = @store[key]\n value.nil? ? default : value\n rescue ::MemCache::MemCacheError => e\n Log.error(e)\n nil\n end", "def fetch(key, ttl = nil, req_options = nil)\n req_options = req_options.nil? ? CACHE_NILS : req_options.merge(CACHE_NILS) if cache_nils\n val = get(key, req_options)\n return val unless block_given? && not_found?(val)\n\n new_val = yield\n add(key, new_val, ttl_or_default(ttl), req_options)\n new_val\n end", "def get(id)\n return unless id\n with_redis { |redis| redis.get(redis_key_for(id)).try { |data| load(data) } }\n end", "def find(id)\n @adapter.find(collection, id).tap do |record|\n raise Lotus::Model::EntityNotFound.new unless record\n end\n end", "def find(id)\n found_id = redis.get \"#{klass}:id:#{id}\"\n\n if found_id\n object = self.new\n object.send(:id=, found_id.to_i)\n object\n end\n end", "def find_by_id(id)\n resp = get(\"/#{exposed_as}/#{id}\")\n case resp.response.code.to_i\n when 200\n result = MultiJson.load resp.parsed_response\n new(result)\n when 404\n nil\n else\n raise \"#{self.class.name}#try_find with ID #{id.inspect} returned unexpected response: #{resp.inspect}\"\n end\n end", "def fetch(key, cache_fetcher_options = {})\n if should_use_cache?\n unmap_cached_nil_for(cache.fetch(key, cache_fetcher_options) do\n map_cached_nil_for(yield)\n end)\n else\n yield\n end\n end", "def fetch(key, options = nil) \n if caching_enabled\n result = Rails.cache.fetch(key, options) do\n yield\n end\n Rails.cache.delete(key) unless result\n else\n result = yield\n end\n result\n end", "def fetcher\n @fetcher ||=\n if source_type == :url && File.basename(source[:url], \"?*\").end_with?(*NetFetcher::ALL_EXTENSIONS)\n Fetcher.fetcher_class_for_source(source).new(manifest_entry, fetch_dir, build_dir)\n else\n Fetcher.fetcher_class_for_source(source).new(manifest_entry, project_dir, build_dir)\n end\n end", "def find_with_cache hash, config\n cache = config.cache.get config.key.(hash, config)\n if cache\n hash = config.deserialize.(cache, config)\n if hash[:version] == config.model_class.unicache_version\n return dataset.row_proc.call hash[:values]\n end\n end\n model = yield\n Write.write model if model\n model\n end", "def fetch_from_cache\n get_cache_object().get make_key\n end", "def find(as)\n @cache[as] ||= resolve(as)\n end", "def find(as)\n @cache[as] ||= resolve(as)\n end", "def fetch_item(id, api_url=ANN_API_URL)\n\t\tbatch_items([id], api_url).first\n\tend", "def fetcher\n @_fetcher ||= TspotFetcher.new(name)\n end", "def find_by_id(id)\n results = one.find_by_id_ne(id)\n results && !results['id'].blank? && new(results) || nil\n end", "def find_by_id(id)\n results = one.find_by_id_ne(id)\n results && new(results) || nil\n end", "def fetch( key, &block )\n fail NotImplementedError\n end", "def fetch( key )\n key = key.to_s.strip unless key.nil?\n raise \"Invalid key\" if key.nil? or key == ''\n\n id,value,hits = @db.get_first_row(\n \"SELECT id,value,hits \"+\n \"FROM #{TABLE_NAME} \"+\n \"WHERE key=?\",\n key.to_s.strip\n )\n\n # Return nil if there is cache MISS.\n return nil if value.nil?\n \n # Increment the number of hits\n if @count_hits\n @db.execute(\n \"UPDATE #{TABLE_NAME} SET hits=?, updated_at=? WHERE id=?\",\n hits.to_i+1, Time.now.to_i, id\n )\n end\n\n # Otherwise if there is a HIT, parse the YAML into an object\n return YAML::load(value)\n end", "def fetch!(options = {}, &block)\n fetch(options.merge(save: true), &block)\n end", "def find(id)\n return nil if id.blank?\n path = build_association_path lambda { \"#{@owner.request_path(@params)}#{@opts[:path]}/#{id}\" }\n @klass.get(path, @params)\n end", "def cached_fetch(key)\n fetch(key) do\n return yield unless h = self[:cache]\n Sequel.synchronize{return h[key] if h.has_key?(key)}\n value = yield\n Sequel.synchronize{h[key] = value}\n end\n end", "def cache_fetch(key, default = nil)\n @moneta.fetch(key, default)\n end", "def real(options={})\n @real ||= self.type.constantize.find(self.id, options)\n end", "def fetch(*key)\n if block_given?\n @cache[key] ||= yield\n else\n @cache[key]\n end\n end" ]
[ "0.71081644", "0.674263", "0.63975567", "0.63883823", "0.63550884", "0.6301141", "0.61329335", "0.6119155", "0.6086731", "0.606244", "0.6040327", "0.6013962", "0.6012218", "0.600558", "0.60049", "0.60022813", "0.5975402", "0.59102905", "0.5892608", "0.58867896", "0.588301", "0.5882608", "0.5867343", "0.5847555", "0.58290315", "0.58196867", "0.5813217", "0.57702076", "0.5758948", "0.5755059", "0.57448024", "0.5742187", "0.5717126", "0.57142633", "0.5713492", "0.5713057", "0.56846946", "0.5673005", "0.56698304", "0.5663897", "0.56561667", "0.56472987", "0.5641322", "0.5640887", "0.5638951", "0.56345403", "0.5632983", "0.56318265", "0.5626931", "0.56246245", "0.56242", "0.562304", "0.5614787", "0.56126976", "0.5611064", "0.5607446", "0.56022376", "0.55973077", "0.55973077", "0.5592896", "0.5569364", "0.55683833", "0.5566534", "0.555882", "0.555798", "0.55564463", "0.55485505", "0.5545239", "0.5533724", "0.5532844", "0.5529814", "0.5521442", "0.5520901", "0.5513614", "0.5513411", "0.5509118", "0.5487277", "0.54870546", "0.54811275", "0.54804057", "0.5469992", "0.5459666", "0.5459652", "0.5456837", "0.54522943", "0.5451768", "0.5442719", "0.5442719", "0.5442484", "0.5425631", "0.5412326", "0.54098266", "0.53911525", "0.53886455", "0.5383115", "0.5363063", "0.5353696", "0.5347404", "0.5337229", "0.5335449" ]
0.6475814
2
Default fetcher added to the model on inclusion, if behaves like ActiveRecord::Base.find_all_by_id
def fetch_multi(*ids) options = ids.extract_options! if IdentityCache.should_cache? require_if_necessary do cache_keys = ids.map {|id| rails_cache_key(id) } key_to_id_map = Hash[ cache_keys.zip(ids) ] objects_by_key = IdentityCache.fetch_multi(*key_to_id_map.keys) do |unresolved_keys| ids = unresolved_keys.map {|key| key_to_id_map[key] } records = find_batch(ids, options) records.compact.each(&:populate_association_caches) records end cache_keys.map {|key| objects_by_key[key] }.compact end else find_batch(ids, options) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_locally(id)\n if @all.present?\n @all.find { |model| model.id == id }\n end\n end", "def find(id)\n fetch([name, id]) do\n super\n end\n end", "def fetch_by_id(id)\n ensure_base_model\n raise_if_scoped\n return unless id\n raise NotImplementedError, \"fetching needs the primary index enabled\" unless primary_cache_index_enabled\n if IdentityCache.should_use_cache?\n\n require_if_necessary do\n object = nil\n coder = IdentityCache.fetch(rails_cache_key(id)){ coder_from_record(object = resolve_cache_miss(id)) }\n object ||= record_from_coder(coder)\n IdentityCache.logger.error \"[IDC id mismatch] fetch_by_id_requested=#{id} fetch_by_id_got=#{object.id} for #{object.inspect[(0..100)]} \" if object && object.id != id.to_i\n object\n end\n\n else\n self.reorder(nil).where(primary_key => id).first\n end\n end", "def fetch!(id, options = {}, &block)\n fetch(id, options.merge(save: true), &block)\n end", "def fetch(id = nil, eds_params = nil)\n if id.is_a?(Array)\n fetch_many(id, search_state.to_h, eds_params)\n else\n fetch_one(id, eds_params)\n end\n end", "def id_finder\n @id_finder ||= extract_id ? :all_of : :where\n end", "def fetch(id)\n fetch_by_id(id) or raise(ActiveRecord::RecordNotFound, \"Couldn't find #{self.class.name} with ID=#{id}\")\n end", "def fetch(id)\n fetch_by_id(id) or raise(ActiveRecord::RecordNotFound, \"Couldn't find #{self.name} with ID=#{id}\")\n end", "def find( id )\n model.get( id ).extend( InstanceMethods )\n end", "def find(id)\n raise NotImplementedError\n end", "def find(id); end", "def find(id); end", "def entity load=true\n @entity ||= (klass.where(id: id).first if load)\n end", "def fetch_by_id(id)\n if IdentityCache.should_cache?\n\n require_if_necessary do\n object = IdentityCache.fetch(rails_cache_key(id)){ resolve_cache_miss(id) }\n IdentityCache.logger.error \"[IDC id mismatch] fetch_by_id_requested=#{id} fetch_by_id_got=#{object.id} for #{object.inspect[(0..100)]} \" if object && object.id != id.to_i\n object\n end\n\n else\n self.find_by_id(id)\n end\n end", "def load_by_id(name = nil)\n load_by(:id, name)\n end", "def get!(id)\n klass.find(:all, params: { id: wrap_key(id) })\n end", "def fetch_by_id(model, id, filters = {})\n get_resource(\"/v1/public/#{model}/#{id}\", filters) if model_exists?(model) && validate_filters(filters)\n end", "def fetch(id)\n search(id: id)[:records].first\n end", "def find_each(opts={})\n if @site\n super.collect do |values|\n record = @site.cached_records[values['_id']]\n record ? record : @constructor.load(@site, values)\n end\n else\n super.collect {|values| @constructor.load(values)}\n end\n end", "def fetch_from_cache\n if paginate?\n\n # Return a paginated collection\n if cached.ids.empty?\n\n # No ids, return an empty WillPaginate result\n [].paginate(opts_for_paginate)\n\n elsif combined_options.include?(:order)\n\n # An order has been specified. We have to go to the database\n # and paginate there because the contents of the requested\n # page will be different.\n klass.paginate(cached.ids, { :total_entries => cached.ids.size }.merge(opts_for_find.merge(opts_for_paginate)))\n\n else\n\n # Order is unchanged. We can paginate in memory and only select\n # those ids that we actually need. This is the most efficient.\n paged_ids = cached.ids.paginate(opts_for_paginate)\n paged_ids.replace(klass.find_all_by_id(paged_ids, opts_for_find(paged_ids)))\n\n end\n\n elsif cached.ids.empty?\n\n # We are returning a regular (non-paginated) result.\n # If we don't have any ids, that's an empty result\n # in any language.\n []\n\n elsif combined_options.include?(:order)\n\n # An order has been specified, so use it.\n klass.find_all_by_id(cached.ids, opts_for_find)\n\n else\n\n # No order has been specified, so we have to maintain\n # the current order. We do this by passing some extra\n # SQL which orders by the current array ordering.\n offset, limit = combined_options.delete(:offset) || 0, combined_options.delete(:limit) || cached.count\n ids = cached.ids[offset, limit]\n\n klass.find_all_by_id(ids, opts_for_find(ids))\n end\n end", "def fetch(*)\n raise NotImplementedError, 'This should be defined in a subclass'\n end", "def fetch_one(id, extra_controller_params)\n puts \"fetch one search helper\"\n old_solr_doc_params = Deprecation.silence(Blacklight::SearchHelper) do\n solr_doc_params(id)\n end\n\n if default_solr_doc_params(id) != old_solr_doc_params\n Deprecation.warn Blacklight::SearchHelper, \"The #solr_doc_params method is deprecated. Instead, you should provide a custom SolrRepository implementation for the additional behavior you're offering. The current behavior will be removed in Blacklight 6.0\"\n extra_controller_params = extra_controller_params.merge(old_solr_doc_params)\n end\n \n #Override id\n if params[\"DocId\"]\n id = params[\"DocId\"]\n #Rails.logger.debug(\"Found DocID #{params['DocId'].inspect} and id is #{id.inspect}\")\n else \n id ||= params[:id]\n #Rails.logger.debug(\"Using other id\")\n end\n \n\n solr_response = repository.find id, extra_controller_params\n [solr_response, solr_response.documents.first]\n end", "def load_by_id(_id, _context)\n raise NotImplementedError\n end", "def find(id, options = {})\n if model = find_locally(id)\n model\n else\n adapter(model_class).find(id, options)\n end\n end", "def find_by_id(id)\n raise NotImplementedError.new\n end", "def find(id, options = {})\n decorated = decorated_class.find(id)\n decorated ? resolve_associations([new(decorated)], options).first : nil\n end", "def find(id)\n end", "def fetch_reference_by_id(id)\n Association::LazyEntityReference.new(id, self)\n end", "def find(id)\n find_result\n end", "def load_collection\n model_class.all(find_options)\n end", "def fetch_record_by_param\n model.find(params[:id])\n end", "def find(*ids)\n if Georeferencer.configuration.perform_caching && perform_object_caching != false\n ids.uniq!\n uncached_ids = ids.reject {|i| Georeferencer.configuration.cache.read(\"#{cache_key_base}/#{i}\").present?}\n [super(*uncached_ids)].flatten.reject(&:blank?).collect do |object|\n Georeferencer.configuration.logger.debug(\"Caching #{cache_key_base}/#{object.id}\")\n Georeferencer.configuration.cache.write(object.cache_key, object)\n end\n all_objects = ids.collect do |id|\n Georeferencer.configuration.cache.read(\"#{cache_key_base}/#{id}\")\n end\n\n all_objects.each {|o| o.run_callbacks(:find)}\n all_objects.length == 1 ? all_objects.first : all_objects\n else\n super\n end\n end", "def find_by_id(id, options={})\n name = self.class.name.demodulize.downcase\n route = Automatic::Client.routes.route_for(name)\n url = route.url_for(id: id)\n\n request = api_client.get(url, options)\n\n if request.success?\n self.class::INDIVIDUAL_MODEL.new(request.body)\n else\n nil\n end\n end", "def include_by entity_type, entity_id, user_id\n if entity = entity_type.singularize.camelize.constantize.find(entity_id)\n include entity, user_id\n end\n end", "def fetch_item(id, api_url=ANN_API_URL)\n\t\tbatch_items([id], api_url).first\n\tend", "def find(id)\n klass.find(id)\n end", "def fetch(id)\n # Pass in a proc that will return true if item with id is looked up\n # (pass in invItem as a param to lambda)\n return lookup(id, Proc.new { |invItem| return invItem } )\n end", "def fetch\n raise NotImplementedError\n end", "def by_id(id)\n raise NotImplementedError.new\n end", "def load_commentable_first\n \t# /photos/1, or /articles/2,...\n \tresource, id = request.path.split('/')[1,2]\n\n \t# photos -> photo -> 'Photo' -> Photo -> Photo.find\n \t@commentable = resource.singularize.classify.constantize.find(id)\n end", "def fetch\n @raw_result = opts_for_cache_proxy[:raw] == true\n\n result = if refresh_cache?\n execute_find(@raw_result)\n elsif cached.is_a?(AridCache::CacheProxy::Result)\n if cached.has_ids? && @raw_result\n self.cached # return it unmodified\n elsif cached.has_ids?\n fetch_from_cache # return a list of active records after applying options\n else # true if we have only calculated the count thus far\n execute_find(@raw_result)\n end\n else\n cached # some base type, return it unmodified\n end\n end", "def fetch\n raise NotImplementedError\n end", "def find(id)\n\nend", "def find id\n model.find id\n end", "def find_with_custom_id(*args)\n if block_given?\n return find_without_custom_id(*args) do |*block_args|\n yield(*block_args)\n end\n end\n\n if args.length != 1\n return find_without_custom_id(*args)\n end\n\n arg = args.first\n\n unless arg.is_a?(String)\n return find_without_custom_id(arg)\n end\n\n if arg.match UUIDTools::UUID_REGEXP\n return find_without_custom_id(arg)\n end\n\n joins(:custom_urls).where(custom_urls: { id: arg }).take!\n end", "def fetch(id)\n build_resource(raw.fetch(id))\n end", "def api_include(params)\n # Which columns must we select?\n select = []\n # Which associations must we eager-load?\n eagers = []\n \n model.default_attrs.each do |attr|\n select += model.attr_columns[attr.to_s]\n eagers += model.attr_associations[attr.to_s]\n end\n \n if params['include']\n select += MF::API::IncludeNode.build_select_list(params['include'], model)\n eagers += MF::API::IncludeNode.build_eager_graph(params['include'], model)\n end\n \n # Don't eager load more than once. :)\n eagers.uniq!\n \n # Also select columns which associations may need to operate.\n eagers.each do |eager|\n # Add the primary key on this table needed to access everything.\n if eager.is_a?(Hash)\n ref = model.association_reflection(eager.keys.first.to_sym)\n else\n ref = model.association_reflection(eager)\n end\n \n case ref[:type]\n when :one_to_many\n select << ref[:primary_key] if ref[:primary_key]\n when :many_to_one\n select << ref[:key] if ref[:key]\n when :many_to_many\n select << ref[:left_primary_key] if ref[:left_primary_key]\n when :many_through_many\n select << ref[:left_primary_key] if ref[:left_primary_key]\n end\n end\n\n # Ensure we always select critical columns.\n select += model.key_columns\n \n # Don't select more than once\n select.uniq!\n \n # Modify a copy of this dataset.\n dataset = self.clone\n\n # Select columns\n if dataset.opts[:select] and\n dataset.opts[:select].size == 1 and \n dataset.opts[:select].first.kind_of? Sequel::SQL::ColumnAll\n # This dataset is selecting ALL elements; drop the select and\n # replace it with our explicit selection.\n dataset.opts[:select] = select\n else\n # The dataset may have no select() columns -or- a number of explicit\n # selections; we will merge our own.\n dataset = dataset.select_more *select\n end\n\n # Eager loading\n dataset = dataset.eager(*eagers) unless eagers.empty?\n\n # Ensure we use the first table source as the qualifier for all\n # unqualified identifiers.\n dataset = dataset.qualify_to_first_source\n \n dataset\n end", "def find(entity_set, id)\n query = service[entity_set].query\n url_chunk = query.find(id)\n\n body = api_get(url_chunk).body\n build_entity(entity_set, body)\n end", "def find(id, params = {})\n from_base id, params\n end", "def find_all\n response = fetch()\n new(response)\n end", "def fetch_data\n return @data if @data[\"/type/reflect/any_master\"]\n @data = Ken.session.mqlread(FETCH_DATA_QUERY.merge!(:id => id))\n end", "def find(id, optional = {})\n find_all([id], optional).first\n end", "def find(id)\n finder_or_run(:find, id)\n end", "def find id, params = {}, &block\n rel = relation params, &block\n rel.where!(config.document_unique_id_param => id) \n rel.load\n rel\n end", "def find_by_id(id)\n find(id)\n end", "def fetch_records(ids)\n model.where(id: ids)\n end", "def retrieve\n self.class.get( id )\n end", "def find(id)\n return nil if id.blank?\n path = build_association_path -> { \"#{@parent.request_path(@params)}#{@opts[:path]}/#{id}\" }\n @klass.get_resource(path, @params)\n end", "def find(id)\n return nil if id.blank?\n path = build_association_path lambda { \"#{@owner.request_path(@params)}#{@opts[:path]}/#{id}\" }\n @klass.get(path, @params)\n end", "def find_single(id, *args)\n data = get(id.to_s, *args)\n return nil unless data && !data.empty?\n instantiate(id, data)\n end", "def include_strategy\n :includes\n end", "def fetch\n super\n if [:followers, :followings, :repos].any? {|assoc| self.send(assoc).empty?}\n api_obj.fetch(:followers, :followings, :repos)\n @followers = @followings = @projects = nil\n end\n self\n end", "def find(id)\n parameters[:data_ids] = [id]\n all.first\n end", "def find(*args)\n return super if block_given?\n find_with_ids(*args)\n end", "def load_with_associations\n @response = Response.with_basic_assoc.friendly.find(params[:id])\n end", "def fetch\n @_fetch ||= begin\n path = @parent.build_request_path(@query_attrs)\n @parent.request(@query_attrs.merge(:_method => :get, :_path => path)) do |parsed_data, response|\n @parent.new_collection(parsed_data)\n end\n end\n end", "def fetch(*args)\n raise NotImplementedError, 'Implement a method to fetch the resource.'\n end", "def fetch_resolved(id)\n ttusea = Ttusea.find(id, find_opts)\n\n ttusea\n end", "def find_one(id)\n response = request(:get, \"/#{resource_name}/#{id}\")\n #puts response\n construct_record_from_singular(response)\n end", "def impressionable_find\n exeception_rescuer {\n @entity = impressionable_class.find(self.impressionable_id)\n }\n @entity\n\n end", "def fetch_all\n klass_name = Starwars.const_get(name.split('::').last).const_get('RESOURCE_NAME')\n object = Starwars.const_get(\"#{klass_name.capitalize}\").new(url: \"#{Starwars::Base::BASE_URL}/#{klass_name}/\")\n Starwars::Request.new(resource: object, uri: object.url, params: {}).perform_request\n end", "def find_by_id(client, id, options: {})\n\n self.new(parse(client.get(\"/stories/#{id}\", options: options)).first, client: client)\n end", "def find_all_by_id(id)\n find_all_by(:id, id)\n end", "def load_by_ids ids\n items = @api.fetch_multiple_items ids\n create_by_api_items(items)\n end", "def fetch_all!\n fetch_all(true)\n end", "def find id, preserve_html=false\n check_for_falsy_id id\n Entity.new id, preserve_html\n end", "def find_by_id(id)\n find_by(:id, id)\n end", "def real(options={})\n @real ||= self.type.constantize.find(self.id, options)\n end", "def load_commentable\n return @commentable if @commentable\n param = params.detect { |name, value| name.to_s =~ /(.+)_id$/ }\n if param\n @commentable = param[0].to_s.gsub(/_id$/,'').classify.constantize.find(param[1])\n else\n nil\n end\n end", "def find_by_ncbi_id_or_fetch!(ncbi_id)\n find_by_ncbi_id(ncbi_id) || fetch!(ncbi_id)\n end", "def find_by_param(value,args={})\n if permalink_options[:prepend_id]\n param = \"id\"\n value = value.to_i\n else\n param = permalink_options[:param]\n end\n self.send(\"find_by_#{param}\".to_sym, value, args)\n end", "def find(id)\n all.find { |obj| obj.id == id }\n end", "def get_by_id(listing_id)\n find(listing_id)\n end", "def find_by_id(id)\n filtered_set(entities, key: 'id', value: id)\n end", "def fetch_data(listing_id)\n Result.all(\n ->() {\n if listing_id.nil?\n Result::Error.new(\"No listing ID provided\")\n else\n Result::Success.new(listing_id)\n end\n },\n ->(l_id) {\n # TODO Do not use Models directly. The data should come from the APIs\n Maybe(@current_community.listings.where(id: l_id).first)\n .map { |listing_model| Result::Success.new(listing_model) }\n .or_else { Result::Error.new(\"Cannot find listing with id #{l_id}\") }\n },\n ->(_, listing_model) {\n # TODO Do not use Models directly. The data should come from the APIs\n Result::Success.new(listing_model.author)\n },\n ->(_, listing_model, *rest) {\n TransactionService::API::Api.processes.get(community_id: @current_community.id, process_id: listing_model.transaction_process_id)\n },\n ->(*) {\n Result::Success.new(MarketplaceService::Community::Query.payment_type(@current_community.id))\n }\n )\n end", "def fetch\n end", "def fetch_multi(*ids)\n ensure_base_model\n raise_if_scoped\n raise NotImplementedError, \"fetching needs the primary index enabled\" unless primary_cache_index_enabled\n options = ids.extract_options!\n ids.flatten!(1)\n records = if IdentityCache.should_use_cache?\n require_if_necessary do\n cache_keys = ids.map {|id| rails_cache_key(id) }\n key_to_id_map = Hash[ cache_keys.zip(ids) ]\n key_to_record_map = {}\n\n coders_by_key = IdentityCache.fetch_multi(cache_keys) do |unresolved_keys|\n ids = unresolved_keys.map {|key| key_to_id_map[key] }\n records = find_batch(ids)\n key_to_record_map = records.compact.index_by{ |record| rails_cache_key(record.id) }\n records.map {|record| coder_from_record(record) }\n end\n\n cache_keys.map{ |key| key_to_record_map[key] || record_from_coder(coders_by_key[key]) }\n end\n else\n find_batch(ids)\n end\n records.compact!\n prefetch_associations(options[:includes], records) if options[:includes]\n records\n end", "def get_ids(params)\n if params[:ids]\n type = [\"doi\", \"pmid\", \"pmcid\", \"arxiv\", \"wos\", \"scp\", \"ark\", \"url\"].find { |t| t == params[:type] } || \"pid\"\n type = \"canonical_url\" if type == \"url\"\n ids = params[:ids].nil? ? nil : params[:ids].split(\",\").map { |id| get_clean_id(id) }\n collection = Work.where(works: { type => ids })\n elsif params[:q]\n collection = Work.query(params[:q])\n elsif params[:publisher_id] && publisher = cached_publisher(params[:publisher_id])\n collection = Work.where(publisher_id: publisher.id)\n elsif params[:contributor_id] && contributor = Contributor.where(pid: params[:contributor_id]).first\n collection = Work.joins(:contributions).where(\"contributions.contributor_id = ?\", contributor.id)\n elsif params[:id]\n id_hash = get_id_hash(params[:id])\n if id_hash.present?\n key, value = id_hash.first\n collection = Work.where(key => value)\n else\n collection = Work.none\n end\n else\n collection = Work.tracked\n end\n\n if params[:source_id] && source = cached_source(params[:source_id])\n collection = collection.joins(:results)\n .where(\"results.source_id = ?\", source.id)\n .where(\"results.total > 0\")\n end\n\n if params[:relation_type_id] && relation_type = cached_relation_type(params[:relation_type_id])\n collection = collection.joins(:relations)\n .where(\"relations.relation_type_id = ?\", relation_type.id)\n end\n\n if params[:registration_agency_id] && registration_agency = cached_registration_agency(params[:registration_agency_id])\n collection = collection.where(registration_agency_id: registration_agency.id)\n end\n\n collection\n end", "def fetch(resource_type,identifier,params={})\n path = '/api/' + resource_type.to_s + '/' + slugify(identifier)\n hydrate(resource_type, http_get(path,params))\n end", "def fetch_data(listing_id)\n Result.all(\n ->() {\n if listing_id.nil?\n Result::Error.new(\"No listing ID provided\")\n else\n Result::Success.new(listing_id)\n end\n },\n ->(listing_id) {\n # TODO Do not use Models directly. The data should come from the APIs\n Maybe(@current_community.listings.where(id: listing_id).first)\n .map { |listing_model| Result::Success.new(listing_model) }\n .or_else { Result::Error.new(\"Cannot find listing with id #{listing_id}\") }\n },\n ->(_, listing_model) {\n # TODO Do not use Models directly. The data should come from the APIs\n Result::Success.new(listing_model.author)\n },\n ->(_, listing_model, *rest) {\n TransactionService::API::Api.processes.get(community_id: @current_community.id, process_id: listing_model.transaction_process_id)\n },\n ->(*) {\n Result::Success.new(MarketplaceService::Community::Query.payment_type(@current_community.id))\n },\n )\n end", "def find_by_id(id)\n resp = get(\"/#{exposed_as}/#{id}\")\n case resp.response.code.to_i\n when 200\n result = MultiJson.load resp.parsed_response\n new(result)\n when 404\n nil\n else\n raise \"#{self.class.name}#try_find with ID #{id.inspect} returned unexpected response: #{resp.inspect}\"\n end\n end", "def single_record!\n if use_eager_all?\n obj = clone(:all_called=>true).all.first\n\n if opts[:eager_graph]\n obj = clone(:all_called=>true).where(obj.qualified_pk_hash).unlimited.all.first\n end\n\n obj\n else\n super\n end\n end", "def retrieve(id)\n instance = self.new(id)\n url = instance.url\n requestor = Requestor.new\n response = requestor.request(:get, url)\n instance.load_from(response)\n instance\n end", "def find id\n @objs_list[id] if @objs_list\n end", "def find_every_with_default_includes(options)\r\n add_default_includes!(options)\r\n find_every_without_default_includes(options)\r\n end", "def load_with_associations\n @response = Response.with_associations.find(params[:id])\n end", "def find(*args, &block)\n if args.first.is_a?(Hash)\n super(*args, &block)\n else\n super(id: args)\n end\n end", "def find(id)\n @adapter.find(collection, id).tap do |record|\n raise Lotus::Model::EntityNotFound.new unless record\n end\n end", "def find_by_id!(id)\n found = entities.detect { |elm| elm.id == id }\n raise Occi::Core::Errors::CollectionLookupError, \"Entity #{id.inspect} not found in the collection\" unless found\n found\n end", "def find_by_id(id)\n models.each do |model|\n el = model.find_by_id(id)\n return el if el\n end\n nil\n end" ]
[ "0.6636847", "0.63990146", "0.61538947", "0.6139675", "0.6130623", "0.61074823", "0.60606587", "0.6046114", "0.603612", "0.60270226", "0.6024857", "0.6024857", "0.6008796", "0.5943897", "0.5918234", "0.58997136", "0.58935404", "0.5869013", "0.584913", "0.58231664", "0.58070713", "0.5806566", "0.58009577", "0.5789602", "0.5778406", "0.57585925", "0.57555515", "0.5727349", "0.5724548", "0.5704811", "0.57016593", "0.5676681", "0.56726503", "0.567251", "0.5660718", "0.5652889", "0.56460834", "0.5641157", "0.5639011", "0.5637618", "0.5628468", "0.56234276", "0.56194854", "0.56150275", "0.560093", "0.55765426", "0.55669576", "0.55418503", "0.5524573", "0.55038416", "0.54907405", "0.54777694", "0.5476572", "0.54716235", "0.54631853", "0.5459044", "0.5458883", "0.5413256", "0.54080796", "0.5399098", "0.5395983", "0.53709173", "0.5359621", "0.53570783", "0.5349988", "0.5347725", "0.53436166", "0.53431165", "0.5333231", "0.5328459", "0.5314765", "0.53116703", "0.53114414", "0.53086126", "0.5307889", "0.5307107", "0.52869964", "0.5285768", "0.52778625", "0.5269489", "0.5268111", "0.5266763", "0.5258669", "0.5248047", "0.5243774", "0.5233235", "0.52325714", "0.52298516", "0.52292025", "0.52290374", "0.5228761", "0.5228071", "0.52280647", "0.52269113", "0.5217785", "0.5204027", "0.5200453", "0.51896816", "0.5186338", "0.518197" ]
0.53172016
70
Returns the original header
def original @original_header end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def header\n return @header\n end", "def header\n @raw.split(\"--\" + boundary)[0]\n end", "def actual_header\n data.lines.first.chomp\n end", "def header\n return @message.header\n end", "def raw_headers; end", "def header; message[:header]; end", "def header\n @result['_header']\n end", "def header\n @message.header\n end", "def getHeader() @header1 end", "def header_data\n\t\treturn self.normalized_headers.to_s\n\tend", "def grab_header\n return @header if (@header and [email protected]?)\n @file.rewind\n fields.each_with_index do |field_name, i|\n @header[i]= field_name.strip\n end\n @header\n end", "def header\n @header ||= create_header\n end", "def getHdr()\n\t\treturn @hdr\n\tend", "def parse_header_contents; end", "def header_str\n \"\"\n end", "def getSecondHeader() @header2 end", "def header_signature; end", "def header(prev_header)\n Bitcoin.double_sha256(filter_hash.htb + prev_header.htb).bth\n end", "def headers\n @attachment_as_ruby.first\n end", "def headers; end", "def headers; end", "def headers; end", "def headers; end", "def headers; end", "def headers; end", "def headers; end", "def headers; end", "def headers; end", "def headers; end", "def headers\n end", "def header=(_arg0); end", "def headers; return {}; end", "def headers; return {}; end", "def extract_header(content)\n return \"\" if content.blank?\n content.split(/\\r\\n\\r\\n|\\n\\n/).first\n end", "def read_headers!; end", "def get_header\n file_in_handle = open_in_file @file_in_path\n file_in_handle.seek FILE_HEADER_MAGIC_KEY_BYTES\n header_data = file_in_handle.read FILE_HEADER_DATA_BYTES\n file_in_handle.close\n\n crypto = Mcrypt.new(:'blowfish-compat', :ecb, HEADER_DECRYPTION_KEY)\n plaintext = crypto.decrypt(header_data)\n\n header_hash = {}\n URI.decode_www_form(plaintext).each { |key_value_array| header_hash[key_value_array[0]] = key_value_array[1] unless key_value_array[0].empty? }\n header_hash\n end", "def header_value\n return @header_value\n end", "def headers\n # units and source have to go last, so if we push in a new header, these go\n # at end\n @headers+['units','source']\n end", "def normalized_headers\n\t\theaders = self.headers.dup\n\n\t\theaders[:date] ||= Time.now.httpdate\n\n\t\tif self.bodiless? && !self.extended_reply?\n\t\t\theaders.delete( :content_length )\n\t\t\theaders.delete( :content_type )\n\t\telse\n\t\t\theaders[:content_length] ||= self.get_content_length\n\t\t\theaders[:content_type] ||= DEFAULT_CONTENT_TYPE.dup\n\t\tend\n\n\t\treturn headers\n\tend", "def headers=(_arg0); end", "def headers=(_arg0); end", "def headers=(_arg0); end", "def headers=(_arg0); end", "def headerName(header)\n begin\n header.split(\" \")[0]\n rescue\n \"\"\n end\nend", "def local_header_offset; end", "def response_header\n nil\n end", "def headers\n res = parsed_headers\n if has_delta?\n res.concat(delta_headers)\n end\n res\n end", "def first\n header_data\n end", "def headers\n @attributes[:headers]\n end", "def headers\n @headers ||= self.class.beautify_headers(@net_http_res.to_hash)\n end", "def header_signature=(_arg0); end", "def get_headers\n @headers = headers\n @headers\n end", "def get_header name\n request_object.headers[name]\n end", "def header(name)\n @response[name]\n end", "def get_response_header(response)\n raise \"REST response was nil\" if response == nil\n raise \"REST response had no attached header\" if response.headers == nil\n begin\n header = response.headers # already in Ruby Hash format\n set_all_defaults(body)\n rescue JSON::ParserError => e\n puts \"rescued : ParserError\"\n puts e\n header = response.headers\n end\n header\n end", "def header; end", "def header; end", "def header; end", "def header_text\n @attributes[:header_text]\n end", "def getHeader()\n header = \"\"\n\n appendStr(header, \"time\")\n appendStr(header, \"seqno\")\n $cmd_list.each do | name, cmd, type |\n appendStr(header, name)\n end\n return header\nend", "def get_headers\n request_object.headers\n end", "def headers\n @headers\n end", "def headers\n\t\t\thdr = @curb.header_str\n\t\t\tself.class.recode(log?, @curb.content_type, hdr) ?\n\t\t\t\tself.class.parse_headers(hdr) :\n\t\t\t\tself.class.parse_headers(@curb.header_str) # recode failed\n\t\tend", "def header(name)\n rack_header = \"http-#{name}\".upcase!.tr('-', '_')\n\n hdr = @env[rack_header]\n\n # Only return the value if it is not an empty string\n hdr if hdr != ''\n end", "def headers\n {}\n end", "def headers\n {}\n end", "def headers\n {}\n end", "def header\n new_header = GElf::SectionHeader.new\n\n GElf.gelf_getshdr(self,new_header)\n return new_header\n end", "def decode_raw_header\n decoded_header = Ether.new\n decoded_header.read(payload)\n end", "def request_headers; end", "def request_headers; end", "def header(name)\n @responseheaders[name.downcase]\n end", "def normalise_source_header(header_name)\n # Run regex to see if it matches expected format\n source_match = self.class.source_header_regex.match header_name\n\n if source_match\n # Set header name as source#part where:\n # # is num\n # part is ref, date, place or orig_reference\n norm_header_name = 'source' + source_match[1]\n\n # Add last part of source string (date, place, ref) to header if available\n # Default is orig_reference\n suffix = source_match[2] || 'orig_reference'\n norm_header_name += suffix\n\n return norm_header_name\n end\n nil\n end", "def processed_headers; end", "def header\n end", "def site_header\n @attributes[:site_header]\n end", "def seperate_headers()\n\t\[email protected](\"\\n\\n\")[0].split(\"\\n\", 2)[1]\n\tend", "def header_raw(str)\n raise \"No HTTP-session attached to this thread.\" if !_httpsession\n raise \"HTTP-session not active.\" if !_httpsession.resp\n Php4r.header(str)\n return nil\n end", "def headers\n @headers ||= begin\n @mail.header.fields.inject({}) do |memo, field|\n name = field.name.downcase.to_s\n next memo if self.class.skipped_headers.include?(name)\n\n header = unquoted_header(name)\n memo.update(name => self.class.unescape(header))\n end\n end\n end", "def headers\n msg['headers']||{}\n end", "def header\n @header ||= csv_rows.first\n end", "def header\n @header ||= csv_rows.first\n end", "def headers\n @headers.reject {|k, v| k == :body }.map do |k, v|\n translate_header_name(k) + ': ' + v + \"\\n\"\n end.join\n end", "def generate_request_header()\n request_header = super()\n #puts \"--------------- generate_request_header >> request_header >>\\n#{request_header}\"\n credentials = @credential_handler.credentials\n #puts \"--------------- generate_request_header >> credentials >>\\n#{credentials}\"\n #request_header['authToken'] = @auth_handler.get_token(credentials)\n credentials.each {|k,v| request_header[prepend_namespace(k.to_s.camelize)] = v}\n request_header.select!{|k,_| ['ApplicationToken', 'CustomerAccountId', 'CustomerId', 'DeveloperToken', 'UserName', 'Password'].map{|h| prepend_namespace(h)}.include?(k.to_s)}\n #puts \"--------------- generate_request_header >> request_header final >>\\n#{request_header}\"\n return request_header\n end", "def header(key)\n return false unless headers.key?(key)\n\n headers.fetch(key).first.to_s\n end", "def header\n chunk_header = nil\n File.open(@file_name) do |file|\n file.seek(@offset + 4 + @size_length, IO::SEEK_CUR)\n chunk_header = file.read(@header_size)\n end\n chunk_header\n end", "def header(name)\n @env.response_headers[name]\n end", "def header_length() 3 end", "def headers\n @headers ||= {}\n end", "def prepare_custom_headers(header)\n header.end_with?(\"__c\") ? header.slice(0..-4).downcase : header.downcase\n end", "def headers(header = nil)\n if header.is_a?(Hash)\n @headers ||= {}\n @headers.merge!(header)\n end\n\n return @headers if @headers\n\n superclass.respond_to?(:headers) ? superclass.headers : nil\n end", "def header\n\t\t@json_file\n\tend", "def header\n \"*#{super}*\"\n end", "def parsed_content_type_header; end", "def headers\n @headers ||= {}\n end", "def headers\n @headers ||={}\n end", "def headers\n h = {}\n raw.headers_hash.each {|k,v| h[k] = v }\n h\n end", "def get_header(*params); raise('Stub or mock required.') end", "def getHeaders\n @headers\n end", "def encode_header(s); s; end" ]
[ "0.7968712", "0.7809133", "0.77062523", "0.75467306", "0.7543736", "0.7467537", "0.7466377", "0.742175", "0.74104226", "0.7323021", "0.7302127", "0.7189831", "0.7051793", "0.70136285", "0.6953195", "0.69416666", "0.69414836", "0.69236505", "0.68124217", "0.67947036", "0.67947036", "0.67947036", "0.67947036", "0.67947036", "0.67947036", "0.67947036", "0.67947036", "0.67947036", "0.67947036", "0.678697", "0.6781979", "0.6773249", "0.6773249", "0.67679846", "0.6745151", "0.67388207", "0.67241055", "0.67068297", "0.66951346", "0.6695038", "0.6695038", "0.6695038", "0.6695038", "0.665883", "0.6656795", "0.66421354", "0.6628792", "0.6621486", "0.6612683", "0.6604572", "0.6601041", "0.6586357", "0.6585395", "0.656892", "0.65536886", "0.6548181", "0.6548181", "0.6548181", "0.65476596", "0.65321356", "0.65312237", "0.65270686", "0.6526005", "0.6525303", "0.6514892", "0.6514892", "0.6514892", "0.65057015", "0.6495131", "0.64689183", "0.64689183", "0.6468125", "0.6463189", "0.64618266", "0.6457432", "0.645381", "0.64528567", "0.6448728", "0.6447467", "0.6434893", "0.6427468", "0.6427468", "0.6422916", "0.64130867", "0.64050716", "0.6402144", "0.63954115", "0.63688415", "0.636329", "0.635417", "0.6353001", "0.6349948", "0.6348314", "0.6347297", "0.6339651", "0.6332871", "0.6322167", "0.63214785", "0.63189775", "0.63175553" ]
0.9001829
0
Returns true if columns contains no elements.
def empty? @columns.empty? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def empty?\n @data.columns_count <= 0\n end", "def empty?\n @column >= @data.columns_count\n end", "def is_empty?\n\t @grid.all? { |col| col.empty? }\n\tend", "def empty?\n @row >= @data.columns_count || @column >= @data.columns_count\n end", "def empty?\n each_cell do |cell|\n return false if cell\n end\n true\n end", "def empty?\n @data.cells_count <= 0\n end", "def empty?\n each do |cell|\n return false if cell.value.to_i != 0\n end\n true\n end", "def empty?(row)\n row.fields.reject(&:nil?).empty?\n end", "def empty?\n @table.empty? ||\n @row == 0 || @col == 0 ||\n @row != @table.size ||\n @col != @table.first.size # assumes first element is also an Array\n end", "def empty?\n rows.empty?\n end", "def empty?\n @rows.empty?\n end", "def empty?\n @rows.empty? if @rows\n end", "def empty_row?\n @row.fields.compact.empty?\n end", "def is_empty?\n\t @grid.flatten.all? { |elem| elem.empty? }\n\tend", "def empty?\n @row.empty?\n end", "def empty?\n @rows.empty?\n end", "def empty?\n @rows.empty?\n end", "def empty?\n @rows.empty?\n end", "def empty?(row, col, sheet = default_sheet)\n value = cell(row, col, sheet)\n return true unless value\n return false if value.class == Date # a date is never empty\n return false if value.class == Float\n return false if celltype(row, col, sheet) == :time\n value.empty?\n end", "def has_datacolumns? (record)\n record.datacolumns.size > 0 ? true : false\n end", "def empty?\n @data.rows_count <= 0\n end", "def empty?\n cardinality == 0\n end", "def empty?(row, col, sheet=nil)\n value = cell(row, col, sheet)\n return true unless value\n return false if value.class == Date # a date is never empty\n return false if value.class == Float\n return false if celltype(row,col,sheet) == :time\n value.empty?\n end", "def all_cells_cleared?\n @field.map do |row|\n row.map do |column|\n return false if column.covered\n end\n end\n true\n end", "def is_row_empty(row)\n return row.all? { |item| item == nil }\nend", "def empty_row?(row)\n if row.blank?\n true\n else\n empty = true\n row.each do |col|\n (empty = false) unless col.blank?\n end\n empty\n end\n end", "def full?\n @cells.all?{|element| element != \" \"}\n end", "def empty_row?(data)\n data.compact.empty?\n end", "def empty?\n _values.all?(&:empty?)\n end", "def empty?\n attributes.size == 0\n end", "def multi_column?\n @columns.size > 1\n end", "def __empty?\n all?(&:__empty?)\n end", "def empty?(cell)\n\t\tcell == 0 || cell == @@FRONTIER\n\tend", "def empty?\n underlying_table.empty?\n end", "def cols_enum_empty?\n cols_enum_ready? && (cols_dest_enum.empty? || cols_src_enum.empty?)\n end", "def empty_board?\n cell_rows.flatten.uniq.size == 1 && cell_rows.flatten.uniq.first == nil\n end", "def empty?\n @table.size == 0\n end", "def empty?\n data.nil? ? true : data.rows.empty?\n end", "def empty_positions?\n @grid.flatten.any? {|pos| pos == \"_\"}\n end", "def empty?\n @table.empty?\n end", "def full_column(col)\n column = get_column(col)\n return !column.any? { |k,v| v == @empty_sign }\n end", "def nonzero_column?(column)\n column.to_i > 0\n end", "def empty?\n @table.empty?\n end", "def has_elements?\n return !( self.factures.size.eql?(0) && \n self.ventes.size.eql?(0) && \n self.produits.size.eql?(0) &&\n self.labours.size.eql?(0) &&\n self.pulves.size.eql?(0))\n end", "def empty?\n @row >= @data.rows_count\n end", "def empty_block? cells, start_range, stop_range\n (start_range..stop_range).each do |col|\n if cells[col].present?\n return false\n end\n end\n true\n end", "def empty?\n @values.values.all?(&:nil?)\n end", "def all_cells_cleared?\n row_count.times do |row|\n column_count.times do |col|\n if !contains_mine?(row, col)\n return false unless cell_cleared?(row, col)\n end\n end\n end\n true\n end", "def is_full?\n\t @grid.all? { |col| col.length == @rows }\n\tend", "def empty?()\n return @length == 0\n end", "def empty?\n @table.empty?\n end", "def is_empty()\n if @length == 0\n true\n else\n false\n end\n end", "def empty?\n (points.nil? or points.size.zero?)\n end", "def column?(col)\n !column(col).nil?\n end", "def empty?\n @elements.empty?\n end", "def full?\n each_cell do |cell|\n return false unless cell\n end\n true\n end", "def full?\n @cells.map { |row| row.all? {|cell| !cell.eql?(' ') } }.all?(true)\n end", "def has_cells?\n cells.any?\n end", "def empty?\n length.zero?\n end", "def __empty?\n return false unless super\n __elements.values.all?(&:__empty?)\n end", "def none_empty?\n !any_empty?\n end", "def none_empty?\n !any_empty?\n end", "def empty?()\n fields.empty?\n end", "def empty?\n none? { true }\n end", "def empty?() \n\t\t\ta = to_ary\n\t\t\ta[0] == 0 && a[1] == 0 \n\t\tend", "def empty_cells\n cells.values.select {|cell| cell.empty? }\n end", "def empty?\n length == 0\n end", "def empty?\n length == 0\n end", "def empty?\n length == 0\n end", "def blank_cell?\n # A nil assignment creates a blank cell\n return true if @assignment.nil?\n\n # A form previously in this member's column implies that all cells\n # below are empty\n return true if @members[@col_index].nil?\n\n # Otherwise, the cell is not blank\n return false\n end", "def empty?\n _values.empty?\n end", "def all_cells_cleared?\n count = 0\n (0..row_count).each do |row|\n (0..column_count).each do |column|\n if cell_cleared?(row, column) || contains_mine?(row, column)\n count += 1\n end\n end\n end\n if count == row_count*column_count\n true\n else\n false\n end\n end", "def empty?\n @fields.empty?\n end", "def blank?\n length == 0\n end", "def empty?\n return self.length == 0\n end", "def empty?\n @fields.values.empty?\n end", "def is_empty(row,column)\n @coords[row][column].is_water\n end", "def all_cells_cleared?\n grid.each do |row|\n row.each do |cell|\n if cell.uncovered == false && cell.fill == 0\n return false\n end\n end\n end\n\n true\n end", "def empty?\n false\n end", "def empty?\n return false\n end", "def empty?\n true\n end", "def empty?\n true\n end", "def is_empty?\n size == 0\n end", "def empty?\n coordinates.empty?\n end", "def full?\n cells.none? do |token|\n token == \" \"\n end\n end", "def all_cells_cleared?\n x = 0\n @field.each do |row|\n y = 0\n row.each do |col|\n if !contains_mine?(x, y)\n if @field[x][y].cleared == false\n return false\n end\n end\n y += 1\n end\n x += 1\n end\n true\n end", "def empty?\n @length == 0\n end", "def all_cells_cleared?\n @field.flatten.each do |cell|\n if cell.mine == false && !cell.revealed?\n return false\n end\n end\n return true\n end", "def all_cells_cleared?\n count_num_of_cells_cleared = @cleared_field.select{|key, value| value == true}.size\n total_cell_count = @column_count * @row_count\n cell_clear_check = total_cell_count - @mine_count == count_num_of_cells_cleared\n return true if !any_mines_detonated? && cell_clear_check\n false\n\n end", "def empty?() end", "def empty?() end", "def empty?() end", "def full?\r\n cells.none? {|cell| cell == \" \"}\r\n end", "def all_cells_cleared?\n flag = true\n @grid.each do |row|\n flag = false if row.any? { |cell| cell.uncovered == false && cell.fill.nil? }\n end\n flag\n end", "def all_cells_cleared?\n (0...row_count).to_a.each do |row|\n (0...column_count).to_a.each do |col|\n if @cleared[row][col] == false && @mines[row][col] == false\n return false\n end\n end\n end\n return true\n end", "def empty?\n all.empty?\n end", "def columns?\n @columns_on\n end", "def empty?\n @_values.empty?\n end", "def empty?\n\t\t@length == 0\n\tend", "def all_cells_cleared?\n !@value_grid.any?{ |space, properties| properties == { cleared: false, mine: false } }\n end" ]
[ "0.8369676", "0.8223765", "0.80698156", "0.78767043", "0.7800265", "0.7784934", "0.7779861", "0.76950145", "0.76034254", "0.7598829", "0.74384385", "0.7436462", "0.74208856", "0.7376327", "0.7374503", "0.73593754", "0.73593754", "0.73593754", "0.7280911", "0.726635", "0.72210985", "0.7197729", "0.71800154", "0.7162803", "0.7160779", "0.7152825", "0.71517813", "0.71344477", "0.7105416", "0.71037686", "0.71017194", "0.7091285", "0.70860803", "0.7077173", "0.7073797", "0.7071595", "0.7054444", "0.7015389", "0.7003805", "0.70011693", "0.69875723", "0.6975729", "0.69728166", "0.6947262", "0.69450754", "0.69255304", "0.69140214", "0.6901495", "0.690039", "0.6872944", "0.6866199", "0.6854299", "0.684936", "0.6848336", "0.68470365", "0.6846084", "0.68319196", "0.6824144", "0.68149126", "0.6813833", "0.6788854", "0.6788854", "0.6781646", "0.6778174", "0.6765672", "0.67585206", "0.6755546", "0.6755546", "0.6755546", "0.67515016", "0.67459685", "0.6744955", "0.67388093", "0.67385846", "0.67326385", "0.67298883", "0.672819", "0.67243487", "0.6722736", "0.6722225", "0.6717558", "0.6717558", "0.67157865", "0.6713697", "0.67114455", "0.6704708", "0.67011344", "0.67006016", "0.6695299", "0.6686617", "0.6686617", "0.6686617", "0.66809845", "0.6674316", "0.6667819", "0.6664752", "0.66604733", "0.66591907", "0.6657201", "0.6653845" ]
0.8625055
0
Returns columns as array.
def columns @columns end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cols_array\n arr = Array.new\n @columns_hash.each{|k,v| arr << k}\n return arr\n end", "def to_a\n columns\n end", "def to_a\n @columns.values.flatten.compact\n end", "def to_ary_cols\n ary = Array.new\n cola = Array.new\n coli = 0\n each_index_by_cols do |row, col|\n if coli != col\n coli = col\n ary << cola\n cola = Array.new\n end\n\n cola << self[row, col]\n end\n\n ary << cola\n ary\n end", "def to_a\n columns.map { |column| @attributes[column.name.underscore] }\n end", "def columns\n @columns ||= [];\n end", "def columns \n []\n end", "def get_array_by_col()\n\t\tprepare(@dim_i,@dim_j)\n\t\ttmpTab = Array.new\n\t\tfor j in 0..@dim_j-1\n\t\t\ttmpTab.push get_col(j)\n\t\tend\n\t\treturn tmpTab\n\tend", "def columns\n @columns ||= []\n end", "def columns\n @header.to_a\n end", "def columns; @columns_hash.values; end", "def cols\n # remove the nils\n cols = (Array.new(@size) { Array.new(@size) }).map { |col| col.select { |el| el != nil} }\n \n @rows.each do |row|\n row.each_with_index do |mark, col_idx|\n cols[col_idx] << mark\n end\n end\n \n cols\n end", "def get_columns\n return @columns\n end", "def columns\n @columns_hash.values\n end", "def to_a\n array = []\n rows.times do |row|\n col_array = []\n cols.times do |col|\n col_array << self.value_at(row,col)\n end\n array << col_array\n end\n\n return array\n end", "def columns; @columns; end", "def columns\n ColumnCollection.new(@data)\n end", "def to_a\n @table.columns.map { |col| @attributes[col] }\n end", "def columns \n @c\n end", "def columns\n return @columns\n end", "def columns\r\n # TODO: transpose possibly doesn't work for rectangular (non-square) maps\r\n @all_columns ||= rows.transpose\r\n end", "def cols\n count == 0 ? Array.new(@order) :\n first.inject([]) { |arr, item| \n arr << map { |row| row[arr.count] }; arr }\n end", "def columns\n collect = []\n recursive_columns(@base, collect)\n end", "def cols\n @cols\n end", "def columns\n @board.transpose\n end", "def to_ary\n ary = Array.new\n each_index do |row, col|\n ary << self[row,col]\n end\n ary\n end", "def columns()\n return @columns.keys\n end", "def columns\n @columns\n end", "def columns\n @columns\n end", "def columns\n @columns ||= @csv_data[0].zip(*@csv_data[1..])\n end", "def columns\n @columns ||= begin\n column_indexes.map do |e|\n e.map do |e|\n @input[e]\n end\n end\n end\n end", "def columns\n c = []\n cells.group_by {|cell| cell.coordinate.y}.each_pair do |key,value|\n c << Column.new(position: key, cells: value)\n end\n c\n end", "def column_vectors\n # (0 .. column_size - 1).collect { |i| column(i) }\n my_rows = @rows\n r_size = my_rows.size\n col_size = my_rows[0].size\n vector_cls = Vector\n array_cls = Array\n res = array_cls.new(col_size)\n for j in 0..col_size-1 do\n a_col = array_cls.new(r_size)\n for i in 0..r_size-1 do\n a_col[i] = my_rows[i][j]\n end\n res[j] = Vector.elements(a_col, false)\n end\n res\n end", "def columns\n single_record unless @columns\n @columns || []\n end", "def header_array\n @columns.collect {|c|\n if @table[c]\n @table[c][:name].to_s\n else\n \"\"\n end\n }.compact\n end", "def raw cols\n ret = get_values [*cols]\n\n case cols\n when Array\n ret\n else\n ret.first\n end\n end", "def to_a(column_major=true)\n a = []\n if column_major\n for j in 0..3\n for i in 0..3\n a << self[i,j]\n end\n end\n else\n for i in 0..3\n for j in 0..3\n a << self[i,j]\n end\n end\n end\n a\n end", "def columns\n must_be_open!\n return @columns.map(&:first)\n end", "def to_a\n @to_a ||= @columns.map { |column| init_attribute(column) }\n end", "def columns\n @columns\n end", "def columns\n @columns ||= @stats.values.flatten.map { |a| a.column_name }\n end", "def columns\n @columns.to_enum\n end", "def to_a(column_major=true)\n a = []\n if column_major\n for j in 0..cols()-1\n for i in 0..rows()-1\n a << self[i,j]\n end\n end\n else\n for i in 0..rows()-1\n for j in 0..cols()-1\n a << self[i,j]\n end\n end\n end\n a\n end", "def to_a(column_major=true)\n a = []\n if column_major\n for j in 0..cols()-1\n for i in 0..rows()-1\n a << self[i,j]\n end\n end\n else\n for i in 0..rows()-1\n for j in 0..cols()-1\n a << self[i,j]\n end\n end\n end\n a\n end", "def create_column_data_array\n\ttable_id = create_table_id('../data/census_column_metadata.csv')\n\tcolumn_id = create_column_id('../data/census_column_metadata.csv')\n\t\n\t[title_processor,table_id,column_id].transpose\n\nend", "def columns\n @columns\n end", "def getColumn arr, col\n arr2 = [] \n for row in arr do\n arr2.push row[col]\n end \n return arr2\nend", "def column_values(column)\r\n assert_exists\r\n arr_rows = rows\r\n values = Array.new(arr_rows.length)\r\n for i in 0..arr_rows.length - 1 do\r\n values[i] = arr_rows[i][column].to_s \r\n end\r\n return values\r\n end", "def columns\n self.class.const_get(:COLUMNS) rescue []\n end", "def columns\n _columns || columns!\n end", "def columns\n @columns ||= dataset.columns\n end", "def columns\n @columns ||= dataset.columns\n end", "def col_arrays\n #puts self.inspect\n cols = []\n (MIN_ROW_POSITION..MAX_ROW_POSITION).each do |i|\n cols[i] = []\n (MIN_COL_POSITION..MAX_COL_POSITION).each do |j|\n cols[i].push(@board[j][i])\n end\n end \n cols\n end", "def raws cols\n ret = get_values [*cols], true\n\n case cols\n when Array\n ret\n else\n ret.first\n end\n end", "def to_columns\n @columns = transpose_to_columns\n end", "def columns; end", "def columns\n @columns = columns_hash.values\n end", "def columns\n CellCollection.new(@data, @row)\n end", "def columns!\n ds = clone(opts.merge(:sql => \"SELECT TOP 1 [T1].* FROM (#{opts[:sql]}) \\\"T1\\\"\"))\n ds.each{break}\n\n if cols = ds.cache[:_columns]\n self.columns = cols\n else\n []\n end\n end", "def columns\n get_metadata unless @columns\n return @columns\n end", "def columns\n @pz.group_by.each_with_index { |val, n| column_id(n) }\n end", "def columns\n return @columns if @columns\n return nil if frozen?\n set_columns(dataset.naked.columns)\n end", "def columns\n return @columns if @columns\n return nil if frozen?\n set_columns(dataset.naked.columns)\n end", "def to_a\n column_names = [@query.klass.primary_key] | connect_by_columns\n column_names.map { |name| @query.table[name] }\n end", "def getCols\n return @grid.getCols\n end", "def get_columns_name\r\n columns = []\r\n if @columns != nil\r\n @columns.each do |column|\r\n columns.push column\r\n end\r\n end\r\n \r\n if @stats != nil and @stats.length > 0\r\n @stats.each do |stat|\r\n columns.push stat.to_column_name\r\n end\r\n end\r\n \r\n return columns\r\n end", "def list_columns\n columns\n end", "def columns\n self.class.instance_variable_get(:@columns)\n end", "def columns\n cols = []\n (0...size).each do |i|\n vals = []\n (0...size).each do |j|\n vals.push(get_square({:column => i, :row => j}))\n end\n cols.push(Row.new(size, {:vals => vals}))\n end\n cols\n end", "def to_a(cols=[])\n col_info = column_info(cols)\n rows = []\n rows << col_info.keys\n while try { @result_set.next } do\n row = []\n col_info.each do |col, info|\n obj = try{ @result_set.object(info[:index]) }\n case info[:type]\n when :string\n row << obj.to_s\n when :boolean\n row << (obj.to_s =~ /true/i ? true : false)\n when :long\n row << obj.to_i\n when :double\n row << obj.to_f\n else\n log.warning \"Unkown type: #{info[:type]} for #{col}\"\n row << obj.to_s\n end\n end\n rows << row\n end\n rows\n end", "def columns!\n @columns = nil\n columns\n end", "def columns\n puzzle.transpose\n end", "def make_columns(rows)\n columns = Array.new(rows.size) { [] }\n # make an empty nested array to represent columns.\n # iterate through the rows, for each row...\n # place the number into the new nested array evenly across the subarrays\n rows.each do |row|\n row.each_with_index do |num, col_idx|\n columns[col_idx] << num\n end\n end\n columns\nend", "def columns\n end", "def get_columns\n column_lines = []\n 0.upto(@@width - 1) do |column|\n column_line = \"\"\n 0.upto(@@height - 1) do |row|\n column_line << @board[row][column]\n end\n column_lines << column_line\n end\n column_lines\n end", "def to_a()\n res = []\n r = @raw\n @schema.each do |col|\n res << @vprocs[col[:name]].call(r)\n end\n res\n end", "def convert_columns(arr)\n if ccs = @column_converters\n arr.zip(ccs).map{|v, pr| (v && pr) ? pr.call(v) : v}\n else\n arr \n end\n end", "def get_column_elements(column)\n @cells.each_with_object([]) do |row, queried_column|\n queried_column << row[column]\n end\n end", "def to_a\n @rows\n end", "def columns\n raise NotImplementedError\n end", "def columns\n @stmt.columns\n end", "def get_col_cells col\n\t\treturn (col...9 ** 2).step(9).to_a\n\tend", "def column_names\n self[0].keys\n end", "def column_names\n columns.map(&:name)\n end", "def columns\n @stmt.columns\n end", "def rows_to_array(rows)\n collection = BlocRecord::Collection.new\n rows.each { |row| collection << new(Hash[columns.zip(row)]) }\n collection # return an array\n end", "def my_transpose\n new_array = []\n\n (0...self.length).each do |row|\n new_row = []\n\n (0...self.length).each do |col|\n new_row << self[col][row]\n \n end\n new_array << new_row\n end\n new_array\n end", "def data_with_head(columnheader)\r\n Array(raw_data_sheet.column(columnheaders_raw.index(columnheader)))\r\n end", "def columns\n orig_dataset.columns\n end", "def columns()\n ([email protected](GRT_COLROW)) ? cr[0] : nil\n end", "def columns\n @columns ||= [].tap do |fields|\n @model.columns.reject { |a| a.name.match(/_id$/) }.each do |column|\n fields << resolve(column.type, column.name)\n end\n end\n end", "def get_col(n)\n\t\tprepare(@dim_i,@dim_j)\n\t\ttmpCol = Array.new\n\t\[email protected] do |row|\n\t\t\ttmpCol.push row[n]\n\t\tend\n\t\treturn tmpCol\n\tend", "def to_ary_rows\n ary = Array.new\n rowa = Array.new\n rowi = 0\n each_index do |row, col|\n if rowi != row\n rowi = row\n ary << rowa\n rowa = Array.new\n end\n\n rowa << self[row, col]\n end\n\n ary << rowa\n ary\n end", "def get_columns_visible\n columns_visible ? JSON.parse(columns_visible) : []\n end", "def get_columns_visible\n if columns_visible\n return JSON.parse columns_visible\n else\n return []\n end\n end", "def _get_board_columns()\n column_index = 0\n array_of_columns = []\n until column_index == 9\n row_index = 0\n until row_index == 9\n array_of_columns << sudoku_board[row_index][column_index]\n row_index += 1\n end\n column_index += 1\n end\n array_of_columns.each_slice(9).to_a\n end", "def columns\n\t\t\t@columns ||= Txtboard::Column.columns.sort_by(&:order)\n\t\tend", "def cols\n cols = [[], [], []]\n @rows.each do |row| # row = conents of [0][0], [0][1], [0][2]\n row.each_with_index do |mark, col| #:x, 0 ; :o, 1, :x, 0\n #ex: [[:x, :o, :x], [:x, nil, :o], [:x, nil, :x]]\n cols[col] << mark #cols[0] = the three marks in column 0\n end\n end\n\n cols\n end", "def columns\n @columns = @clazz.columns_hash.map do |name, column|\n [name, @columns[name] || Column.new(column, @dump)]\n end.to_h.with_indifferent_access\n end" ]
[ "0.84597725", "0.8455868", "0.7914774", "0.7817184", "0.7809633", "0.78085303", "0.77703804", "0.7763367", "0.7541441", "0.7389927", "0.7388721", "0.73000866", "0.7250223", "0.72328526", "0.72142786", "0.71903396", "0.7181458", "0.71635777", "0.7161898", "0.71457535", "0.70936245", "0.70852965", "0.7039887", "0.70297813", "0.7028023", "0.70228225", "0.7019968", "0.70177263", "0.70177263", "0.69964284", "0.69962484", "0.6985152", "0.69597036", "0.69421357", "0.6918733", "0.6902895", "0.688633", "0.6872828", "0.68716735", "0.6866593", "0.68416125", "0.6832725", "0.6811504", "0.6811504", "0.6774301", "0.67686844", "0.67619914", "0.6761854", "0.67610854", "0.6753647", "0.6751805", "0.6751805", "0.67447126", "0.6742096", "0.6726686", "0.672513", "0.67070574", "0.6690473", "0.6687857", "0.6686846", "0.6653199", "0.66491246", "0.66491246", "0.6640372", "0.6632057", "0.6631341", "0.66294616", "0.6617268", "0.6609543", "0.66051835", "0.65984803", "0.65867096", "0.6571096", "0.65641636", "0.65604556", "0.65572494", "0.65534693", "0.6533094", "0.6531471", "0.65173745", "0.651304", "0.6506077", "0.6491089", "0.64827204", "0.64773065", "0.64510506", "0.6449471", "0.6439919", "0.64333963", "0.6431651", "0.64096034", "0.6395516", "0.6388924", "0.6383338", "0.6371118", "0.63676673", "0.63624156", "0.63528985", "0.6351123" ]
0.7076838
22
Returns columns as array.
def to_a columns end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cols_array\n arr = Array.new\n @columns_hash.each{|k,v| arr << k}\n return arr\n end", "def to_a\n @columns.values.flatten.compact\n end", "def to_ary_cols\n ary = Array.new\n cola = Array.new\n coli = 0\n each_index_by_cols do |row, col|\n if coli != col\n coli = col\n ary << cola\n cola = Array.new\n end\n\n cola << self[row, col]\n end\n\n ary << cola\n ary\n end", "def to_a\n columns.map { |column| @attributes[column.name.underscore] }\n end", "def columns\n @columns ||= [];\n end", "def columns \n []\n end", "def get_array_by_col()\n\t\tprepare(@dim_i,@dim_j)\n\t\ttmpTab = Array.new\n\t\tfor j in 0..@dim_j-1\n\t\t\ttmpTab.push get_col(j)\n\t\tend\n\t\treturn tmpTab\n\tend", "def columns\n @columns ||= []\n end", "def columns\n @header.to_a\n end", "def columns; @columns_hash.values; end", "def cols\n # remove the nils\n cols = (Array.new(@size) { Array.new(@size) }).map { |col| col.select { |el| el != nil} }\n \n @rows.each do |row|\n row.each_with_index do |mark, col_idx|\n cols[col_idx] << mark\n end\n end\n \n cols\n end", "def get_columns\n return @columns\n end", "def columns\n @columns_hash.values\n end", "def to_a\n array = []\n rows.times do |row|\n col_array = []\n cols.times do |col|\n col_array << self.value_at(row,col)\n end\n array << col_array\n end\n\n return array\n end", "def columns; @columns; end", "def columns\n ColumnCollection.new(@data)\n end", "def to_a\n @table.columns.map { |col| @attributes[col] }\n end", "def columns \n @c\n end", "def columns\n return @columns\n end", "def columns\r\n # TODO: transpose possibly doesn't work for rectangular (non-square) maps\r\n @all_columns ||= rows.transpose\r\n end", "def cols\n count == 0 ? Array.new(@order) :\n first.inject([]) { |arr, item| \n arr << map { |row| row[arr.count] }; arr }\n end", "def columns\n @columns\n end", "def columns\n @columns\n end", "def columns\n collect = []\n recursive_columns(@base, collect)\n end", "def cols\n @cols\n end", "def columns\n @board.transpose\n end", "def to_ary\n ary = Array.new\n each_index do |row, col|\n ary << self[row,col]\n end\n ary\n end", "def columns()\n return @columns.keys\n end", "def columns\n @columns\n end", "def columns\n @columns\n end", "def columns\n @columns ||= @csv_data[0].zip(*@csv_data[1..])\n end", "def columns\n @columns ||= begin\n column_indexes.map do |e|\n e.map do |e|\n @input[e]\n end\n end\n end\n end", "def columns\n c = []\n cells.group_by {|cell| cell.coordinate.y}.each_pair do |key,value|\n c << Column.new(position: key, cells: value)\n end\n c\n end", "def column_vectors\n # (0 .. column_size - 1).collect { |i| column(i) }\n my_rows = @rows\n r_size = my_rows.size\n col_size = my_rows[0].size\n vector_cls = Vector\n array_cls = Array\n res = array_cls.new(col_size)\n for j in 0..col_size-1 do\n a_col = array_cls.new(r_size)\n for i in 0..r_size-1 do\n a_col[i] = my_rows[i][j]\n end\n res[j] = Vector.elements(a_col, false)\n end\n res\n end", "def columns\n single_record unless @columns\n @columns || []\n end", "def header_array\n @columns.collect {|c|\n if @table[c]\n @table[c][:name].to_s\n else\n \"\"\n end\n }.compact\n end", "def raw cols\n ret = get_values [*cols]\n\n case cols\n when Array\n ret\n else\n ret.first\n end\n end", "def to_a(column_major=true)\n a = []\n if column_major\n for j in 0..3\n for i in 0..3\n a << self[i,j]\n end\n end\n else\n for i in 0..3\n for j in 0..3\n a << self[i,j]\n end\n end\n end\n a\n end", "def columns\n must_be_open!\n return @columns.map(&:first)\n end", "def to_a\n @to_a ||= @columns.map { |column| init_attribute(column) }\n end", "def columns\n @columns\n end", "def columns\n @columns ||= @stats.values.flatten.map { |a| a.column_name }\n end", "def columns\n @columns.to_enum\n end", "def to_a(column_major=true)\n a = []\n if column_major\n for j in 0..cols()-1\n for i in 0..rows()-1\n a << self[i,j]\n end\n end\n else\n for i in 0..rows()-1\n for j in 0..cols()-1\n a << self[i,j]\n end\n end\n end\n a\n end", "def to_a(column_major=true)\n a = []\n if column_major\n for j in 0..cols()-1\n for i in 0..rows()-1\n a << self[i,j]\n end\n end\n else\n for i in 0..rows()-1\n for j in 0..cols()-1\n a << self[i,j]\n end\n end\n end\n a\n end", "def create_column_data_array\n\ttable_id = create_table_id('../data/census_column_metadata.csv')\n\tcolumn_id = create_column_id('../data/census_column_metadata.csv')\n\t\n\t[title_processor,table_id,column_id].transpose\n\nend", "def columns\n @columns\n end", "def getColumn arr, col\n arr2 = [] \n for row in arr do\n arr2.push row[col]\n end \n return arr2\nend", "def column_values(column)\r\n assert_exists\r\n arr_rows = rows\r\n values = Array.new(arr_rows.length)\r\n for i in 0..arr_rows.length - 1 do\r\n values[i] = arr_rows[i][column].to_s \r\n end\r\n return values\r\n end", "def columns\n self.class.const_get(:COLUMNS) rescue []\n end", "def columns\n _columns || columns!\n end", "def columns\n @columns ||= dataset.columns\n end", "def columns\n @columns ||= dataset.columns\n end", "def col_arrays\n #puts self.inspect\n cols = []\n (MIN_ROW_POSITION..MAX_ROW_POSITION).each do |i|\n cols[i] = []\n (MIN_COL_POSITION..MAX_COL_POSITION).each do |j|\n cols[i].push(@board[j][i])\n end\n end \n cols\n end", "def raws cols\n ret = get_values [*cols], true\n\n case cols\n when Array\n ret\n else\n ret.first\n end\n end", "def to_columns\n @columns = transpose_to_columns\n end", "def columns; end", "def columns\n @columns = columns_hash.values\n end", "def columns\n CellCollection.new(@data, @row)\n end", "def columns!\n ds = clone(opts.merge(:sql => \"SELECT TOP 1 [T1].* FROM (#{opts[:sql]}) \\\"T1\\\"\"))\n ds.each{break}\n\n if cols = ds.cache[:_columns]\n self.columns = cols\n else\n []\n end\n end", "def columns\n get_metadata unless @columns\n return @columns\n end", "def columns\n @pz.group_by.each_with_index { |val, n| column_id(n) }\n end", "def columns\n return @columns if @columns\n return nil if frozen?\n set_columns(dataset.naked.columns)\n end", "def columns\n return @columns if @columns\n return nil if frozen?\n set_columns(dataset.naked.columns)\n end", "def to_a\n column_names = [@query.klass.primary_key] | connect_by_columns\n column_names.map { |name| @query.table[name] }\n end", "def getCols\n return @grid.getCols\n end", "def get_columns_name\r\n columns = []\r\n if @columns != nil\r\n @columns.each do |column|\r\n columns.push column\r\n end\r\n end\r\n \r\n if @stats != nil and @stats.length > 0\r\n @stats.each do |stat|\r\n columns.push stat.to_column_name\r\n end\r\n end\r\n \r\n return columns\r\n end", "def list_columns\n columns\n end", "def columns\n self.class.instance_variable_get(:@columns)\n end", "def columns\n cols = []\n (0...size).each do |i|\n vals = []\n (0...size).each do |j|\n vals.push(get_square({:column => i, :row => j}))\n end\n cols.push(Row.new(size, {:vals => vals}))\n end\n cols\n end", "def to_a(cols=[])\n col_info = column_info(cols)\n rows = []\n rows << col_info.keys\n while try { @result_set.next } do\n row = []\n col_info.each do |col, info|\n obj = try{ @result_set.object(info[:index]) }\n case info[:type]\n when :string\n row << obj.to_s\n when :boolean\n row << (obj.to_s =~ /true/i ? true : false)\n when :long\n row << obj.to_i\n when :double\n row << obj.to_f\n else\n log.warning \"Unkown type: #{info[:type]} for #{col}\"\n row << obj.to_s\n end\n end\n rows << row\n end\n rows\n end", "def columns!\n @columns = nil\n columns\n end", "def columns\n puzzle.transpose\n end", "def make_columns(rows)\n columns = Array.new(rows.size) { [] }\n # make an empty nested array to represent columns.\n # iterate through the rows, for each row...\n # place the number into the new nested array evenly across the subarrays\n rows.each do |row|\n row.each_with_index do |num, col_idx|\n columns[col_idx] << num\n end\n end\n columns\nend", "def columns\n end", "def get_columns\n column_lines = []\n 0.upto(@@width - 1) do |column|\n column_line = \"\"\n 0.upto(@@height - 1) do |row|\n column_line << @board[row][column]\n end\n column_lines << column_line\n end\n column_lines\n end", "def to_a()\n res = []\n r = @raw\n @schema.each do |col|\n res << @vprocs[col[:name]].call(r)\n end\n res\n end", "def convert_columns(arr)\n if ccs = @column_converters\n arr.zip(ccs).map{|v, pr| (v && pr) ? pr.call(v) : v}\n else\n arr \n end\n end", "def get_column_elements(column)\n @cells.each_with_object([]) do |row, queried_column|\n queried_column << row[column]\n end\n end", "def to_a\n @rows\n end", "def columns\n raise NotImplementedError\n end", "def columns\n @stmt.columns\n end", "def get_col_cells col\n\t\treturn (col...9 ** 2).step(9).to_a\n\tend", "def column_names\n self[0].keys\n end", "def column_names\n columns.map(&:name)\n end", "def columns\n @stmt.columns\n end", "def rows_to_array(rows)\n collection = BlocRecord::Collection.new\n rows.each { |row| collection << new(Hash[columns.zip(row)]) }\n collection # return an array\n end", "def my_transpose\n new_array = []\n\n (0...self.length).each do |row|\n new_row = []\n\n (0...self.length).each do |col|\n new_row << self[col][row]\n \n end\n new_array << new_row\n end\n new_array\n end", "def data_with_head(columnheader)\r\n Array(raw_data_sheet.column(columnheaders_raw.index(columnheader)))\r\n end", "def columns\n orig_dataset.columns\n end", "def columns()\n ([email protected](GRT_COLROW)) ? cr[0] : nil\n end", "def columns\n @columns ||= [].tap do |fields|\n @model.columns.reject { |a| a.name.match(/_id$/) }.each do |column|\n fields << resolve(column.type, column.name)\n end\n end\n end", "def get_col(n)\n\t\tprepare(@dim_i,@dim_j)\n\t\ttmpCol = Array.new\n\t\[email protected] do |row|\n\t\t\ttmpCol.push row[n]\n\t\tend\n\t\treturn tmpCol\n\tend", "def to_ary_rows\n ary = Array.new\n rowa = Array.new\n rowi = 0\n each_index do |row, col|\n if rowi != row\n rowi = row\n ary << rowa\n rowa = Array.new\n end\n\n rowa << self[row, col]\n end\n\n ary << rowa\n ary\n end", "def get_columns_visible\n columns_visible ? JSON.parse(columns_visible) : []\n end", "def get_columns_visible\n if columns_visible\n return JSON.parse columns_visible\n else\n return []\n end\n end", "def _get_board_columns()\n column_index = 0\n array_of_columns = []\n until column_index == 9\n row_index = 0\n until row_index == 9\n array_of_columns << sudoku_board[row_index][column_index]\n row_index += 1\n end\n column_index += 1\n end\n array_of_columns.each_slice(9).to_a\n end", "def columns\n\t\t\t@columns ||= Txtboard::Column.columns.sort_by(&:order)\n\t\tend", "def cols\n cols = [[], [], []]\n @rows.each do |row| # row = conents of [0][0], [0][1], [0][2]\n row.each_with_index do |mark, col| #:x, 0 ; :o, 1, :x, 0\n #ex: [[:x, :o, :x], [:x, nil, :o], [:x, nil, :x]]\n cols[col] << mark #cols[0] = the three marks in column 0\n end\n end\n\n cols\n end", "def columns\n @columns = @clazz.columns_hash.map do |name, column|\n [name, @columns[name] || Column.new(column, @dump)]\n end.to_h.with_indifferent_access\n end" ]
[ "0.84597725", "0.7914774", "0.7817184", "0.7809633", "0.78085303", "0.77703804", "0.7763367", "0.7541441", "0.7389927", "0.7388721", "0.73000866", "0.7250223", "0.72328526", "0.72142786", "0.71903396", "0.7181458", "0.71635777", "0.7161898", "0.71457535", "0.70936245", "0.70852965", "0.7076838", "0.7076838", "0.7039887", "0.70297813", "0.7028023", "0.70228225", "0.7019968", "0.70177263", "0.70177263", "0.69964284", "0.69962484", "0.6985152", "0.69597036", "0.69421357", "0.6918733", "0.6902895", "0.688633", "0.6872828", "0.68716735", "0.6866593", "0.68416125", "0.6832725", "0.6811504", "0.6811504", "0.6774301", "0.67686844", "0.67619914", "0.6761854", "0.67610854", "0.6753647", "0.6751805", "0.6751805", "0.67447126", "0.6742096", "0.6726686", "0.672513", "0.67070574", "0.6690473", "0.6687857", "0.6686846", "0.6653199", "0.66491246", "0.66491246", "0.6640372", "0.6632057", "0.6631341", "0.66294616", "0.6617268", "0.6609543", "0.66051835", "0.65984803", "0.65867096", "0.6571096", "0.65641636", "0.65604556", "0.65572494", "0.65534693", "0.6533094", "0.6531471", "0.65173745", "0.651304", "0.6506077", "0.6491089", "0.64827204", "0.64773065", "0.64510506", "0.6449471", "0.6439919", "0.64333963", "0.6431651", "0.64096034", "0.6395516", "0.6388924", "0.6383338", "0.6371118", "0.63676673", "0.63624156", "0.63528985", "0.6351123" ]
0.8455868
1
Return the number of header columns
def length columns.length end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def header_cells_count\n header_cells.count\n end", "def header_cols\n @row_dims.count\n end", "def number_of_columns\n headings_with_rows.map { |r| r.number_of_columns }.max || 0\n end", "def header_rows\n @col_dims.count\n end", "def headerRowCount\n self.fetch(:headerRowCount, self.header ? 1 : 0)\n end", "def header_length\n @header_length ||= DBF_HEADER_SIZE + columns.size * 32 + 1\n end", "def ncols\n @colnames.length\n end", "def column_count\r\n assert_exists\r\n arr_cells = cells\r\n return arr_cells.length\r\n end", "def column_count\r\n assert_exists\r\n arr_rows = rows\r\n return arr_rows[0].column_count\r\n end", "def columns_count\n @columns.size\n end", "def column_count\n visible_column_names().count\n end", "def header_size(header)\n header.unpack(\"N\").first\n end", "def count_columns\n fields.size\n end", "def columns_count\n @values.empty? ? 0 : @values.first.count\n end", "def column_size\n first_row = @rows[0]\n if first_row._equal?(nil)\n return 0\n end\n first_row.size\n end", "def header_len\n (@binhdr[12, 1].unpack(\"C\").pop >> 4) << 2\n end", "def find_number_of_columns\n column_array = []\n CSV.foreach('testdata.csv', {headers: true}) {|row| column_array << row[0]}\n column_array.uniq.size\nend", "def column_width\n column_headings.values.collect {|l| l.to_s.length}.max + 2\n end", "def num_columns\n score_numbers.count\n end", "def num_cols\n col_labels.length\n end", "def num_cols()\n return self[0].length\n end", "def size_header\n 2 + 2 + 1\n end", "def columns\n @header.to_a\n end", "def number_of_columns\n return rows.first.length unless rows.empty?\n raise Error, 'your table needs some rows'\n end", "def header_size\n 0\n end", "def get_header_info\n @data.rewind\n \n #column_count_offset = 33, record_count_offset = 24, record_length_offset = 36\n @record_count, @data_offset, @record_length = data.read(HEADER_LENGTH).unpack(\"@24 I x4 I I\")\n @column_count = (@data_offset-400)/200\n end", "def size_column_headings\n $sized_column_headings = []\n if $column_widths\n $column_headings.zip($column_widths) do |h, w| \n $sized_column_headings << h.slice(0, w)\n end\n end\nend", "def header_length() 3 end", "def size\n return 0 if columns.empty?\n\n columns.first.size\n end", "def column_count\n is_container? ? get_content_param_by_key( :model_count_in_row ) : 0\n end", "def grid_header_rows\n 1\n end", "def column_count\n @stmt_api.column_count\n end", "def column_headings\n {\n :line_count => \"Lines\",\n :loc_count => \"LOC\",\n :file_count => \"Classes\",\n :method_count => \"Methods\",\n :average_methods => \"M/C\",\n :method_length => \"LOC/M\",\n :class_length => \"LOC/C\"\n }\n end", "def column_size; end", "def column_headers\n use_column_headers ? columns.map(&:heading) : true\n end", "def width\n return 0 if columns.empty?\n\n columns.size\n end", "def header_size\n TYPE_SIZE\n end", "def size_fil_header\n 4 + 4 + 4 + 4 + 8 + 2 + 8 + 4\n end", "def size_index_header\n 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 8 + 2 + 8\n end", "def header_size\n 12\n end", "def column_with_headings n\n headings_with_rows.map { |row| row_with_hash(row)[n] }.compact\n end", "def column_count\n @stkw_config[:max_col]\n end", "def header_height\n 0\n end", "def header_length_for_chunk(offset)\n offset == 0 ? 12 : 1\n end", "def column_headers(data)\n data.find { |line| line.split(' ').first.downcase == HEADER_INDICATOR }.split(' ')\n end", "def headers\n columns.map(&:header)\n end", "def get_columns\n require 'io/console'\n n = ENV[\"COLUMNS\"]\n if n.nil? or n == \"\"\n rows, n = IO.console.winsize\t\n else\n n = n.to_i\n end\n return n\nend", "def column_size\n @delegate.getColSize\n end", "def columns\n 1\n end", "def len_header\n return @len_header unless @len_header.nil?\n _pos = @_io.pos\n @_io.seek(88)\n @len_header = @_io.read_u8le\n @_io.seek(_pos)\n @len_header\n end", "def header_length\n self[:ip_vhl] & 0x0f\n end", "def header_size\n FFI::Type::ULONG.size + FFI::Type::USHORT.size + FFI::Type::USHORT.size\n end", "def nrows\n @rownames.size\n end", "def num_fields\n IBM_DB.num_fields(@stmt)\n end", "def cells_count\n rows_count * columns_count\n end", "def header_fields\n @csv.headers\n end", "def header_row_index\n index(header)\n end", "def get_colspan( closed_projects )\n length = closed_projects.length\n if length == 0 \n return 1 \n else\n return length \n end\n end", "def columns\n layout_text.blank? ? 12 : layout[0].size\n end", "def pos_fil_header\n 0\n end", "def get_columns!( *headers )\n headers = headers.flatten\n hrow = sheet.header_rows - 1\n ensure_shape\n @data = @data.transpose.select{ |col| col[0..hrow].any?{ |val| headers.include?( val ) } }\n @data = @data.sort_by{ |col| headers.index( col[0..hrow].select { |val| headers.include?( val ) }.first ) || headers.length }.transpose\n calc_dimensions\n end", "def ar_index_colspan\n colspan= 0\n colspan+= 1 if controller.ardata.links.include? :edit\n colspan+= 1 if controller.ardata.links.include? :show\n colspan+= 1 if controller.ardata.links.include? :destroy\n \n if colspan > 0\n content_tag(:th, '', :colspan => colspan) \n else\n \"\"\n end\n end", "def cols\n @size\n end", "def table_has_header?(columns)\n columns.any? { |column| !column[:title].nil? }\n end", "def column_header_names\r\n column_headers.collect {|header| header.name }\r\n end", "def columns\n @columns || 150\n end", "def header_rows\n []\n end", "def columns_len(index)\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n result = Native.SplitComponentState_columns_len(@handle.ptr, index)\n result\n end", "def column_header\n (0..upper_bound_x+1)\n .to_a\n .map { |num| num.to_s.rjust((upper_bound_y + 1).to_s.size,'0')}\n .map { |num| num.chars }\n .transpose\n .map { |num| num.join }\n .map { |num| num.rjust(num.size + 5,\" \") }\n .join(\"\\n\") + \"\\n\"\n end", "def num_fields\n @fields.size\n end", "def columnCount(parent)\n return 1\n end", "def card_ncolumns\n 0\n end", "def columns\n @columns ||= header.collect { |header_cell|\n Column.new(self)\n }\n end", "def _find_number_of_data_rows(rows, col=0)\n puts \"Finding number of data rows. rows.length is returning: #{rows.length.to_s}\"\n cnt_data_rows = 0\n\n rows.each do |row|\n if row.cells.length > 0\n if row.cells[col].present?\n cnt_data_rows = cnt_data_rows + 1\n end # if row.cells[col].present?\n end # if row.cells.length > 0\n end if rows.present? # rows.each do |row|\n\n puts \"We found #{ (cnt_data_rows-1).to_s }\"\n\n # Subtract 1 for header row.\n return cnt_data_rows-1\n end", "def columns; end", "def getTotalNumOutcomeDetailCols()\n totalcols = 0;\n @outcomedetailsids.each do |outd_id|\n totalcols = totalcols + getNumOutcomeDetailCols(outd_id)\n end\n return totalcols\n end", "def columnheaders_raw\r\n columns = Array(raw_data_sheet.row(0)).compact\r\n columns = columns.collect!{ |col| clean_string(col) } unless columns.nil?\r\n columns\r\n end", "def getTotalNumDesignDetailCols()\n @designdetailsids.each do |dd_id|\n totalcols = totalcols + getNumDesignDetailCols(dd_id)\n end\n return totalcols\n end", "def grid_head_data_headers(cols: nil, **opt, &block)\n start_column = positive(opt.delete(:'aria-colindex')) || 1\n (cols || grid_row_columns).map.with_index(start_column) do |col, idx|\n grid_head_cell(col, **opt, 'aria-colindex': idx, &block)\n end\n end", "def header_fields\n IO.binread(@path, HEADER_SIZE, 0).unpack(\"N5C1\")\n end", "def headers\n rows.first\n end", "def cluster_count\n\t\tcase @header.type\n\t\twhen :fat32; @fat.fat.length/4\n\t\twhen :fat16; @fat.fat.length/2\n\t\twhen :fat12; @fat.fat.length*2/3\n\t\tend - 2\n\tend", "def header_fields\n header.fields\n end", "def columnheaders_unique?\r\n columnheaders_raw.length == columnheaders_raw.uniq.length\r\n end", "def headers\n return nil if sheet.header_rows.nil? || sheet.header_rows.zero?\n @data[ 0..sheet.header_rows-1 ]\n end", "def record_count\n return nil unless @rows\n @rows.size - 1 # Don't include the header row\n end", "def table_counts(tables)\r\n\ttables.each do |table|\r\n\t\tputs \"\"\r\n\t\tputs table['name']\r\n\t\tputs \"column count = #{table['cols'].length}\"\r\n\t\tputs \"type count = #{table['type'].length}\"\r\n\t\ti = 0\r\n\t\ttable['data'].each do |row|\r\n\t\t\tputs \"row #{i} = #{row.length}\"\r\n\t\t\ti += 1\r\n\t\tend\r\n\t\tputs \"\"\r\n\tend\r\nend", "def csv_file_header_array\n\t\tScreeningDatumUpdate.expected_column_names\n\tend", "def header_cells\n data_sheet[header_range]\n end", "def header_str\n @columns.collect {|c|\n if @table[c]\n #{}\"%#{@table[c][:size]}s\" % [@table[c][:name]]\n format_data(c, @table[c][:name])\n else\n nil\n end\n }.compact.join(' ')\n end", "def content_cols\n longest = @list.max_by(&:length)\n ## 2013-03-06 - 20:41 crashes here for some reason when man gives error message no man entry\n return 0 unless longest\n longest.length\n end", "def content_cols\n longest = @content.max_by(&:length)\n ## 2013-03-06 - 20:41 crashes here for some reason when man gives error message no man entry\n return 0 unless longest\n longest.length\n end", "def valid_header?(header)\n return false if header.empty?\n length = -1\n header.each do |row|\n return false if row.empty?\n length = row.size if length == -1\n return false if row.size != length\n end\n true\n end", "def with_column_models_count\n # Drop the last row (the corresponding instances of the {ActsAsTable::ColumnModel} class).\n @with_column_models_count ||= Hash.for(@column_models, @header_names_with_padding).to_array[0..-2]\n end", "def count_field_names\n count_fields.map(&:to_s)\n end", "def column_count(string)\n Math.sqrt(string.length).ceil\nend", "def column_width\n @level_order.inject(0) do |width_, level_|\n w_ = level_.name.size\n w_ > width_ ? w_ : width_\n end\n end", "def column_width n\n column_widths[n] || 0\n end", "def field_count\n @fields.length\n end", "def table_headings\n tableheadings = []\n print_layout.each do |section|\n row_cells = section[:row_cells]\n raise Error::AppError.new('table_headings', 'No Row Cells defined') if row_cells.nil?\n\n tableheadings += table_cell_headers(row_cells)\n end\n [tableheadings, tableheadings.count]\n end" ]
[ "0.8598347", "0.8459096", "0.8176802", "0.81348854", "0.8126", "0.77281344", "0.7668723", "0.7613302", "0.75724685", "0.75489396", "0.7471584", "0.73858905", "0.73596627", "0.72440046", "0.71909547", "0.71369565", "0.7115238", "0.70662475", "0.69750696", "0.69543403", "0.6942985", "0.69318706", "0.6923935", "0.6922647", "0.68871135", "0.68656874", "0.686168", "0.6796231", "0.6713255", "0.66715544", "0.6667509", "0.6662787", "0.66369975", "0.66034615", "0.65861726", "0.65840274", "0.6572892", "0.65627", "0.655851", "0.6519603", "0.65079284", "0.64906013", "0.6419878", "0.6417471", "0.63962954", "0.63916457", "0.63699585", "0.6369651", "0.6351879", "0.63430417", "0.6337314", "0.6327933", "0.6300399", "0.6291814", "0.6264251", "0.6257193", "0.62448823", "0.6243875", "0.6238834", "0.62346905", "0.62236977", "0.6213893", "0.62009656", "0.61938864", "0.6190849", "0.6185813", "0.6185081", "0.61548173", "0.6151402", "0.6150458", "0.6108299", "0.61082", "0.61022073", "0.61005175", "0.60903156", "0.6084187", "0.6081595", "0.6077503", "0.60720646", "0.6070157", "0.6057046", "0.6049824", "0.6043872", "0.6036286", "0.603487", "0.6030069", "0.60289514", "0.6027788", "0.60267127", "0.6021551", "0.60043687", "0.6000746", "0.59968644", "0.59948426", "0.5994179", "0.5992807", "0.5978698", "0.5970841", "0.59618384", "0.5956989" ]
0.67852396
28
Set the header converter
def converter=(object) if object.is_a?(Symbol) @converter = HoneyFormat.converter_registry[object] return end if object.is_a?(Hash) @converter = hash_converter(object) return end @converter = object end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_converted_headers\n header_conversion_chart = @import_rows_to_class.const_get(:RECORD_HEADERS).invert\n @converted_headers = importable_columns.map { |col| header_conversion_chart[col] }\n end", "def header_converters\n @header_converters.map do |converter|\n name = HeaderConverters.rassoc(converter)\n name ? name.first : converter\n end\n end", "def translate_header(header, value)\n value\n end", "def convert_header(h)\n changed_header = h.to_s.downcase.gsub('-', '').gsub(' ','_')\n (User::HEADERS[changed_header].present? ? User::HEADERS[changed_header] : changed_header).intern\n end", "def header=(value)\n @header = Mail::Header.new(value, charset)\n end", "def convert_header_file_audio\n self.convert_header_file_audio_or_video('audio')\n end", "def header=(header)\n @header = header\n end", "def setup_header(dat)\n @headers = { to: to }\n dat.each do |key, val|\n key = key.to_s.downcase\n raise \"invalid field #{key}\" unless valid_fields.include?(key)\n @headers[key.to_sym] = val unless val.nil?\n end\n end", "def set_header(header, value)\n @lunetas_headers[header.to_s] = value\n end", "def header=(header)\n @header = header\n end", "def converter\n\n end", "def header(value = nil)\n value ? self.header = value : @header\n end", "def header_value=(value)\n @header_value = value\n end", "def header=(hdr)\n order_check(hdr)\n hdr.each {|s| raise \"Header must contain strings\" if ! s.kind_of? String }\n @header = hdr\n end", "def converter\n end", "def inflector(header_inflector)\n @inflector = header_inflector\n end", "def header= h\n @header = if h.is_a? Numeric\n self[h]\n else\n h\n end\n end", "def setCustomHttpHeader(header)\n unless /^.+:.+$/.match(header)\n raise Error.new(Pdfcrowd.create_invalid_value_message(header, \"setCustomHttpHeader\", \"html-to-pdf\", \"A string containing the header name and value separated by a colon.\", \"set_custom_http_header\"), 470);\n end\n \n @fields['custom_http_header'] = header\n self\n end", "def header=(header = {})\n @header = { 'Content-Type' => 'application/json', 'Accept' => 'application/json' }.merge(header)\n end", "def header=(header = {})\n @header = { 'Content-Type' => 'application/json', 'Accept' => 'application/json' }.merge(header)\n end", "def charset=(value)\n @defaulted_charset = false\n @charset = value\n @header.charset = value\n end", "def change_header( header, value, index=1 )\n index = [index].pack('N')\n RESPONSE[:chgheader] + \"#{index}#{header}\\0#{value}\" + \"\\0\"\n end", "def setCustomHttpHeader(header)\n unless /^.+:.+$/.match(header)\n raise Error.new(Pdfcrowd.create_invalid_value_message(header, \"setCustomHttpHeader\", \"html-to-image\", \"A string containing the header name and value separated by a colon.\", \"set_custom_http_header\"), 470);\n end\n \n @fields['custom_http_header'] = header\n self\n end", "def set_header name, value\n response_object.header name, value\n end", "def change_header( header, value, index=1 )\n index = [index].pack('N')\n RESPONSE[\"CHGHEADER\"] + \"#{index}#{header}\\0#{value}\" + \"\\0\"\n end", "def converters=(_arg0); end", "def upd_header(headers)\n hdr={'Content-Type' =>'application/json'}\n if(headers!=nil)\n headers['Content-Type']='application/json'\n hdr=headers\n end\n hdr\n end", "def initialize_http_header(initheader)\n super\n set_headers_for_body\n end", "def transform_headers( str, rs )\n\t\t\[email protected] \" Transforming headers\"\n\n\t\t\t# Setext-style headers:\n\t\t\t#\t Header 1\n\t\t\t#\t ========\n\t\t\t#\n\t\t\t#\t Header 2\n\t\t\t#\t --------\n\t\t\t#\n\n\t\t\tsection_numbers = [nil, nil, nil, nil, nil]\n\n\t\t\tstr.\n\t\t\t\tgsub( HeaderRegexp ) {|m|\n\t\t\t\t\tif $1 then\n\t\t\t\t\t\[email protected] \"Found setext-style header\"\n\t\t\t\t\t\ttitle, id, hdrchar = $1, $2, $3\n\n\t\t\t\t\t\tcase hdrchar\n\t\t\t\t\t\twhen '='\n\t\t\t\t\t\t\tlevel = 1\n\t\t\t\t\t\twhen '-'\n\t\t\t\t\t\t\tlevel = 2\n\t\t\t\t\t\tend\n\t\t\t\t\telse\n\t\t\t\t\t\[email protected] \"Found ATX-style header\"\n\t\t\t\t\t\thdrchars, title, id = $4, $5, $6\n\t\t\t\t\t\tlevel = hdrchars.length\n\n\t\t\t\t\t\tif level >= 7 then\n\t\t\t\t\t\t\trs.warnings << \"illegal header level - h#{level} ('#' symbols are too many)\"\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\n\t\t\t\t\tprefix = ''\n\t\t\t\t\tif rs.numbering? then\n\t\t\t\t\t\tif level >= rs.numbering_start_level and level <= 6 then\n\t\t\t\t\t\t\tdepth = level - rs.numbering_start_level\n\n\t\t\t\t\t\t\tsection_numbers.each_index do |i|\n\t\t\t\t\t\t\t\tif i == depth and section_numbers[depth] then\n\t\t\t\t\t\t\t\t\t# increment a deepest number if current header's level equals last header's\n\t\t\t\t\t\t\t\t\tsection_numbers[i] += 1\n\t\t\t\t\t\t\t\telsif i <= depth then\n\t\t\t\t\t\t\t\t\t# set default number if nil\n\t\t\t\t\t\t\t\t\tsection_numbers[i] ||= 1\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t# clear discardeds\n\t\t\t\t\t\t\t\t\tsection_numbers[i] = nil\n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\t\tno = ''\n\t\t\t\t\t\t\t(0..depth).each do |i|\n\t\t\t\t\t\t\t\tno << \"#{section_numbers[i]}.\"\n\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\t\tprefix = \"#{no} \"\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\n\t\t\t\t\ttitle_html = apply_span_transforms( title, rs )\n\n\t\t\t\t\tunless id then\n\t\t\t\t\t\tcase rs.header_id_type\n\t\t\t\t\t\twhen HeaderIDType::ESCAPE\n\t\t\t\t\t\t\tid = escape_to_header_id(title_html)\n\t\t\t\t\t\t\tif rs.headers.find{|h| h.id == id} then\n\t\t\t\t\t\t\t\trs.warnings << \"header id collision - #{id}\"\n\t\t\t\t\t\t\t\tid = \"bfheader-#{Digest::MD5.hexdigest(title)}\"\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tid = \"bfheader-#{Digest::MD5.hexdigest(title)}\"\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\n\t\t\t\t\ttitle = \"#{prefix}#{title}\"\n\t\t\t\t\ttitle_html = \"#{prefix}#{title_html}\"\n\n\n\t\t\t\t\tunless id =~ IdRegexp then\n\t\t\t\t\t\trs.warnings << \"illegal header id - #{id} (legal chars: [a-zA-Z0-9_-.] | 1st: [a-zA-Z])\"\n\t\t\t\t\tend\n\n\t\t\t\t\tif rs.block_transform_depth == 1 then\n\t\t\t\t\t\trs.headers << RenderState::Header.new(id, level, title, title_html)\n\t\t\t\t\tend\n\n\t\t\t\t\tif @use_header_id then\n\t\t\t\t\t\t%{<h%d id=\"%s\">%s</h%d>\\n\\n} % [ level, id, title_html, level ]\n\t\t\t\t\telse\n\t\t\t\t\t\t%{<h%d>%s</h%d>\\n\\n} % [ level, title_html, level ]\n\t\t\t\t\tend\n\t\t\t\t}\n\t\tend", "def set_slimmer_headers(hash)\n raise InvalidHeader if (hash.keys - SLIMMER_HEADER_MAPPING.keys).any?\n\n SLIMMER_HEADER_MAPPING.each do |hash_key, header_suffix|\n value = hash[hash_key]\n headers[\"#{HEADER_PREFIX}-#{header_suffix}\"] = value.to_s if value\n end\n end", "def header(str)\n # {{{\n if @output_started\n raise \"HTTP-Headers are already send. You can't change them after output has started!\"\n end\n unless @output_allowed\n raise \"You just can set headers inside of a Rweb::out-block\"\n end\n if str.is_a?Array\n str.each do | value |\n self.header(value)\n end\n\n elsif str.split(/\\n/).length > 1\n str.split(/\\n/).each do | value |\n self.header(value)\n end\n\n elsif str.is_a? String\n str.gsub!(/\\r/, \"\")\n\n if (str =~ /^HTTP\\/1\\.[01] [0-9]{3} ?.*$/) == 0\n pattern = /^HTTP\\/1.[01] ([0-9]{3}) ?(.*)$/\n\n result = pattern.match(str)\n self.setstatus(result[0], result[1])\n elsif (str =~ /^status: [0-9]{3} ?.*$/i) == 0\n pattern = /^status: ([0-9]{3}) ?(.*)$/i\n\n result = pattern.match(str)\n self.setstatus(result[0], result[1])\n else\n a = str.split(/: ?/, 2)\n\n @header[a[0].downcase] = a[1]\n end\n end\n # }}}\n end", "def header_set(name, value)\n return dup_without_response.header_set(name, value) if response\n\n name = name.to_s\n if value.nil?\n @headers.delete name\n return self\n end\n\n @headers[name] = value.to_s\n self\n end", "def on_header_init()\n end", "def converters; end", "def converters; end", "def converters; end", "def set_header(name, value)\n @headers[name] = value\n \n return self\n end", "def header(name, value)\n har_headers << [name, value]\n super(name, value)\n end", "def parse_setext_header; end", "def []=(k, v) @headers[translate_header_to_sym(k)] = v end", "def converter; end", "def normalize_header!\n @gsi.dsc = HeaderOption::DSC::TELETEXT_LEVEL_2\n @gsi.lc = @gsi.lc.to_i.to_s.rjust(2,'0')\n @gsi.tnb = @gsi.tnb.to_i.to_s.rjust(5,'0')\n @gsi.tns = @gsi.tns.to_i.to_s.rjust(5,'0')\n @gsi.tng = @gsi.tng.to_i.to_s.rjust(3,'0')\n @gsi.tcp = @gsi.tcp[0..1].to_i.to_s.ljust(2,'0') + \n @gsi.tcp[2..3].to_i.to_s.ljust(2,'0') +\n @gsi.tcp[4..5].to_i.to_s.ljust(2,'0') +\n @gsi.tcp[6..7].to_i.to_s.ljust(2,'0')\n @gsi.tcf = @gsi.tcf[0..1].to_i.to_s.ljust(2,'0') +\n @gsi.tcf[2..3].to_i.to_s.ljust(2,'0') +\n @gsi.tcf[4..5].to_i.to_s.ljust(2,'0') +\n @gsi.tcf[6..7].to_i.to_s.ljust(2,'0')\n @gsi.co = @gsi.co.upcase\n end", "def set_header key, value\n headers.update(key => value)\n end", "def set_header\n @header = Header.find(params[:id])\n end", "def set_header\n @header = Header.find(params[:id])\n end", "def header=(new_header)\n @header = new_header\n # prepare defaults\n @header[\"description\"] ||= \"\"\n # handle tags\n @dependencies = parse_tag_list(Array(@header[\"requires\"]))\n @provides = parse_tag_list(Array(@header[\"provides\"]))\n\n @extends = case @header[\"extends\"]\n when Array then Tag.new(@header[\"extends\"][0])\n when String then Tag.new(@header[\"extends\"])\n else nil\n end\n\n @replaces = case @header[\"replaces\"]\n when Array then Tag.new(@header[\"replaces\"][0])\n when String then Tag.new(@header[\"replaces\"])\n else nil\n end\n end", "def __convert(h); end", "def parse_header\n header.each do |field, value|\n self.instance_variable_set(\"@#{field}\", value) if HEADER_FIELDS.include? field\n end\n end", "def headers=(hash)\n if headers\n headers.replace hash\n else\n super\n end\n end", "def set_content_type\n case params['format']\n when 'xml'\n response.headers['Content-Type'] = \"application/xml; charset=utf-8\"\n when 'json', 'csv'\n response.headers['Content-Type'] = \"application/json; charset=utf-8\"\n else\n raise \"Unexpected format!\"\n end\n end", "def smart_convert!\n if @file_headers.any?\n @data = @data.map { |d_arr| @file_headers.each_with_object({}).with_index { |(h_name, h_hash), ind| h_hash[h_name] = d_arr[ind] } }\n @smart_convert = true\n end\n end", "def apply_header(options, key, value)\n options.merge! :headers => {} unless options.has_key? :headers\n options[:headers].merge!({ key => value })\n end", "def []=(name, value)\n if name.to_s == 'body'\n self.body = value\n elsif name.to_s =~ /content[-_]type/i\n header[name] = value\n elsif name.to_s == 'charset'\n self.charset = value\n else\n header[name] = value\n end\n end", "def header=(header)\n header = [header] unless header.respond_to? :each\n @header = normalize(header)\n @aliases = header.map do |n|\n n.downcase.gsub(' ', '_').gsub(\"\\n\", '_').to_sym\n end if @aliases.empty?\n end", "def []=(key, value)\n @header[key] = value\n end", "def set_ResponseFormat(value)\n set_input(\"ResponseFormat\", value)\n end", "def set_ResponseFormat(value)\n set_input(\"ResponseFormat\", value)\n end", "def set_ResponseFormat(value)\n set_input(\"ResponseFormat\", value)\n end", "def set_ResponseFormat(value)\n set_input(\"ResponseFormat\", value)\n end", "def set_ResponseFormat(value)\n set_input(\"ResponseFormat\", value)\n end", "def set_ResponseFormat(value)\n set_input(\"ResponseFormat\", value)\n end", "def set_ResponseFormat(value)\n set_input(\"ResponseFormat\", value)\n end", "def set_ResponseFormat(value)\n set_input(\"ResponseFormat\", value)\n end", "def set_ResponseFormat(value)\n set_input(\"ResponseFormat\", value)\n end", "def set_ResponseFormat(value)\n set_input(\"ResponseFormat\", value)\n end", "def []=(header, value)\n @headers[header] = value\n end", "def content_encoding=( type )\n\t\treturn self.headers.content_encoding = type\n\tend", "def content_encoding=( type )\n\t\treturn self.headers.content_encoding = type\n\tend", "def set_content_type(ctype)\n headers[\"Content-Type\"] = \"#{ctype};charset=#{Response.charset}\"\n end", "def set_ResponseFormat(value)\n set_input(\"ResponseFormat\", value)\n end", "def set_ResponseFormat(value)\n set_input(\"ResponseFormat\", value)\n end", "def set_ResponseFormat(value)\n set_input(\"ResponseFormat\", value)\n end", "def set_ResponseFormat(value)\n set_input(\"ResponseFormat\", value)\n end", "def set_ResponseFormat(value)\n set_input(\"ResponseFormat\", value)\n end", "def set_ResponseFormat(value)\n set_input(\"ResponseFormat\", value)\n end", "def set_ResponseFormat(value)\n set_input(\"ResponseFormat\", value)\n end", "def set_ResponseFormat(value)\n set_input(\"ResponseFormat\", value)\n end", "def set_ResponseFormat(value)\n set_input(\"ResponseFormat\", value)\n end", "def set_ResponseFormat(value)\n set_input(\"ResponseFormat\", value)\n end", "def set_ResponseFormat(value)\n set_input(\"ResponseFormat\", value)\n end", "def set_ResponseFormat(value)\n set_input(\"ResponseFormat\", value)\n end", "def set_ResponseFormat(value)\n set_input(\"ResponseFormat\", value)\n end", "def set_ResponseFormat(value)\n set_input(\"ResponseFormat\", value)\n end", "def set_ResponseFormat(value)\n set_input(\"ResponseFormat\", value)\n end", "def set_ResponseFormat(value)\n set_input(\"ResponseFormat\", value)\n end", "def set_ResponseFormat(value)\n set_input(\"ResponseFormat\", value)\n end", "def set_ResponseFormat(value)\n set_input(\"ResponseFormat\", value)\n end", "def set_ResponseFormat(value)\n set_input(\"ResponseFormat\", value)\n end", "def set_ResponseFormat(value)\n set_input(\"ResponseFormat\", value)\n end", "def set_ResponseFormat(value)\n set_input(\"ResponseFormat\", value)\n end", "def set_ResponseFormat(value)\n set_input(\"ResponseFormat\", value)\n end", "def set_ResponseFormat(value)\n set_input(\"ResponseFormat\", value)\n end", "def set_ResponseFormat(value)\n set_input(\"ResponseFormat\", value)\n end", "def set_ResponseFormat(value)\n set_input(\"ResponseFormat\", value)\n end", "def set_ResponseFormat(value)\n set_input(\"ResponseFormat\", value)\n end", "def set_ResponseFormat(value)\n set_input(\"ResponseFormat\", value)\n end", "def set_ResponseFormat(value)\n set_input(\"ResponseFormat\", value)\n end", "def set_ResponseFormat(value)\n set_input(\"ResponseFormat\", value)\n end", "def set_ResponseFormat(value)\n set_input(\"ResponseFormat\", value)\n end", "def set_ResponseFormat(value)\n set_input(\"ResponseFormat\", value)\n end" ]
[ "0.6733514", "0.6575196", "0.5817223", "0.57947975", "0.57933617", "0.5789348", "0.5728831", "0.5708103", "0.5689177", "0.5657229", "0.56089735", "0.56034636", "0.55983406", "0.5596657", "0.5593422", "0.5582495", "0.5576264", "0.5564965", "0.55510646", "0.55508816", "0.55280054", "0.5514786", "0.55094206", "0.5485055", "0.5472888", "0.5457933", "0.54517645", "0.5416157", "0.5414186", "0.54140985", "0.5366418", "0.5362069", "0.5358347", "0.53560257", "0.53560257", "0.53560257", "0.5346572", "0.53417104", "0.53401357", "0.53360844", "0.53313494", "0.5318338", "0.5310838", "0.52918476", "0.52918476", "0.5288297", "0.52601284", "0.5256437", "0.5243541", "0.5216489", "0.5214231", "0.520307", "0.5201112", "0.51700354", "0.5157781", "0.51517457", "0.51517457", "0.51517457", "0.51517457", "0.51517457", "0.51517457", "0.51517457", "0.51517457", "0.51517457", "0.51517457", "0.51491225", "0.5149113", "0.5149113", "0.51275814", "0.5119853", "0.5119853", "0.5119853", "0.5119853", "0.5119853", "0.5119853", "0.5119853", "0.5119853", "0.5119853", "0.5119853", "0.5119853", "0.5119853", "0.5119853", "0.5119853", "0.5119853", "0.5119853", "0.5119853", "0.5119853", "0.5119853", "0.5119853", "0.5119853", "0.5119853", "0.5119853", "0.5119853", "0.5119853", "0.5119853", "0.5119853", "0.5119853", "0.5119853", "0.5119853", "0.5119853" ]
0.5665112
9
Set the header deduplicator
def deduplicator=(object) if object.is_a?(Symbol) @deduplicator = HoneyFormat.header_deduplicator_registry[object] return end @deduplicator = object end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def header_unset(name)\n header_set name, nil\n end", "def set_header_obfuscator(header_obfuscator)\n connection = @session.connection\n connection.set_header_obfuscator(header_obfuscator) if connection.is_a? Logging::Obfuscation::ObfuscationCapable\n end", "def uniq!( header )\n data.uniq!( header ); self\n end", "def delete_response_header(key)\n new(\n response_headers: ConnSupport::Headers.delete(\n response_headers, key\n )\n )\n end", "def initialize\n # pass\n @truncation_helper = ::Datadog::DistributedTracing::Headers::Headers.new({})\n end", "def header_set(name, value)\n return dup_without_response.header_set(name, value) if response\n\n name = name.to_s\n if value.nil?\n @headers.delete name\n return self\n end\n\n @headers[name] = value.to_s\n self\n end", "def setup_header\n orig_setup_header\n unless chunked? || @header['content-length']\n @header['connection'] = \"close\"\n @keep_alive = false\n end\n end", "def setup_header\n orig_setup_header\n unless chunked? || @header['content-length']\n @header['connection'] = \"close\"\n @keep_alive = false\n end\n end", "def original\n @original_header\n end", "def header_insert\n super\n end", "def put_header(key, value)\n @j_del.putHeader(key, value.to_s)\n self\n end", "def put_header(key, value)\n @j_del.putHeader(key, value.to_s)\n self\n end", "def initialize_copy(_original)\n @headers = @headers.deep_dup\n end", "def header=(header)\n header = [header] unless header.respond_to? :each\n @header = normalize(header)\n @aliases = header.map do |n|\n n.downcase.gsub(' ', '_').gsub(\"\\n\", '_').to_sym\n end if @aliases.empty?\n end", "def set_header_obfuscator(header_obfuscator)\n raise ArgumentError, 'header_obfuscator is required' unless header_obfuscator\n\n @header_obfuscator = header_obfuscator\n end", "def header(key)\n @j_del.getHeader(key)\n end", "def delete(header = {})\n super(DEFAULT_REQUEST_HEADER.merge(header))\n end", "def header=(header)\n @header = header\n end", "def headers=(hash)\n if headers\n headers.replace hash\n else\n super\n end\n end", "def addFitsHeader(hdu, det)\n ## define header keyvalues\n telescop = \"GROWTH\"\n instrume = \"#{det}\"\n chantype = \"PI\"\n detchans = 2048\n hduclass = \"OGIP\"\n hduclas1 = \"RESPONSE\"\n \n ## write header keyvalues\n hdu.addHeader(\"TELESCOP\", telescop, \"mission name\")\n hdu.addHeader(\"INSTRUME\", instrume, \"instrument/detector name\")\n hdu.addHeader(\"CHANTYPE\", chantype, \"channel type (PHA, PI etc)\")\n hdu.addHeader(\"DETCHANS\", detchans, \"total number possible channels\")\n hdu.addHeader(\"HDUCLASS\", hduclass, \"\")\n hdu.addHeader(\"HDUCLAS1\", hduclas1, \"\")\nend", "def merge(other)\n headers = dup\n other.each do |field, value|\n headers[downcased(field)] = value\n end\n headers\n end", "def prepend_header(name, value)\n end", "def delete(header = {})\n super(DEFAULT_REQUEST_HEADER.merge(header).merge('If-Match' => @data['eTag']))\n end", "def header(name, value)\n har_headers << [name, value]\n super(name, value)\n end", "def header(value = nil)\n value ? self.header = value : @header\n end", "def proxy_header\n super\n end", "def headers=(hash); end", "def headers=(hash); end", "def header=(header)\n @header = header\n end", "def speak_header_once_inherit(element)\n header_elements = @html_parser.find(element).find_descendants(\n \"[#{DATA_ATTRIBUTE_HEADERS_OF}]\"\n ).list_results\n header_elements.each(&:remove_node)\n end", "def setup_proxy_header(req, res)\n # Choose header fields to transfer\n header = Hash.new\n choose_header(req, header)\n set_via(header)\n return header\n end", "def skip_header\n @skip_header = true\n end", "def set_header_insert(opts)\n opts = check_params(opts,[:headers])\n super(opts)\n end", "def header_str_with_newrelic\n header_str_with_tracing { header_str_without_newrelic }\n end", "def header_options\n super.merge :signature => true\n end", "def check_duplicate_csv_headers(table)\n if table.headers.size != table.headers.uniq.size\n dups = table.headers.select{|e| table.headers.count(e) > 1 }\n Squib.logger.warn \"CSV duplicated the following column keys: #{dups.join(',')}\"\n end\n end", "def reset_subreddit_header(subreddit)\n subreddit_name = extract_string(subreddit, :display_name)\n post 'api/delete_sr_header', :r => subreddit_name\n end", "def dedupe_id\n raise NotImplementedError\n end", "def header\n \"*#{super}*\"\n end", "def on_after_create_http_request(http_request)\n if self.class.cached_digest_header\n http_request.set_header('authorization', digest_auth_header_from_response)\n end\n end", "def setup_header(dat)\n @headers = { to: to }\n dat.each do |key, val|\n key = key.to_s.downcase\n raise \"invalid field #{key}\" unless valid_fields.include?(key)\n @headers[key.to_sym] = val unless val.nil?\n end\n end", "def uniq!( header )\n column = col_index( colref_by_header( header ) )\n @data = skip_headers { |d| d.uniq { |row| row[ column - 1 ] } }\n calc_dimensions\n end", "def replace(other)\n unless other.kind_of?(RMail::Header)\n raise TypeError, \"#{other.class.to_s} is not of type RMail::Header\"\n end\n temp = other.dup\n @fields = temp.fields\n @mbox_from = temp.mbox_from\n self\n end", "def double_header(iterator)\n #p \"double_header iterator\", iterator\n head1 = cut_line(iterator) \n #p \"head1\", head1\n head1_csv = CSV.parse(head1).flatten \n #p \"head1_csv\", head1_csv\n head1_csv = nil_blank(head1_csv) \n #p \"head1_csv\", head1_csv\n head1_csv.collect!{|str| str.strip} #leading and trailing whitespace removed\n #p \"head1_csv\", head1_csv \n #puts \"\"\n \n head2 = cut_line(iterator) \n #p \"head2\", head2\n head2_csv = CSV.parse(head2).flatten \n #p \"head2_csv\", head2_csv\n head2_csv = nil_blank(head2_csv) \n #p \"head2_csv\", head2_csv\n head2_csv.collect!{|str| str.strip} #leading and trailing whitespace removed\n #p \"head2_csv\", head2_csv\n \n merged_arr = merge_headers(head1_csv, head2_csv, \" \", \"[\", \"]\")\n \n #Adds quotes around fields (helps avoid CSV parse bugs)\n if ($add_quotes == true)\n merged_arr.map! {|s| \"\\\"#{s}\\\"\" }\n end\n \n new_head = merged_arr.join(',') #creats string with \",\" as sperator\n new_head << \"\\r\\n\" #So CSV can parse headers\n new_iterator = new_head << iterator #combines new header with data\n return new_iterator\n end", "def set_DropDuplicates(value)\n set_input(\"DropDuplicates\", value)\n end", "def header(key = nil, val = nil)\n if key\n val ? @header[key.to_s] = val : @header.delete(key.to_s)\n else\n @header\n end\n end", "def headers=(hash)\n @headers.replace hash\n end", "def prepare_custom_headers(header)\n header.end_with?(\"__c\") ? header.slice(0..-4).downcase : header.downcase\n end", "def header= h\n @header = if h.is_a? Numeric\n self[h]\n else\n h\n end\n end", "def update_header\n header.body_length = body.length\n end", "def set_slimmer_headers(hash)\n raise InvalidHeader if (hash.keys - SLIMMER_HEADER_MAPPING.keys).any?\n\n SLIMMER_HEADER_MAPPING.each do |hash_key, header_suffix|\n value = hash[hash_key]\n headers[\"#{HEADER_PREFIX}-#{header_suffix}\"] = value.to_s if value\n end\n end", "def set_header_name(name=nil)\n if name.class == String && !block_given?\n @j_del.java_method(:setHeaderName, [Java::java.lang.String.java_class]).call(name)\n return self\n end\n raise ArgumentError, \"Invalid arguments when calling set_header_name(name)\"\n end", "def prune_git_headers!(diff)\n GIT_HEADERS.each do |header|\n diff.gsub!(header, '')\n end\n diff\n end", "def header(hash)\n self._headers.merge!(hash)\n end", "def merge_log_weasel_header(headers)\n if LogWeasel::Transaction.id\n headers.merge(LogWeasel::Middleware::KEY_HEADER => LogWeasel::Transaction.id)\n else\n headers\n end\n end", "def warn_about_duplicate_keys(h1, h2); end", "def prepend_header(name, value)\n original = tmail[name] || []\n tmail[name] = nil\n tmail[name] = sanitize_header(charset, name, value)\n tmail[name] = tmail[name] + original\n end", "def register\n grab_header.invert\n end", "def freeze\n @headers.freeze\n super\n end", "def set_header_options(curl)\n summary = summary_for_feed\n \n unless summary.nil?\n curl.headers['If-None-Match'] = summary[:etag] unless summary[:etag].nil?\n curl.headers['If-Modified-Since'] = summary[:last_modified] unless summary[:last_modified].nil?\n end\n \n curl\n end", "def initialize_duplicate_tab(duplicator, other)\n self.tab = if duplicator.duplicated?(other.tab)\n duplicator.duplicate(other.tab)\n else\n duplicator.options[:destination_course].video_tabs.first\n end\n end", "def header=(_arg0); end", "def header=(hdr)\n order_check(hdr)\n hdr.each {|s| raise \"Header must contain strings\" if ! s.kind_of? String }\n @header = hdr\n end", "def header_id\n @pairs.fetch(\"id\") { header_value.downcase.gsub(/[^\\w]|_/, \"-\") }\n end", "def skip_report_header=(value)\n @config.set('library.skip_report_header', value)\n end", "def header_id(n)\n \"#{n.dom_id}_header\"\n end", "def removed_attributes\n operand.header - header\n end", "def header(name, value)\n if value.nil?\n @headers.delete(name)\n else\n @headers[name] = value\n end\n end", "def header=(new_header)\n @header = new_header\n # prepare defaults\n @header[\"description\"] ||= \"\"\n # handle tags\n @dependencies = parse_tag_list(Array(@header[\"requires\"]))\n @provides = parse_tag_list(Array(@header[\"provides\"]))\n\n @extends = case @header[\"extends\"]\n when Array then Tag.new(@header[\"extends\"][0])\n when String then Tag.new(@header[\"extends\"])\n else nil\n end\n\n @replaces = case @header[\"replaces\"]\n when Array then Tag.new(@header[\"replaces\"][0])\n when String then Tag.new(@header[\"replaces\"])\n else nil\n end\n end", "def header\n @header ||= create_header\n end", "def generate_header(array)\n header_array = array.dup\n header_array.unshift('')\n end", "def fill_header(response); end", "def skip_column_header=(value)\n @config.set('library.skip_column_header', value)\n end", "def inflector(header_inflector)\n @inflector = header_inflector\n end", "def change_header( header, value, index=1 )\n index = [index].pack('N')\n RESPONSE[:chgheader] + \"#{index}#{header}\\0#{value}\" + \"\\0\"\n end", "def headers\n if !@headers\n @headers = MultiMap.new(@j_del.headers)\n end\n @headers\n end", "def headers\n if !@headers\n @headers = MultiMap.new(@j_del.headers)\n end\n @headers\n end", "def headers\n if !@headers\n @headers = MultiMap.new(@j_del.headers)\n end\n @headers\n end", "def delete_setting!(header, name)\n write do \n contents.gsub(find_setting(header, name), '')\n end\n end", "def on_header_init()\n end", "def clear_headers\n self.headers.delete_if { |k,v| true }\n \"headers cleared\"\n end", "def record_header_redundant_field_end_offsets(header, cursor)\n header.n_fields.times.map do |n|\n cursor.name(\"field_end_offset[#{n}]\") { cursor.read_uint_by_size(header.offset_size) }\n end\n end", "def add_headers; end", "def redmine_headers(h)\n h.compact.each {|k, v| headers[\"X-Redmine-#{k}\"] = v.to_s}\n end", "def add_headers(name, value)\n @headers += ', ' if @headers.length > 0\n @headers += name + '=\"'\n @headers += @header_obfuscator.obfuscate_header(name, value) unless value.nil?\n @headers += '\"'\n end", "def redmine_headers(h)\n h.each { |k,v| headers[\"X-Redmine-#{k}\"] = v }\n end", "def redmine_headers(h)\n h.each { |k,v| headers[\"X-Redmine-#{k}\"] = v }\n end", "def unshift(dsp)\n self[DspIndex::HEAD] = dsp\n self\n end", "def set_file_header(originator_id, company_entry_description, file_sequence_id=nil)\n self.file_header_record = FileHeaderRecord.new( originator_id,\n :company_entry_description => company_entry_description,\n :file_sequence_id => file_sequence_id)\n end", "def obfuscate_header(header_name, value)\n obfuscation_rule = @obfuscation_rules[header_name.downcase]\n return obfuscation_rule.call(value) if obfuscation_rule\n value\n end", "def header(prev_header)\n Bitcoin.double_sha256(filter_hash.htb + prev_header.htb).bth\n end", "def delete(field)\n canonical = downcased(field)\n @headers.delete(canonical) if @headers.key?(canonical)\n end", "def dup\n h = super\n h.fields = @fields.dup\n h.mbox_from = @mbox_from\n h\n end", "def strip_header(h, iterator)\n if (h == nil or iterator == nil)\n return false\n end\n \n #Checks if input stream line = filter pattern, removes line if true.\n if (iterator.first =~ /#{h[\"val\"]}/)\n iterator.delete_at(0)\n end\n\n return iterator\n end", "def perform\n add_request_if_new do |request|\n request.header_set(*arguments)\n end\n end", "def set_header(header, value)\n @lunetas_headers[header.to_s] = value\n end", "def header=(value)\n @header = Mail::Header.new(value, charset)\n end", "def inject_headers!(obj)\n procid = obj[:options][:header]\n if procid && header_proc = header_procs[procid]\n data = userdata[obj.id]\n obj.trailing, trailing = nil, obj.trailing\n obj.message = header_proc.call(obj.message, data)\n obj.trailing = header_proc.call(trailing, data) if !trailing.to_s.empty?\n end\n end", "def redmine_headers(h)\n h.each { |k,v| headers[\"X-Redmine-#{k}\"] = v.to_s }\n end", "def exposed_header(headerName=nil)\n if headerName.class == String && !block_given?\n @j_del.java_method(:exposedHeader, [Java::java.lang.String.java_class]).call(headerName)\n return self\n end\n raise ArgumentError, \"Invalid arguments when calling exposed_header(headerName)\"\n end" ]
[ "0.58438814", "0.570026", "0.5621976", "0.5538187", "0.5445554", "0.5424213", "0.5383442", "0.5383442", "0.52315325", "0.51824534", "0.5180779", "0.5180779", "0.51400644", "0.5137547", "0.51194453", "0.5111889", "0.5104723", "0.50836056", "0.50598", "0.5037029", "0.50357723", "0.5035067", "0.5021088", "0.501158", "0.5009129", "0.50046754", "0.49989375", "0.49989375", "0.49952647", "0.49754825", "0.49718097", "0.4913598", "0.49095604", "0.4898991", "0.4893328", "0.48800462", "0.4861762", "0.48479107", "0.48433128", "0.48391834", "0.48255894", "0.4822684", "0.48104155", "0.4804569", "0.4799734", "0.4798123", "0.47939783", "0.4784443", "0.47770938", "0.47709468", "0.47593513", "0.4738382", "0.47300175", "0.47248617", "0.4714342", "0.47136918", "0.47105768", "0.47090232", "0.4704211", "0.46970895", "0.46887082", "0.46876472", "0.46854773", "0.46791667", "0.467621", "0.4674975", "0.46717924", "0.46702594", "0.46592492", "0.46585968", "0.4656434", "0.4643629", "0.46306303", "0.46280324", "0.46274528", "0.46186855", "0.46186855", "0.46186855", "0.46122852", "0.4602772", "0.46017587", "0.45969725", "0.45961294", "0.45930782", "0.45926332", "0.45899886", "0.45899886", "0.458978", "0.4581421", "0.45723152", "0.45628023", "0.45617944", "0.45538434", "0.45532745", "0.45457914", "0.4542071", "0.45412767", "0.45356968", "0.45325157", "0.45284015" ]
0.7295121
0
Convert the column value
def convert_column(column, index) call_column_builder(@converter, column, index)&.to_sym end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def column_value_integer\n column_value.to_i.to_s\n end", "def convert(value) value end", "def type_cast(value)\r\n @column_definition.type_cast(value)\r\n end", "def convert_value(value)\n value\n end", "def cast_data_for_column(data, col)\n if !@columns\n raise \"need to fetch columns but in a query\"\n end\n\n case @columns[col][:type]\n when /boolean/i\n return data == true ? 1 : 0\n when /datetime/i\n return (data == nil ? nil : data.to_i)\n when /integer/i\n return (data == nil ? nil : data.to_i)\n else\n return data\n end\n end", "def convert(column_name, value)\n return value unless value.is_a?(String)\n column_charset = @columns_charset[column_name]\n if column_charset\n converter = @converters[column_charset]\n converter.convert(value)\n elsif @charset\n converter = @converters[@charset]\n converter.convert(value)\n else\n value\n end\n end", "def column_value\n row.fetch(column){row[@column.to_s]}\n end", "def convert_value(value, column_options)\n if column_options\n case column_options[:type]\n when 'Number'\n return value.to_i\n end\n end\n\n value\n end", "def cast_value\n value.mongoize\n end", "def convert_cell(value, coltype)\n case coltype\n when \"boolean\"\n value ? 'true' : 'false'\n when \"number\"\n value.to_i\n when \"string\"\n value\n when \"date\"\n DataDate.new(Date.parse(value))\n when \"datetime\"\n DataDateTime.new(DateTime.parse(value))\n when \"timeofday\"\n [ value.hour, value.min, value.sec, value.usec / 1000 ]\n end\n end", "def convert_cell(column,xlsx,nrow,ncol)\n d = xlsx.cell(nrow,ncol)\n type = column['type'] || 'string'\n case type\n when 'long'\n d.to_i\n when 'double'\n d.to_f\n when 'string'\n d.to_s\n when 'timestamp'\n convert_time(d)\n else # TODO\n d.to_s\n end\n end", "def column_value_decimal\n column_value.to_f.to_s\n end", "def quote_value(col)\n case column_detail(col).data_type\n when 'CHAR', 'VARCHAR2', 'CLOB', 'RAW'\n \"'#{@column_values[col]}'\"\n when 'DATE', 'DATETIME'\n \"to_date('#{@column_values[col].strftime('%Y%m%d %H:%M:%S')}', 'YYYYMMDD HH24:MI:SS')\"\n else\n @column_values[col].to_s\n end\n end", "def typecast_value(column, value)\n return value unless typecast_on_assignment && db_schema && (col_schema = db_schema[column])\n value = nil if '' == value and typecast_empty_string_to_nil and col_schema[:type] and ![:string, :blob].include?(col_schema[:type])\n raise(InvalidValue, \"nil/NULL is not allowed for the #{column} column\") if raise_on_typecast_failure && value.nil? && (col_schema[:allow_null] == false)\n begin\n model.db.typecast_value(col_schema[:type], value)\n rescue InvalidValue\n raise_on_typecast_failure ? raise : value\n end\n end", "def typecast_value(column, value)\n return value unless typecast_on_assignment && db_schema && (col_schema = db_schema[column])\n value = nil if '' == value and typecast_empty_string_to_nil and col_schema[:type] and ![:string, :blob].include?(col_schema[:type])\n raise(InvalidValue, \"nil/NULL is not allowed for the #{column} column\") if raise_on_typecast_failure && value.nil? && (col_schema[:allow_null] == false)\n begin\n model.db.typecast_value(col_schema[:type], value)\n rescue InvalidValue\n raise_on_typecast_failure ? raise : value\n end\n end", "def cast_value(value)\n value\n end", "def cast_value(value) # :doc:\n value\n end", "def value_column\n case value_type\n when 'integer' then 'value_integer'\n when 'float' then 'value_float'\n when 'string' then 'value_string'\n else raise_invalid_type\n end\n end", "def column_value(rec, drawer)\n if (enum = drawer.vc.get_enum(rec.class, @ar_column_info))\n drawer.vc.draw_column_enum(rec, @ar_column_info, enum)\n else\n case @ar_column_info.type\n when :datetime\n drawer.vc.datetime_fmt(rec.send(name))\n when :date\n drawer.vc.date_fmt(rec.send(name))\n when :integer\n rec.send(name).to_s\n when :boolean\n rec.send(name) ? '√' : ''\n else\n # NOTE: rec.send(col.name) is not used since sssn.send(:data)\n # becomes hash rather than actual string-data so that following\n # split() fails for Hash.\n if str = rec.attributes[name]\n draw_trimmed_str(str)\n else\n ''\n end\n end\n end\n end", "def uncast_data_from_column(data, col)\n if !@columns\n raise \"need to fetch columns but in a query\"\n end\n\n case @columns[col][:type]\n when /boolean/i\n return (data >= 1)\n when /datetime/i\n return (data == nil ? nil : Time.at(data.to_i))\n when /integer/i\n return (data == nil ? nil : data.to_i)\n else\n return data\n end\n end", "def typecast_value(column, value)\n return value unless typecast_on_assignment && db_schema && (col_schema = db_schema[column]) && !model.serialized?(column)\n value = nil if value == '' and typecast_empty_string_to_nil and col_schema[:type] and ![:string, :blob].include?(col_schema[:type])\n raise(Error::InvalidValue, \"nil/NULL is not allowed for the #{column} column\") if raise_on_typecast_failure && value.nil? && (col_schema[:allow_null] == false)\n begin\n model.db.typecast_value(col_schema[:type], value)\n rescue Error::InvalidValue\n if raise_on_typecast_failure\n raise\n else\n value\n end\n end\n end", "def converted_value\n if @converter\n @converter.call(@value)\n else\n @value\n end\n end", "def cast(value)\n value\n end", "def column_value_string\n \"'#{column_value}'\"\n end", "def typecast_value(column_type, value)\n return nil if value.nil?\n case column_type\n when :integer\n Integer(value)\n when :string\n value.to_s\n when :float\n Float(value)\n when :decimal\n case value\n when BigDecimal\n value\n when String, Float\n value.to_d\n when Integer\n value.to_s.to_d\n else\n raise ArgumentError, \"invalid value for BigDecimal: #{value.inspect}\"\n end\n when :boolean\n case value\n when false, 0, \"0\", /\\Af(alse)?\\z/i\n false\n else\n value.blank? ? nil : true\n end\n when :date\n case value\n when Date\n value\n when DateTime, Time\n Date.new(value.year, value.month, value.day)\n when String\n value.to_date\n else\n raise ArgumentError, \"invalid value for Date: #{value.inspect}\"\n end\n when :time\n case value\n when Time\n value\n when String\n value.to_time\n else\n raise ArgumentError, \"invalid value for Time: #{value.inspect}\"\n end\n when :datetime\n raise(ArgumentError, \"invalid value for #{tc}: #{value.inspect}\") unless value.is_one_of?(DateTime, Date, Time, String)\n if Sequel.datetime_class === value\n # Already the correct class, no need to convert\n value\n else\n # First convert it to standard ISO 8601 time, then\n # parse that string using the time class.\n (Time === value ? value.iso8601 : value.to_s).to_sequel_time\n end\n else\n value\n end\n end", "def cast_value(value) # :api: public\n value\n end", "def col1=(col1)\n self[:col1] = col1.to_s.gsub(\",\", \".\").to_f\n end", "def convert_value(value)\n value.to_s\n end", "def dbms_type_cast(columns, values)\n int_column = {}\n columns.each_with_index do |c, i|\n int_column[i] = c.type == 3 && c.scale == 0\n end\n\n float_column = {}\n columns.each_with_index do |c, i|\n float_column[i] = c.type == 3 && c.scale != 0\n end\n\n values.each do |row|\n row.each_index do |idx|\n val = row[idx]\n if val\n if int_column[idx]\n row[idx] = val.to_i\n elsif float_column[idx]\n row[idx] = val.to_f\n elsif val.is_a?(String)\n row[idx] = val.force_encoding('UTF-8')\n end\n end\n end\n end\n end", "def value\n @casted_value ||= type_cast_value(@value)\n end", "def map_value(column_type)\n case column_type\n when :datetime then :timestamp\n when :json then :string\n else column_type\n end\n end", "def typecast(value)\n value\n end", "def convert(value) \n return value.to_formatted_s(:db) if value.respond_to?(:to_formatted_s)\n value.to_s\n end", "def make_val(row_value, column_type)\n val = row_value\n if (row_value.nil?)\n val = 'NULL'\n else\n if (column_type == 'varchar' || column_type == 'text' || column_type == 'blob')\n val = \"'#{ Mysql2::Client.escape(row_value) }'\"\n elsif (column_type == 'datetime')\n # datetime values come back like '2014-12-25 11:11:11 -0500' and we want to remove the timezone offset\n val = \"'#{/(\\S* \\S*) .*/.match(val.to_s)[1]}'\"\n end\n end\n val\n end", "def deserialize_value(column, value)\n value\n end", "def to_s\n column\n end", "def typecast(value)\n value\n end", "def process_row(row)\n row.to_s\n end", "def value_transform value, type\n return nil if value.nil? || value.to_s.size == 0\n case type\n when :integer then value.to_i\n when :autoincrement then value.to_i\n when :string then value.to_s\n when :float then value.to_f\n when :bool then value.to_s\n when :symbol then value.to_s\n when :marshal then Marshal.dump(value)\n when :array then Yajl::Encoder.encode(value)\n when :hash then Yajl::Encoder.encode(value)\n when :time then Time.parse(value.to_s).strftime(\"%Y.%m.%d %H:%M:%S\")\n when :date then Date.parse(value.to_s).strftime(\"%Y-%m-%d\")\n else value\n end\n end", "def value\n val = @value\n if format_as_date?(val)\n val = Xl::DateHelper.excel_to_ruby(val)\n end\n val\n end", "def poi_cell_value(data)\n case data\n when BigDecimal\n data.to_f\n when Numeric, TrueClass, FalseClass\n data\n else\n data.to_s\n end\n end", "def convert_value(value_node)\n if value_node.nil?\n return\n end\n if value_node['type'] == 'REAL' || value_node['value'].include?('.')\n return value_node['value'].to_f\n else\n return value_node['value'].to_i\n end\n end", "def column_value(key)\n # ensure the requested column is in the table\n column_detail(key)\n @column_values[key.to_s.upcase]\n end", "def value\n self.send :\"#{_mapped_value_column}\"\n end", "def quoted_value(options = {}) \n options = normalize_options(options)\n col = find_column(@column,options)\n return ActiveRecord::Base.quote_value(value) unless col \n return ActiveRecord::Base.quote_value(col.type_cast(value)) if col.number?\n return ActiveRecord::Base.quote_value(value)\n end", "def dbms_type_cast(columns, rows)\n # Cast the values to the correct type\n columns.each_with_index do |column, col_index|\n #puts \" #{column.name} type #{column.type} length #{column.length} nullable #{column.nullable} scale #{column.scale} precision #{column.precision} searchable #{column.searchable} unsigned #{column.unsigned}\"\n rows.each do |row|\n value = row[col_index]\n\n new_value = case\n when value.nil?\n nil\n when [ODBC::SQL_CHAR, ODBC::SQL_VARCHAR, ODBC::SQL_LONGVARCHAR].include?(column.type)\n # Do nothing, because the data defaults to strings\n # This also covers null values, as they are VARCHARs of length 0\n value.is_a?(String) ? value.force_encoding(\"UTF-8\") : value\n when [ODBC::SQL_DECIMAL, ODBC::SQL_NUMERIC].include?(column.type)\n column.scale == 0 ? value.to_i : value.to_f\n when [ODBC::SQL_REAL, ODBC::SQL_FLOAT, ODBC::SQL_DOUBLE].include?(column.type)\n value.to_f\n when [ODBC::SQL_INTEGER, ODBC::SQL_SMALLINT, ODBC::SQL_TINYINT, ODBC::SQL_BIGINT].include?(column.type)\n value.to_i\n when [ODBC::SQL_BIT].include?(column.type)\n value == 1\n when [ODBC::SQL_DATE, ODBC::SQL_TYPE_DATE].include?(column.type)\n value.to_date\n when [ODBC::SQL_TIME, ODBC::SQL_TYPE_TIME].include?(column.type)\n value.to_time\n when [ODBC::SQL_DATETIME, ODBC::SQL_TIMESTAMP, ODBC::SQL_TYPE_TIMESTAMP].include?(column.type)\n value.to_datetime\n # when [\"ARRAY\"?, \"OBJECT\"?, \"VARIANT\"?].include?(column.type)\n # TODO: \"ARRAY\", \"OBJECT\", \"VARIANT\" all return as VARCHAR\n # so we'd need to parse them to make them the correct type\n\n # As of now, we are just going to return the value as a string\n # and let the consumer handle it. In the future, we could handle\n # if here, but there's not a good way to tell what the type is\n # without trying to parse the value as JSON as see if it works\n # JSON.parse(value)\n when [ODBC::SQL_BINARY].include?(column.type)\n # These don't actually ever seem to return, even though they are\n # defined in the ODBC driver, but I left them in here just in case\n # so that future us can see what they should be\n value\n else\n # the use of @connection.types() results in a \"was not dropped before garbage collection\" warning.\n raise \"Unknown column type: #{column.type} #{@connection.types(column.type).first[0]}\"\n end\n\n row[col_index] = new_value\n end\n end\n rows\n end", "def value\n to_type(@value)\n end", "def clean_column_value(v)\r\n h(v)\r\n end", "def cast_attribute(value, type_name)\n case type_name\n when :integer then value.to_i\n when :float then value.to_f\n when :boolean then !!value\n else value\n end\n end", "def value_coercion(value); end", "def cast_value(value)\n case value_type\n when 'integer' then value.to_i\n when 'float' then value.to_f\n when 'string' then value.to_s\n else raise_invalid_type\n end\n end", "def transform_row(row)\n row\n end", "def transform(value)\n value\n end", "def cast_value(v)\r\n return nil if v.nil?\r\n if @type == :date\r\n self.style = STYLE_DATE if self.style == 0\r\n v\r\n elsif (@type == :time && v.is_a?(Time)) || (@type == :time && v.respond_to?(:to_time))\r\n self.style = STYLE_DATE if self.style == 0\r\n # one simple little fix. I DO NOT WANT TIME IN LOCAL TIME!\r\n unless v.is_a?(Time)\r\n v = v.respond_to?(:to_time) ? v.to_time : v\r\n end\r\n v\r\n elsif @type == :float\r\n v.to_f\r\n elsif @type == :integer\r\n v.to_i\r\n elsif @type == :boolean\r\n v ? 1 : 0\r\n elsif @type == :iso_8601\r\n #consumer is responsible for ensuring the iso_8601 format when specifying this type\r\n v\r\n else\r\n @type = :string\r\n # TODO find a better way to do this as it accounts for 30% of\r\n # processing time in benchmarking...\r\n Axlsx::trust_input ? v.to_s : ::CGI.escapeHTML(v.to_s)\r\n end\r\n end", "def column_as(col) #nodoc\n _col = column(col)\n _column_hashes.values.find{ |c| c.as == _col.name }\n end", "def normalize(column, value)\n column = column.to_s\n value = value.to_s\n\n if column.ends_with?('?') # Boolean\n truthy?(value)\n elsif column.ends_with?('_at') # DateTime\n parse_datetime(column, value)\n elsif column.ends_with?('_on') # Date\n parse_datetime(column, value).beginning_of_day\n elsif column.ends_with?('_to_i')\n value.to_i\n elsif column.ends_with?('_to_f')\n value.to_f\n elsif column.ends_with?('_to_s')\n value.to_s\n elsif column.ends_with?('_to_a')\n if ['[]', '{}'].include?(value)\n []\n elsif value.starts_with?('{') && value.ends_with?('}')\n YAML::load(value).keys.select { |str| str.to_s.present? }\n else\n YAML::load(value).to_a.select { |str| str.to_s.present? }\n end\n elsif column == 'id' || column.ends_with?('_id')\n value.present? ? value.to_i : nil\n else\n value.presence\n end\n end", "def [] column_number_or_name\n ole_cell = ole_table.Application.Intersect(\n @ole_tablerow.Range, ole_table.ListColumns.Item(column_number_or_name).Range)\n value = ole_cell.Value\n value.respond_to?(:gsub) ? value.encode('utf-8') : value\n rescue WIN32OLERuntimeError\n raise TableRowError, \"could not determine the value at column #{column_number_or_name}\\n#{$!.message}\"\n end", "def coerce(value)\n value\n end", "def value\n @value ||= values_for columns\n end", "def single_value(row)\n row.values.at(0)\n end", "def value\n Native(val)\n end", "def [] column_number_or_name\n column_number_or_name = column_number_or_name.to_s if column_number_or_name.is_a?(Symbol)\n ole_cell = ole_table.Application.Intersect(\n @ole_tablerow.Range, ole_table.ListColumns.Item(column_number_or_name).Range)\n value = ole_cell.Value\n value.respond_to?(:gsub) ? value.encode('utf-8') : value\n rescue WIN32OLERuntimeError\n raise TableRowError, \"could not determine the value at column #{column_number_or_name}\\n#{$!.message}\"\n end", "def value_for(value)\n return value.to_s(:db) if value.kind_of?(Time) \n return value.to_s(:db) if value.kind_of?(Date)\n return value.to_s\n end", "def column_value(rec, drawer)\n rec.inspect\n end", "def convert\n end", "def convert\n end", "def real_column; end", "def _convert_value(val)\n v = case val\n when :nil then nil\n when :false then false\n when :true then true\n else\n val\n end\n v\n end", "def raw_cast(value)\n # We can strip value here but we do not want to squish it unless for number\n value = value.to_s.strip\n return nil if value.empty?\n\n case data_type\n when 'number'\n BigDecimal(remove_decimal_mark(value.squish))\n when 'date'\n # date_format likely will be '%m/%d/%Y', but if we got '19/8/2014',\n # then `strptime` will raise invalid date error\n # Sometimes we can get '27/11 /1981' also :(\n begin\n Date.strptime(value, @resultset.date_format)\n rescue StandardError\n # We could be getting back these date:\n # '17.12.95', '19/05/99', '27/11 /1981'\n # '1959-07-03' will be beyond us, so consider returning exact value\n value = value.gsub(/-|\\./, '/')\n split = value.split('/').map(&:strip)\n split[2] = \"19#{split[2]}\" if split[2].size == 2\n value = split.join('/')\n\n Date.strptime(\n Date.parse(value)\n .strftime(@resultset.date_format), @resultset.date_format\n )\n end\n when 'time'\n DateTime.strptime(\"1/1/-4712 #{value}\", @resultset.timestamp_format)\n when 'timestamp'\n DateTime.strptime(value, @resultset.timestamp_format)\n when 'container'\n # container may return value that include URI scheme already\n return URI.parse(value) if value.start_with?('http')\n URI.parse(\"#{@resultset.server.url}#{value}\")\n else\n value\n end\n rescue StandardError => e\n warn \"Could not coerce #{name}: #{value} due to #{e.message.force_encoding(\"UTF-8\")}\"\n value\n end", "def correct_format_for_values\n self.value.to_i\n end", "def untypecasted_value\n read_attribute(:value)\n end", "def convert_row(row)\n return nil if row.nil?\n row.collect do |col|\n if col.is_a? ::ODBC::Date\n DBI::Date.new(col.year, col.month, col.day)\n elsif col.is_a? ::ODBC::Time\n DBI::Time.new(col.hour, col.minute, col.second)\n elsif col.is_a? ::ODBC::TimeStamp\n DBI::Timestamp.new(col.year, col.month, col.day,\n col.hour, col.minute, col.second, col.fraction)\n else\n col\n end\n end\n end", "def coerce(x)\n return x.coerce(self.value)\n end", "def convert_attribute_value obj\n case obj\n when OpenCensus::Trace::TruncatableString\n TraceProtos::AttributeValue.new \\\n string_value: convert_truncatable_string(obj)\n when Integer\n TraceProtos::AttributeValue.new int_value: obj\n when true, false\n TraceProtos::AttributeValue.new bool_value: obj\n end\n end", "def column_value_boolean\n case Utilities.adapter\n when 'mysql2', 'postgresql'\n column_value ? \"true\" : \"false\"\n when 'sqlite3', 'sqlserver'\n column_value ? \"1\" : \"0\"\n end\n end", "def transmogrified_value\n case param.field.options[:value_transmogrification]\n when :chronic\n Chronic.parse(value, :context => :past)\n when :chronic_date\n v = Chronic.parse(value, :context => :past)\n v ? v.to_date : nil\n when :upcase\n value.upcase\n when :downcase\n value.downcase\n else\n value\n end\n end", "def get_value_for_column(column, model, options = {})\n options.reverse_merge!(:limit => 400)\n\n value = Util.custom_value_for_column(column, model)\n\n if column.is_a?(String)\n value\n elsif column.type == :datetime\n value.strftime('%d-%B-%Y %H:%M:%S %p') unless value.blank?\n elsif column.type == :string || column.type == :text\n value = value.inspect if model.class.serialized_attributes.keys.include?(column.name)\n return value if options[:limit].blank?\n begin\n truncate(value,:length => options[:limit])\n rescue # truncate method failed\n '<actual data is not being shown because truncate method failed.>'\n end\n else\n value.to_s\n end\n end", "def value\n _, _, type = @table.lookup_schema(cq)\n Util.from_bytes(type, raw)\n end", "def value\n dt = raw_value\n return nil if dt.nil? || dt.values.all?(&:blank?)\n\n dt[\"raw_value\"].nil? ? new_style_value_text_repr(dt) : old_style_value_text_repr(dt)\n end", "def convert_value_to_text value, crow\n case value\n when TrueClass, FalseClass\n value\n else\n value.to_s if value\n end\n end", "def convert_value_to_text value, crow\n case value\n when TrueClass, FalseClass\n value\n else\n value.to_s if value\n end\n end", "def get_value(column)\n if value = setted_columns[column.name.to_sym]\n value\n end\n end", "def setcolumntovalue(column,value)\n @filearray.each do |line|\n unless line.first =~ /\\D(.*)/\n line[column] = value\n end\n end\n end", "def type_cast_for_schema(value)\n cast(value).value.inspect\n end", "def map_values(row, columns)\n values = columns.map do |v|\n # TODO - stw - which other cases do we need to handle?\n case v[1]\n when /int/: \n row[v[0]] || 'NULL'\n else \n (row[v[0]].nil? ? 'NULL' : \"'\" + @db1.escape_string(row[v[0]].to_s) + \"'\")\n end\n end\n values = values.join(',') \n end", "def convert_to_object_value(dynamo_value); dynamo_value; end", "def convert(t, dtype)\n dtype.each do |col, type|\n if type == Integer \n t[col] = t[col].map{|v| v.to_i unless v.nil?}\n elsif type == Float\n t[col] = t[col].map{|v| v.to_f unless v.nil?}\n elsif type == String\n t[col] = t[col].map{|v| v.to_s unless v.nil?}\n elsif type == DateTime\n t[col] = t[col].map do |dt|\n begin\n DateTime.parse dt.to_s\n rescue => exception\n end\n end\n elsif type == Date\n t[col] = t[col].map do |dt|\n begin\n Date.parse dt.to_s\n rescue => exception\n end\n end\n else\n throw \"Unsupported dtype '#{type}'\"\n end\n end\n end", "def [](row, col)\n val = @vals[row * @col_count + col]\n val && val.length > 0 && cell_type(row, col) == GRID_TYPE_DATA ? val.to_f : val\n end", "def to_column\n if ndim != 1\n raise \"ndim should be 1\"\n end\n return self[:%,1]\n end", "def serialize_value(column, v)\n return v if v.nil?\n case model.serialization_map[column] \n when :marshal\n [Marshal.dump(v)].pack('m')\n when :yaml\n v.to_yaml\n when :json\n JSON.generate v\n else\n raise Error, \"Bad serialization format (#{model.serialization_map[column].inspect}) for column #{column.inspect}\"\n end\n end", "def convert_after_read(value)\n sequel_json_column? ? value.to_hash : super\n end", "def normalize( value )\n value\n end", "def cast(data_type)\n case data_type\n when String\n new_jcolumn = jcolumn.cast(data_type)\n when DataType\n jdata_type = JDataType.fromJson(data_type.json)\n new_jcolumn = jcolumn.cast(jdata_type)\n else\n raise ArgumentError, \"Unsupported type: #{data_type.class}\"\n end\n\n Column.new(new_jcolumn)\n end", "def column_data(column)\n attributes[column.to_s]\n end", "def convert_to_type(val)\n case type\n when 'NilClass'\n if val != false && val.blank?\n # Leave the type of the Column open. Unfortunately, false counts as\n # blank and we don't want it to. It should be classified as a boolean.\n new_val = nil\n else\n # Only non-blank values are allowed to set the type of the Column\n bool_val = convert_to_boolean(val)\n new_val =\n if bool_val.nil?\n convert_to_date_time(val) ||\n convert_to_numeric(val) ||\n convert_to_string(val)\n else\n bool_val\n end\n @type =\n if [true, false].include?(new_val)\n 'Boolean'\n elsif new_val.is_a?(Date) || new_val.is_a?(DateTime)\n 'DateTime'\n elsif new_val.is_a?(Numeric)\n 'Numeric'\n elsif new_val.is_a?(String)\n 'String'\n else\n msg = \"can't add #{val} of type #{new_val.class.name} to a column\"\n raise UserError, msg\n end\n end\n new_val\n when 'Boolean'\n if val.is_a?(String) && val.blank? || val.nil?\n nil\n else\n new_val = convert_to_boolean(val)\n if new_val.nil?\n msg = \"attempt to add '#{val}' to a column already typed as #{type}\"\n raise UserError, msg\n end\n new_val\n end\n when 'DateTime'\n if val.blank?\n nil\n else\n new_val = convert_to_date_time(val)\n if new_val.nil?\n msg = \"attempt to add '#{val}' to a column already typed as #{type}\"\n raise UserError, msg\n end\n new_val\n end\n when 'Numeric'\n if val.blank?\n nil\n else\n new_val = convert_to_numeric(val)\n if new_val.nil?\n msg = \"attempt to add '#{val}' to a column already typed as #{type}\"\n raise UserError, msg\n end\n new_val\n end\n when 'String'\n if val.nil?\n nil\n else\n new_val = convert_to_string(val)\n if new_val.nil?\n msg = \"attempt to add '#{val}' to a column already typed as #{type}\"\n raise UserError, msg\n end\n new_val\n end\n else\n raise UserError, \"Mysteriously, column has unknown type '#{type}'\"\n end\n end", "def quote(value, column = nil)\n case value\n when String, ActiveSupport::Multibyte::Chars\n value_S = value.to_s\n if column && column.type == :binary && column.class.respond_to?(:string_to_binary)\n \"'#{column.class.string_to_binary(value_S)}'\"\n else\n super(value, column)\n end\n else\n super(value, column)\n end\n end", "def change_column_value(column, value)\n cc = changed_columns\n cc << column unless cc.include?(column)\n @values[column] = value\n end", "def change_column_value(column, value)\n cc = changed_columns\n cc << column unless cc.include?(column)\n @values[column] = value\n end", "def column_values(column)\r\n assert_exists\r\n arr_rows = rows\r\n values = Array.new(arr_rows.length)\r\n for i in 0..arr_rows.length - 1 do\r\n values[i] = arr_rows[i][column].to_s \r\n end\r\n return values\r\n end", "def string cols\n decode_values :string, cols\n end" ]
[ "0.7294168", "0.72879297", "0.72515434", "0.7099538", "0.7083919", "0.70775443", "0.6964401", "0.69609904", "0.68678087", "0.6825429", "0.68066067", "0.6774276", "0.67143184", "0.66575456", "0.66575456", "0.6636447", "0.66151816", "0.66100556", "0.6604895", "0.6576841", "0.65448505", "0.65238684", "0.64818597", "0.6472831", "0.6449788", "0.6430285", "0.6424147", "0.64164263", "0.6387964", "0.63837904", "0.62918", "0.62889874", "0.6249391", "0.624615", "0.6239957", "0.6236507", "0.6217084", "0.61797005", "0.61729157", "0.6169865", "0.6152542", "0.6108915", "0.6096539", "0.6083759", "0.6056737", "0.60560167", "0.6015702", "0.5995312", "0.5964747", "0.5949286", "0.5936474", "0.5921377", "0.5921347", "0.59186375", "0.5901411", "0.58974993", "0.5863796", "0.5863549", "0.5830047", "0.582171", "0.5819157", "0.5792209", "0.576247", "0.5747133", "0.57427484", "0.57427484", "0.57328045", "0.57153654", "0.5712685", "0.57000846", "0.5689242", "0.5678326", "0.5677038", "0.56677645", "0.5659887", "0.56448835", "0.5640819", "0.5634386", "0.5633212", "0.56320834", "0.56320834", "0.5630229", "0.5629037", "0.5624288", "0.56236786", "0.56182295", "0.56143564", "0.5608993", "0.56023484", "0.5597087", "0.5594356", "0.5593643", "0.55896115", "0.5589161", "0.5574932", "0.55681646", "0.55640024", "0.55640024", "0.5558008", "0.5557165" ]
0.656976
20
Returns the callable object method arity
def callable_arity(callable) # procs and lambdas respond to #arity return callable.arity if callable.respond_to?(:arity) callable.method(:call).arity end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def arity\n method(:call).arity\n end", "def arity_of(callable)\n callable.respond_to?(:arity) ? callable.arity : callable.method(:call).arity\n end", "def arity\n parameters.size\n end", "def arity() end", "def arity() end", "def arity(*) end", "def arity; end", "def arity\n\t\t\tif @arity.nil?\n\t\t\t\t@arity = method.parameters.count{|type, name| type == :req}\n\t\t\tend\n\t\t\t\n\t\t\treturn @arity\n\t\tend", "def arity\n @block ? @block.arity : 0\n end", "def arity\n @block ? @block.arity : 0\n end", "def arity; 2; end", "def max_arity\n method.arity < 0 ? INFINITY : method.arity\n end", "def real_arity(fun)\n fun.arity\n end", "def _define_roda_method_arg_numbers(callable)\n optional_args = 0\n rest = false\n keyword = false\n callable.parameters.map(&:first).each do |arg_type, _|\n case arg_type\n when :opt\n optional_args += 1\n when :rest\n rest = true\n when :keyreq\n keyword = :required\n when :key, :keyrest\n keyword ||= true\n end\n end\n arity = callable.arity\n if arity < 0\n arity = arity.abs - 1\n end\n required_args = arity\n arity -= 1 if keyword == :required\n\n if callable.is_a?(Proc) && !callable.lambda?\n optional_args -= arity\n end\n\n [required_args, optional_args, rest, keyword]\n end", "def arity\n node = @kids.max {|n,m| n.arity <=> m.arity }\n node.arity\n end", "def arity\n -1\n end", "def test_callable_arity(callable, arity, optional=true)\n return true if callable.nil?\n return true if optional && !callable.respond_to?(:call)\n return callable.respond_to?(:arity) && (callable.arity == arity)\n end", "def test_callable_arity(callable, arity, optional=true)\n return true if callable.nil?\n return true if optional && !callable.respond_to?(:call)\n return callable.respond_to?(:arity) && (callable.arity == arity)\n end", "def test_Method_InstanceMethods_arity\n\t\tc = C.new\n\t\tassert_equal(0, c.method(:one).arity)\n\t\tassert_equal(1, c.method(:two).arity)\n\t\tassert_equal(-1, c.method(:three).arity)\n\t\tassert_equal(2, c.method(:four).arity)\n\t\tassert_equal(-3, c.method(:five).arity)\n\t\tassert_equal(-3, c.method(:six).arity)\n\n\t\t# other assertion\n\t\tassert_equal(0, \"cat\".method(:size).arity)\n\t\tassert_equal(1, \"cat\".method(:replace).arity)\n\t\tassert_equal(-1, \"cat\".method(:squeeze).arity)\n\t\tassert_equal(-1, \"cat\".method(:count).arity)\n\tend", "def check_arity(obj, n_args)\n ary = obj.arity\n\n if ary >= 0\n n_args == ary\n else\n n_args >= (ary+1).abs \n end\n end", "def arity?(value)\n true\n end", "def arity\n nil\n end", "def arity\n @source.scan('*').count + 1\n end", "def arity_checks\n return @arity_checks if @arity_checks\n\n arity = args.size - 1\n arity -= (opt_args.size)\n\n arity -= 1 if rest_arg\n\n arity -= (keyword_args.size)\n\n arity = -arity - 1 if !opt_args.empty? or !keyword_args.empty? or rest_arg\n\n # $arity will point to our received arguments count\n aritycode = \"var $arity = arguments.length;\"\n\n @arity_checks = []\n\n if arity < 0 # splat or opt args\n min_arity = -(arity + 1)\n max_arity = args.size - 1\n @arity_checks << \"$arity < #{min_arity}\" if min_arity > 0\n @arity_checks << \"$arity > #{max_arity}\" if max_arity and not(rest_arg)\n else\n @arity_checks << \"$arity !== #{arity}\"\n end\n\n @arity_checks\n end", "def arity_check(args, opt, splat, kwargs, block_name, mid)\n meth = mid.to_s.inspect\n\n arity = args.size - 1\n arity -= (opt.size)\n\n arity -= 1 if splat\n\n arity -= (kwargs.size)\n\n arity -= 1 if block_name\n arity = -arity - 1 if !opt.empty? or !kwargs.empty? or splat\n\n # $arity will point to our received arguments count\n aritycode = \"var $arity = arguments.length;\"\n\n if arity < 0 # splat or opt args\n aritycode + \"if ($arity < #{-(arity + 1)}) { Opal.ac($arity, #{arity}, this, #{meth}); }\"\n else\n aritycode + \"if ($arity !== #{arity}) { Opal.ac($arity, #{arity}, this, #{meth}); }\"\n end\n end", "def length; @args.length end", "def getExecuteArity\n return 6\n end", "def length\n @args.length\n end", "def length\n @operands.length\n end", "def rest_arity\n rest_identity_map.keys.count\n end", "def length=(_arg0); end", "def arity=(value)\n end", "def arity\n @write ? 1 : 0\n end", "def constructor_arity(klass)\n klass.allocate.method(:initialize).arity\nend", "def sizeOf _args\n \"sizeOf _args;\" \n end", "def number_of_arguments(method_sexp)\n arguments = method_sexp[2]\n arguments = arguments[1] if arguments.first == :paren\n\n arguments[1] == nil ? 0 : arguments[1].size\n end", "def acceptable_argument_count\n parameters = @object.method(@method).parameters\n min_args = parameters.select{ |arg| arg[0] == :req }.count\n if parameters.any? { |arg| arg[0] == :rest }\n max_args = Float::INFINITY\n else\n max_args = parameters.count\n end\n (min_args..max_args)\n end", "def size(*args); end", "def arity_check(args, opt, splat, block_name, mid)\n meth = mid.to_s.inspect\n\n arity = args.size - 1\n arity -= (opt.size - 1) if opt\n arity -= 1 if splat\n arity = -arity - 1 if opt or splat\n\n # $arity will point to our received arguments count\n aritycode = \"var $arity = arguments.length;\"\n\n if arity < 0 # splat or opt args\n aritycode + \"if ($arity < #{-(arity + 1)}) { $opal.ac($arity, #{arity}, this, #{meth}); }\"\n else\n aritycode + \"if ($arity !== #{arity}) { $opal.ac($arity, #{arity}, this, #{meth}); }\"\n end\n end", "def xxxtest_overloaded_functions\r\n length = initialize_length(\r\n <<-EOD\r\n void fun1(integer arg) {\r\n i = i++;\r\n }\r\n void fun1(string arg)\r\n {\r\n int i = 0;\r\n if (i == 0) {\r\n printf(\"Hello Zero\");\r\n }\r\n }\r\n EOD\r\n )\r\n function_length = length.counts\r\n assert_equal(7, function_length[\"fun1\"])\r\n end", "def arg_size; end", "def arity_based &block\n block.arity == 0 ? proc { |obj| obj.instance_eval &block }\n : block\n end", "def getExecuteArity\n return 2\n end", "def size\n C.LLVMCountParams(@fun)\n end", "def countType _obj, _args\n \"_obj countType _args;\" \n end", "def countSide _obj, _args\n \"_obj countSide _args;\" \n end", "def size \n if @map.empty?\n return 0\n else \n _max_arity\n end\n end", "def size=(_arg0); end", "def size=(_arg0); end", "def how_many_args *args\n args.count\nend", "def how_many_args *args\n args.length\nend", "def how_many_args *args\n args.length\n # accepts any number of arguments without complaint\n # returns the total number of arguments passed to the function\n # Hint: google ruby *args\nend", "def longest_method(obj)\n sorted_method_lengths = obj.methods.sort_by {|method_name| method_name.length}\n p sorted_method_lengths[-1]\nend", "def how_many_args(*args)\n args.length\nend", "def size\n @args.size + 1\n end", "def how_many_args(*args)\n args.count\nend", "def num_parameters\n @parameters.size\n end", "def length(array)\n puts \"NOT IMPLEMENTED\"\nend", "def count_ops()\n 0\n end", "def length_out(obj)\n puts obj.length\nend", "def countFriendly _obj, _args\n \"_obj countFriendly _args;\" \n end", "def how_many_args(*arg)\n arg.length\nend", "def length()\n #This is a stub, used for indexing\n end", "def instance_positional_args_counter\n @instance_positional_args_counter || 0\n end", "def length()\n obj_len = internal_object_length - 1\n return obj_len\n end", "def length(*) end", "def length(*) end", "def count=(_arg0); end", "def size\n 1 + params_size\n end", "def inspect\n return \"#<#{@name}:#{@arity}>\"\n end", "def blk_length(arg)\n case arg\n when :mifare\n 16\n when :ntag\n 4\n when ->(b) { b.is_a?(Integer) }\n arg\n end\n end", "def length\n if !block_given?\n return @j_del.java_method(:length, []).call()\n end\n raise ArgumentError, \"Invalid arguments when calling length()\"\n end", "def length=(_); end", "def size\n C.LLVMGetNumOperands(@user)\n end", "def max_args\n @max_args || -1\n end", "def length(array)\n raise NotImplementedError\nend", "def length; end", "def length; end", "def length; end", "def length; end", "def length; end", "def length; end", "def length; end", "def longest_method(obj)\n obj.methods.sort_by(&:length).last\nend", "def num_listeners\n _events.values.inject(0){|acc, evt| acc + evt.callables.size}\n end", "def how_many_args(*args)\n\targs.length\nend", "def how_many_args(*args)\n args.count\n end", "def countUnknown _obj, _args\n \"_obj countUnknown _args;\" \n end", "def length\n end", "def length\n end", "def length\n end", "def length\n end", "def length\n end", "def length\n end", "def length()\n #This is a stub, used for indexing\n end", "def size=(_); end", "def size=(_); end", "def length\n raise Error::UnsupportedOperation, \"Method Curve#length not defined.\"\n end", "def instance_one_positional_arg_counter\n @instance_one_positional_arg_counter || 0\n end", "def instance_no_args_counter\n @instance_no_args_counter || 0\n end" ]
[ "0.84352565", "0.8376057", "0.75807655", "0.7550849", "0.7550849", "0.7388655", "0.73434234", "0.7259076", "0.69007945", "0.69007945", "0.68266517", "0.67134", "0.66885746", "0.66176265", "0.6601301", "0.6600234", "0.64902705", "0.64902705", "0.6454412", "0.6438279", "0.6348498", "0.63318384", "0.6324789", "0.6314254", "0.6239034", "0.62347615", "0.6133418", "0.61003184", "0.6056235", "0.605477", "0.60046005", "0.6000184", "0.5983903", "0.598178", "0.5980312", "0.5977345", "0.59751993", "0.59473145", "0.59459656", "0.5914674", "0.5902475", "0.5898699", "0.587073", "0.5849696", "0.57476646", "0.57459474", "0.5736743", "0.5666066", "0.5666066", "0.5631061", "0.5617674", "0.5564943", "0.55607694", "0.5550849", "0.55455375", "0.55448383", "0.5539924", "0.5534164", "0.5511092", "0.5497348", "0.54960275", "0.5469565", "0.54664695", "0.5427926", "0.54238623", "0.5395071", "0.5395071", "0.5394412", "0.5389763", "0.5378766", "0.5354832", "0.53514344", "0.53481007", "0.5336533", "0.5315903", "0.5308856", "0.5302011", "0.5302011", "0.5302011", "0.5302011", "0.5302011", "0.5302011", "0.5302011", "0.52997184", "0.5297289", "0.5293637", "0.5292415", "0.52816176", "0.5281309", "0.5281309", "0.5281309", "0.5281309", "0.5281309", "0.5277474", "0.527494", "0.5236788", "0.5236788", "0.5231966", "0.5221616", "0.5218608" ]
0.7824977
2
until the levitation force is equal to 10, incrementing the levitation force by 1 each time we puts the phrase.
def using_until levitation_force= 6 until levitation_force == 10 do puts "Wingardium Leviosa" levitation_force += 1 end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def using_while\n\tlevitation_force = 6\n\twhile levitation_force < 10\n puts \"Wingardium Leviosa\"\n levitation_force += 1\n end\nend", "def using_until\n levitation_force = 6\n until levitation_force == 10\n puts \"Wingardium Leviosa\" \n levitation_force+= 1\n end\nend", "def using_until\n levitation_force = 6\n until levitation_force == 10 \n puts \"Wingardium Leviosa\"\n levitation_force += 1 \nend\nend", "def using_while\nlevitation_force = 6\nwhile levitation_force < 10\n puts \"Wingardium Leviosa\"\n levitation_force += 1\nend\nend", "def bottles_lyrics bottles\n while bottles != 0\n if bottles > 1\n puts \"#{bottles} bottles of beer on the wall, #{bottles} bottles of beer.\\nTake one down and pass it around, #{bottles - 1} bottles of beer on the wall.\\n\\n\"\n else\n puts \"No more bottles of beer on the wall, no more bottles of beer.\\nGo to the store and buy some more, #{bottles} bottles of beer on the wall.\\n\\n\"\n end\n bottles -= 1\n end\nend", "def hungry_person \n mango= 0\n until mango == 10\n puts \"Give me my mango! i only want #{mango}\"\n mango += 1\n end\n puts \"thank you\"\nend", "def spell(n)\n result = \"\"\n remaining = n\n \n while (remaining > 0) \n result.insert(0, lookup(remaining % 10).concat(\" \"))\n remaining = remaining / 10\n end\n \n return result\nend", "def jumping_jacks(number, energy)\n count = 0\n while count < number\n if energy >= 15\n count += 1\n energy -= 15\n puts \"Did #{count} jumping jacks, you have #{energy} energy left.\"\n else\n puts \"Waiting, #{energy} energy left.\"\n energy += 5\n end\n end\nend", "def bottle_song_lyrics(n)\n bottle_counter = n\n bottles_remaining = n-1\n song = \"\"\n while bottle_counter >= 1\n if bottle_counter > 1\n song << \"#{bottle_counter} bottle of beer on the wall, #{bottle_counter} bottle of beer. Take one down, pass it around, #{bottles_remaining} bottle of beer on the wall! \"\n else\n song << \"1 bottle of beer on the wall, 1 bottle of beer. Take one down, pass it around, no more bottles of beer on the wall!\"\n end\n bottle_counter -= 1\n bottles_remaining -=1\n end\n song\nend", "def dynamic_phrase_4\r\n\r\n # Verse 1: **no more bottles**\r\n if one_bottle?\r\n \"no more bottles\"\r\n # Verse 0: **99 bottles**\r\n elsif zero_bottles?\r\n \"99 #{bottle_s}\"\r\n else\r\n # Verse 2: **bottle**\r\n # Verse x: **x bottles**\r\n @bottle_quantity -= 1\r\n \"#{bottle_quantity} #{bottle_s}\"\r\n end\r\n end", "def beer_bottles(beer)\n\n while beer > 0\n p english_number(beer) + \" bottles of beer on the wall, \" + english_number(beer) + \" bottles of beeeeeer.\" + \n \" Take one down, pass it around. \" + english_number(beer-1) + \" bottles of beer on the wall.\"\n \n beer -= 1\n end\nend", "def doubler(start)\n puts start\n if start < 10\n doubler(start * 2) #this starts our method over until start is more than 10\n end\nend", "def bottle_song(n)\n truck = n\n until n == 0\n puts \"#{n} bottles of beer on the wall, #{n} bottles of beer.\"\n puts \"Take one down, pass it around, #{n-1} bottles of beer on the wall!\"\n n -= 1\n end\n if n == 0\n puts \"#{n} bottles of beer on the wall, #{n} bottles of beer.\"\n puts \"Take the truck, fill it back up. #{truck} bottles of beer on the wall\"\n n = truck\n end\n until n == 1\n puts \"#{n} bottles of beer on the wall, #{n} bottles of beer.\"\n puts \"Take one down, pass it around, #{n-1} bottles of beer on the wall!\"\n n -= 1\n end\n if n == 1\n n = \"no\"\n puts \"#{n} bottles of beer on the wall, #{n} bottles of beer.\"\n puts \"SUCKS TO BE YOU!!\"\n end\nend", "def ninety_nine_bottles_of_beer\n #99 bottles of beer on the wall, 99 bottles of beer.\n #Take one down and pass it around, 98 bottles of beer on the wall.\n number_of_bottles = 99\n while number_of_bottles > 1\n puts \"#{number_of_bottles} bottles of beer on the wall, #{number_of_bottles} bottles of beer\"\n puts \"Take one down and pass it around, #{number_of_bottles - 1} bottles of beer on the wall.\"\n number_of_bottles -= 1\n end\n#################################\n puts \"1 bottle of beer on the wall, 1 bottle of beer\"\n puts \"Take one down and pass it around, no more bottles of beer on the wall.\"\n#################################\n puts \"No more bottles of beer on the wall, no more bottles of beer.\"\n puts \"Go to the store and buy some more, 99 bottles of beer on the wall.\"\nend", "def delay(rtl, val) \n start = rtl.count() \n while rtl.count() < start + val do\n end\nend", "def delay(rtl, val) \n start = rtl.count() \n while rtl.count() < start + val do\n end\nend", "def day_2_part_2\n noun = 0\n verb = 0\n\n while noun < 100\n while verb < 100\n if compute(noun, verb) == 19690720\n return (100 * noun) + verb\n end\n verb += 1\n end\n noun += 1\n verb = 0\n end\nend", "def ninety_nine_bottles_of_beer\n 99.downto(1) do |n|\n nouns = Hash.new('bottles')\n nouns[1] = 'bottle'\n\n puts \"#{n} #{nouns[n]} of beer on the wall\"\n puts \"#{n} #{nouns[n]} of beer\"\n puts 'take one down, pass it around'\n puts \"#{n-1} #{nouns[n-1]} of beer on the wall\\n\\n\" if n > 1\n end\n puts 'no bottles of beer on the wall'\nend", "def move_ten st\n st = st.split('').map do |i|\n 10.times.inject(i) { |s| s.next }\n end\n\n st.each do |i|\n if i.size > 1\n i[0] = ''\n end\n end\n\n st.join\nend", "def take_a_number(katz_deli, name)\n \n \n people_waiting = katz_deli.count\n\n katz_deli << name\n \n \n while people_waiting > 0\n \n \n puts \"#{name} your place in line is #{people_waiting+1}\"\n \n \n break\n \n \n\n end\n \n end", "def take_bath\n self.hygiene += 4\n return \"♪ Rub-a-dub just relaxing in the tub ♫\"\n @hygiene\n end", "def check_phrase keywords, phrase\n\t\tphrase.split(/\\W/).each do |word|\n\t\t\tbreak unless word.length > 3\n\t\t\tword = word.downcase\n\t\t\tunless keywords.include? word\n\t\t\t\tkeywords.merge!({\"#{word}\" => 1})\n\t\t\telse\n\t\t\t\tnum = keywords.values_at(\"#{word}\")[0]\n\t\t\t\tkeywords.update({\"#{word}\" => num+1})\n\t\t\tend\n\t\tend\n\tend", "def print_changing_numbers\n\t\ti = 1\n\t\t#zolang i kleiner is dan 11\n\t\twhile i < 11\n\t\t\t#print de string met het nummer variabele en verhoog het daarna met 1\n\t\t\tputs \"This sentence is number #{i}\"\n\t\t\ti = i+1\n\t\tend\n\tend", "def lychrel(num)\n\n\tchain = num + num.to_s.reverse.to_i \t# define first number in the chain potentially leading to a palindrome\n\titer = 1\t\t# Define number of iterations variable\n\n\twhile chain.to_s != chain.to_s.reverse && iter <= 50\n\t\titer += 1\n\t\tchain = chain + chain.to_s.reverse.to_i\n\tend\n\n\tif iter > 50\n\t\treturn \"Lychrel\"\n\telse\n\t\treturn iter\n\tend\n\nend", "def more_steps\n steps = 0\n loop do\n if steps % 2 == 0 \n puts \"left\"\n else \n puts \"right\"\n end\n steps += 1\n if steps > 10\n break\n end\n end\nend", "def beer_song number\r\n\r\n\twhile number != 0\r\n\t\tputs number.to_s + \" bottles of beer on the wall, \" + number.to_s + \" bottles of beer.\"\r\n\t\tnumber -= 1\r\n\t\tputs \"Take one down and pass it around, \" + number.to_s + \" bottles of beer on the wall.\"\r\n\t\tputs\r\n\tend\r\nend", "def dynamic_phrase_2\r\n # Verse 0: **no more bottles**\r\n if zero_bottles?\r\n \"no more #{bottle_s}\"\r\n else\r\n # Verse 1: **1 bottle**\r\n # Verse x: **x bottles**\r\n \"#{bottle_quantity} #{bottle_s}\"\r\n end\r\n end", "def monkey(n)\n i = n\n loop do\n if i > 1\n p \"#{i} little monkeys jumping on the bed,\"\n p \"One fell off and bumped his head,\"\n p \"Mama called the doctor and the doctor said,\"\n p \"No more monkeys jumping on the bed\"\n else\n p \"#{i} little monkey jumping on the bed,\"\n p \"One fell off and bumped his head,\"\n p \"Mama called the doctor and the doctor said,\"\n p \"Get those monkeys right to bed!\"\n return 0 \n end\n i -= 1\n end\nend", "def run\n searching if @nr_of_words >= @phrase_length\n end", "def little_monkeys(num)\n i = num\n num.times do\n # For the last monkey, the nursery line is different\n if (i == 1)\n print \"#{i} little monkey jumping on the bed.\\n He fell off and bumped his head,\\n Mama called the doctor and the doctor said,\\n Get those monkeys right to bed!\\n\"\n else\n print \"#{i} little monkeys jumping on the bed.\\n One fell off and bumped his head,\\n Mama called the doctor and the doctor said,\\n No more monkeys jumping on the bed!\\n\"\n end\n i -= 1\n end\nend", "def dynamic_phrase_1\r\n\r\n # Verse 1: **1 bottle**\r\n # Verse 0: **No more bottles**\r\n if zero_bottles?\r\n \"No more bottles\"\r\n # Verse 1: **1 bottle**\r\n # Verse x: **x bottles**\r\n else\r\n \"#{bottle_quantity} #{bottle_s}\"\r\n end\r\n end", "def stickers_for(phrase)\n sticker_count = 0\n phrase.delete!(\" \")\n\n until phrase.empty?\n \"instagram\".each_char do |char|\n if phrase.include?(char)\n idx = phrase.index(char)\n phrase = phrase[0...idx] + phrase[idx+1..-1]\n end\n end\n \n sticker_count += 1\n end\n\n sticker_count\nend", "def record_longer_phrase\n compiled_phrase = compile_phrase\n compiled_phrase_length = compiled_phrase.word_count\n @phrases[compiled_phrase_length] ||= Hash.new(0)\n\n # The first duplicate we find needs to record both occurrances\n # TODO: Clean this up. Absolute mother to read.\n new_occurrances = @phrases[compiled_phrase_length][compiled_phrase] > 0 ? 1 : 2\n @phrases[compiled_phrase_length][compiled_phrase] += new_occurrances\n end", "def bottles(start_number)\n start_number.downto(1) do |num|\n if num == 1\n bottle = \"bottle\"\n bottles = \"bottles\"\n next_num = \"no more\"\n else\n bottle = \"bottles\"\n bottles = \"bottles\"\n next_num = num - 1\n end\n\n puts \"#{num} #{bottle} of beer on the wall, #{num} #{bottle} of beer.\"\n puts \"Take one down, pass it around, #{next_num} #{bottles} of beer on the wall.\"\n end\nend", "def beersong(bottles)\n bottles.downto(1) do\n puts \"#{bottles} bottle#{bottles > 1 ? \"s\" : \"\" } of beer on the wall\"\n puts \"#{bottles} bottle#{bottles > 1 ? \"s\" : \"\" } of beer\"\n puts \"Take 1 down and pass it around\"\n bottles -= 1\n if bottles < 1\n puts \"You're out of booze.\"\n else\n puts \"#{bottles} bottle#{bottles > 1 ? \"s\" : \"\" } of beer on the wall\"\n end\n puts\n end\nend", "def cartman_hates(thing)\n while true\n puts \"What's there to hate about #{thing}?\"\n end # fix\nend", "def perform\n phrase_options[:length_range].each do |length|\n @phrases[length] ||= Hash.new(0) # Default each phrase to zero occurances\n each_phrase(length) do |phrase|\n running_phrase_check(phrase) if @options[:look_longer] && (length == @options[:max_length])\n @phrases[length][phrase] += 1\n end\n\n # Check for presence of longer phrases only on last pass\n running_phrase_check('') if @options[:look_longer] && (length == @options[:max_length])\n end\n\n remove_component_phrases if @options[:hide_longer]\n sort_phrases\n end", "def lychrel?(n, count = 0)\n return true if count == 50\n n += n.to_s.reverse.to_i\n n.to_s == n.to_s.reverse ? false : lychrel?(n, count+1)\nend", "def phrase_length\n 1\n end", "def loop_iterator(number_of_times)\n phrase = \"Welcome to Flatiron School's Web Development Course!\"\n counter = 0\n \n loop do \n counter += 1\n puts phrase\n if counter >= number_of_times \n break\n end\n end\n \nend", "def make_puctuation_ended_line(text, len)\n phrases = text.split(/[\\!\\?\\.\\:\\;\\(\\)\\n]/)\n phrases.shuffle!\n phrases.each do |phrase|\n words = phrase.split(\" \")\n words.reverse!\n line = \"\"\n words.each do |word|\n begin\n line = \"#{word} #{line}\"\n if line.to_phrase.syllables == len\n line.gsub!('\"','')\n return line\n end\n if line.to_phrase.syllables > len\n break\n end\n rescue\n break\n end\n end\n end\n end", "def modify_while\n x = 0\n puts x += 1 while x<10\nend", "def take_bath\n #increment hygiene_points by 4\n #return string \"♪ Rub-a-dub just relaxing in the tub ♫\"..\n self.hygiene +=4\n return \"♪ Rub-a-dub just relaxing in the tub ♫\"\n end", "def next_level_check\n if ($current_lvl == $lvl_1 && $word_count > 9) || ($current_lvl == $lvl_2 && $word_count > 14) || ($current_lvl == $lvl_3 && $word_count > 19)\n $word_count = 0\n system \"clear\"\n level_advance\n else\n # if so display the next word\n system \"clear\"\n next_word()\n end\nend", "def take_bath\n self.hygiene = @hygiene + 4\n # Another way to do the above:\n # self.hygiene=(@hygiene + 4)\n \"♪ Rub-a-dub just relaxing in the tub ♫\" \n end", "def hard(input)\n 50.times { input = look_and_say(input) }\n input.length\nend", "def say_hello_world_ten_times\n phrase = \"Hello World\"\n \n \nphrase = \"Hello World!\"\nputs phrase\nputs phrase\nputs phrase\nputs phrase\nputs phrase\nputs phrase\nputs phrase\nputs phrase\nputs phrase\nputs phrase\nend", "def doubler(start)\n puts start \n if start <10 \n doubler(start * 2)\n end\nend", "def begin_find_next_word(stepup)\n if stepup == true\n @s = @e+1\n @e += 1\n else nil\n end\n end", "def take_bath\n self.hygiene += 4\n return \"♪ Rub-a-dub just relaxing in the tub ♫\"\n end", "def take_bath\n self.hygiene += 4\n return \"♪ Rub-a-dub just relaxing in the tub ♫\"\n end", "def bottles num_bottles\n first_lyric = \" bottles of beer on the wall, \" \n second_lyric = \" bottles of beer.\"\n third_lyric = \"Take one down and pass it around, \"\n fourth_lyric = \" bottles of beer on the wall.\"\n\n puts num_bottles.to_s + first_lyric + num_bottles.to_s + second_lyric\n\n if num_bottles != 1\n puts third_lyric + (num_bottles - 1).to_s + fourth_lyric\n else\n puts third_lyric + \"no\" + fourth_lyric\n end\n\n num_bottles = num_bottles - 1\n puts \"\"\n if num_bottles > 0 \n bottles num_bottles\n else\n puts \"No more bottles of beer on the wall, no more bottles of beer.\n Go to the store and buy some more, 99 bottles of beer on the wall.\"\n end\nend", "def say_hello_ten_times\n phrase = \"Hello World\"\n 10.times do\n puts phrase\n end \nend", "def restart_loop\n new_last_word_index = @words.keys.sort.last\n if new_last_word_index.nil?\n @i_last_real_word = 0 \n @i = 0\n else\n @i_last_real_word = new_last_word_index\n @i = @i_last_real_word\n end\n end", "def restart_loop\n new_last_word_index = @words.keys.sort.last\n if new_last_word_index.nil?\n @i_last_real_word = 0 \n @i = 0\n else\n @i_last_real_word = new_last_word_index\n @i = @i_last_real_word\n end\n end", "def doubler(start)\n puts start\n if start < 10\n doubler(start - 1)\n end\n end", "def to_w # to_w is for 'to words'\n # Numbers up to 20 are quite irregular. We need a specific block of code for tens\n tens = lambda do |x|\n if x < 20\n @@english_numbers[x.to_s.to_sym]\n else\n decs = x.to_s[0] + '0'\n units = x.to_s[-1]\n \"#{@@english_numbers[decs.to_sym]} #{@@english_numbers[units.to_sym]}\"\n end\n end\n # Use a recursive lambda to call itself as many times as needed until the whole number is written\n sentence = lambda do |num|\n num_length = num.to_s.length\n if num_length < 3 # If number is lower than 99 use tens block\n tens.call(num)\n else\n # Create a temporary hash to keep track of the magnitude of the piece of number we are working with\n new_structure = @@structure.select{|k,v| [k,v] if k<num_length}\n digits = new_structure[0][0]\n following_digits = (new_structure.length == 1) ? 2 : new_structure[1][0]\n word = new_structure[0][1]\n if num <= (10**digits - 1) # Get feeper into recursion if the number is smaller than the current order of magnitude\n sentence.call(num)\n else\n # Split the word into a part belonging to the current order of magnitude and a rest\n left = num.to_s[0..-(digits+1)].to_i\n rest = num.to_s[-digits..-1].to_i\n # Apply English grammar rules and exectute the same code recursively onto each side\n if rest == 0\n \"#{sentence.call(left)} #{word}\"\n elsif rest < 10**following_digits\n \"#{sentence.call(left)} #{word} and #{sentence.call(rest)}\" \n else\n \"#{sentence.call(left)} #{word} #{sentence.call(rest)}\"\n end\n end\n end\n end\n # Execute the recursive lambda\n sentence.call(self)\n end", "def counterGame(n)\n # Write your code here\n pows = [1]\n pows.push(pows[-1] * 2) until pows[-1] >= n\n\n turn = 0\n\n until n == 1\n target_pow_i = pows.find_index { |p| p >= n }\n target_pow = pows[target_pow_i]\n if n == target_pow\n n /= 2\n else\n n -= pows[target_pow_i - 1]\n end\n\n turn += 1\n end\n\n turn.odd? ? 'Louise' : 'Richard'\nend", "def print_song\n\n num = @bottles\n\n if num == 0\n puts \"\"\n elsif num == 1\n puts \"One bottle of beer on the wall,\"\n puts \"One bottle of beer,\"\n puts \"Take one down, pass it around,\"\n puts \"Zero bottles of beer on the wall.\"\n elsif num == 2\n puts \"Two bottles of beer on the wall,\"\n puts \"Two bottles of beer,\"\n puts \"Take one down, pass it around,\"\n puts \"One bottle of beer on the wall,\"\n puts \"One bottle of beer,\"\n puts \"Take one down, pass it around,\"\n puts \"Zero bottles of beer on the wall.\"\n\n else\n\n num.downto(3) do\n |num|\n eng = english_number(num)\n puts \"#{eng.capitalize} bottles of beer on the wall,\"\n puts \"#{eng.capitalize} bottles of beer,\"\n puts \"Take one down, pass it around,\"\n puts \"#{english_number(num-1).capitalize} bottles of beer on the wall,\"\n end\n puts \"Two bottles of beer on the wall,\"\n puts \"Two bottles of beer,\"\n puts \"Take one down, pass it around,\"\n puts \"One bottle of beer on the wall,\"\n puts \"One bottle of beer,\"\n puts \"Take one down, pass it around,\"\n puts \"Zero bottles of beer on the wall.\"\nend\nend", "def bump(x)\n x.count('n') <= 15 ? \"Woohoo!\" : \"Car Dead\"\nend", "def translator\n # Greet your user in the language of their people.\n puts [\"SUP KID? \",\n \t \"What didja say? \",\n \t \"How ya doan? \",\n \t \"How ahrya?\",\n \t \"How 'bout them Sox? \",\n \t \"How 'bout them Pats? \"].sample\n\n # Get their response and lop off the carriage return, Massachusetts Left style.\n phrase = gets.chomp.to_s\n\n # Now we're going to award the user points based on density of Boston-specific\n # diction, aka their Beantown Points(tm).\n i = 0\n beantown_points = 0\n wicked_boston_words = [\"bubblah\",\n \"wicked\",\n \"reveah\",\n \"the dot\",\n \"medfid\",\n \"broons\",\n \"barrel\",\n \"digga\",\n \"southie\",\n \"eastie\",\n \"rotary\",\n \"pissah\",\n \"jp\",\n \"fried\",\n \"directional\",\n \"beantown\",\n \"red sox\",\n \"common\",\n \"dunkin donuts\",\n \"patriots\",\n \"celtics\",\n \"green monster\",\n \"dirty watah\",\n \"packie\"\n ]\n\n searchable_phrase = phrase.downcase\n\n wicked_boston_words.each do |i|\n \tif searchable_phrase.include?(i)\n \t\tbeantown_points += 1\n \tend\n end\n\n ########################################################################################################\n # A-Z dictionary of specific gsubs for targeted replacement. This is about to get wicked awesome, bro! #\n ########################################################################################################\n\n # A\n phrase.gsub!(/\\bacross the rivah?\\b/i, 'on the other side of the Charles River') # across the rivah (other side of the charles)\n phrase.gsub!(/\\b(a)dvahtisin'?g?\\b/i, '\\1dvertising') # advahtisin'(g)\n phrase.gsub!(/\\b(a)dvisah?\\b/i, '\\1dviser') # advisah\n phrase.gsub!(/\\b(a)doah\\b/i, '\\1dore') # adoah\n phrase.gsub!(/(a)ftah/i, '\\1fter') # aftah (aftahwahds, raftah, & other containing words)\n phrase.gsub!(/\\bah(h)?(?=\\s[a-z]+in('|g))?\\b/i, 'are') # ah (usually \"are\" if a word ending in \"ing is after\")\n phrase.gsub!(/\\b(the)? Ahbs\\b/i, '\\1 Arboretum') # the ahbs is a fun place to hang out\n phrase.gsub!(/\\b(a)hm\\b/i, '\\1rm') # curt schilling's gotta good ahm\n phrase.gsub!(/(f|w|h|al|ch|fore)ahm(s?)/i, '\\1arm\\2') # ahm at the end of words\n phrase.gsub!(/\\bahr\\b/i, 'are') # ahr\n phrase.gsub!(/\\bahrya\\b/i, 'are you') # how ahrya?!\n phrase.gsub!(/\\b(a)hnt\\b/i, '\\1unt') # ya ahnt is comin' to Christmas\n phrase.gsub!(/\\ball set\\b/i, 'all done') # all set with my dinnah, thank you\n phrase.gsub!(/\\bAllston Christmas\\b/i, 'The last weekend in August when all the students move out and leave their furniture behind in Allston') # Gonna need a biggah cah\n phrase.gsub!(/\\b(a)mbassad(oah|ah)(s)/i, '\\1ambassad\\2\\3') # ambassadoah/dah\n\n # B\n phrase.gsub!(/\\b(b)ah\\b/i, '\\1ar') # bah (let's get a beeah at the bah)\n phrase.gsub!(/\\b(cross|crow|de|dis|draw|handle|iso|sand|side)bah(s)\\b/i, '\\1bar\\2') # \"bah\" (words ending in bah)\n phrase.gsub!(/\\bbahnie\\b/i, 'smart geek') # bahnie\n phrase.gsub!(/\\bbang a left\\b/i, 'take a left') # bang a left...but do it before the oncoming turns green!\n phrase.gsub!(/\\b(b)ankin/i, 'hillside') # watch the game from the bankin\n phrase.gsub!(/\\bbarrel/i, 'trash can') # throw that yankees jersey in the barrel\n phrase.gsub!(/\\bbazo\\b/i, 'drunk') # bazo on the weekendddd\n phrase.gsub!(/\\bbeantown\\b/i, 'Boston') # beantown\n phrase.gsub!(/\\b(b)eeah(s)?\\b/i, '\\1eer') # lemme buy ya a beeah (sam adams please)\n phrase.gsub!(/\\b(b)ettah\\b/i, '\\1etter') # bettah (than you)\n phrase.gsub!(/\\bbig(-|\\s)ball bowling?/i, '10-pin bowling') # big ball bowlin'\n phrase.gsub!(/\\bBig Dig\\b/i, 'the most expensive highway project in U.S. History') # the big dig, depress that central ahtery\n phrase.gsub!(/\\bb(ill-)?ricka/i, 'Billerica') # Billerica\n phrase.gsub!(/\\bboahded\\b/i, 'dibs') # boahded\n phrase.gsub!(/\\bbobos\\b/i, 'boat shoes') # bobos\n phrase.gsub!(/\\bBostonian\\b/i, 'resident of Boston') # Bostonian\n phrase.gsub!(/\\bbook(ed|in)? outta theah\\b/i, 'took off') # bookin' it\n phrase.gsub!(/\\b(b)r(a|u)h\\b/i, '\\1ro') # brah/bruh\n phrase.gsub!(/\\bbrahmin\\b/i, 'WASP-y type') # Brahmin\n phrase.gsub!(/\\bbreakdown lane\\b/i, 'highway shoulder') # breakdown lane at rush hoah, jeez\n phrase.gsub!(/\\bBroons\\b/i, 'Bruins') # Da Broons!\n phrase.gsub!(/\\bbubblah\\b/i, 'water fountain') # bubblah\n\n # C\n phrase.gsub!(/\\b(c)ahds\\b/i, '\\1ards') # cahds\n phrase.gsub!(/\\b(c|ced|chedd|sc|sidec|tramc|supahc|vic)ah(s)?\\b/i, '\\1ar\\2') # cah(s) and 6 containing words that are most common.\n phrase.gsub!(/\\b(c)alendah(s)?\\b/i, '\\1alendar\\2') # calendah (the sawx got theyah openin' day on theah!)\n phrase.gsub!(/\\bcalm ya liva(a|h)?/i, 'relax') # calm ya livah, I didn't eat ya dinnah\n phrase.gsub!(/\\b(c)an't get\\b/i, '\\1an get') # can't get (no satifaction...but plenty of double negatives up for grabs, so)\n phrase.gsub!(/\\bThe Cape\\b/i, 'Cape Code, Massachusetts') # goin' to the Cape this summah\n phrase.gsub!(/\\bcarriage\\b/i, 'grocery cart') # carriage (for ya lobstahs and beeahs)\n phrase.gsub!(/\\b(c)awna\\b/i, '\\1orner') # coolidge cawna\n phrase.gsub!(/\\b(c)ella(h)\\b?/i, 'basement') # go down cella\n phrase.gsub!(/\\b(c)howdah\\b/i, '\\1howder') # chowdah (clam or lobstah, take ya pick at sullivan's!)\n phrase.gsub!(/\\b(coffee|small|medium|lahge) regulah\\b/i, 'coffee with cream and two sugars') # coffee, regulah\n phrase.gsub!(/\\bCochihchewit\\b/i, 'Cochituate') # Co-CHIH-chew-it\n phrase.gsub!(/\\b(c)onsidah\\b/i, '\\1onsider') # considah\n phrase.gsub!(/\\b(c)orridoah(s)\\b/i, '\\1orridor\\2') # corridor\n phrase.gsub!(/\\b(c)umbie(s|'s)/i, 'Cumberland Farms Mini-Mart') # cumbie's\n\n # D\n phrase.gsub!(/\\b(Mon|Tues|Wed|Thurs|Fri|Sun)diz/i, '\\1days') # plural days of the week, less Saturday which can have a couple pronunciations\n phrase.gsub!(/\\b(d)ecoah\\b/i, '\\1ecor') # decoah (in ya apahtment!) -- most frequently used word ending in \"cor\"\n phrase.gsub!(/\\bdecked\\b/i, 'punched') # he got decked at the sox game\n phrase.gsub!(/\\bdecked\\sout\\b/i, 'dressed up') # he's all decked out for his date!\n phrase.gsub!(/\\b(d)idja\\b/i, '\\1id you') # didja\n phrase.gsub!(/\\bdirty watah\\b/i, 'the Charles River') # love that dirty watah\n phrase.gsub!(/\\bdiggah?\\b/i, 'fall') # fell on some ice and took a diggah\n phrase.gsub!(/\\b(d|fl|ind|p|outd)oah\\b/i, '\\1oor') # oah words ending in oor\n phrase.gsub!(/\\b(direc|doc)tah\\b/i, '\\1tor') # doctah/directah\n phrase.gsub!(/\\bdirectional\\b/i, 'turn signal') # put on ya directional before you take turn\n phrase.gsub!(/\\bDot Ave\\b/i, 'Dorchester Avenue') # Dot Ave\n phrase.gsub!(/\\bDot Rat(s)?/i, 'resident\\1 of Dorchester') # Dot Rats\n phrase.gsub!(/\\bthe Dot\\b/i, 'Dorchester') # the dot\n phrase.gsub!(/\\bdunki(n'?s'?|n|es)(\\sdonuts)?\\b/i, 'Dunkin\\' Donuts') # dunkies, dunkins, dunkin, dunkin's, & dunkin's!\n phrase.gsub!(/\\bdrawring\\b/i, 'drawing') # drawring\n\n # E\n phrase.gsub!(/\\bEastie\\b/i, 'East Boston') # Eastie\n phrase.gsub!(/\\belastic(s)?\\b/i, 'rubber band\\1') # elastics\n phrase.gsub!(/(e)ntah\\b/i, '\\1nter') # entah (come in heah!)\n phrase.gsub!(/\\b(e)ntiah\\b/i, 'entire') # entiah (I've lived in Boston my entiah life)\n phrase.gsub!(/(n)?(e)vah\\b/i, '\\1\\2ver') # evah (or forevahevah! or nevah. that too.)\n\n # F\n phrase.gsub!(/\\bfahr\\b/i, 'for') # fahr (ready fahr spring after this wintah!)\n phrase.gsub!(/\\bfactah\\b/i, 'factor') # factah\n phrase.gsub!(/\\b(af|insof|ovahf|f)ah\\b/i, '\\1ar') # fah (neah, fah, wheahevah you ahhhhh)\n phrase.gsub!(/(f)ahkin'?/i, '\\1*!king') # I mean, it's not very polite but you have to admit it is a distinctive part of a true Boston accent!\n phrase.gsub!(/(f)ahk?/i, '\\1*!k') # I mean, it's not very polite but you have to admit it is a distinctive part of a true Boston accent!\n phrase.gsub!(/\\b(airf|cahf|thoughroughf|welf|wahf|f)ayah\\b/i, '\\1are') # fayah (wahfayah, aihfayah)\n phrase.gsub!(/\\bfawr\\b/i, 'for') # fawr\n phrase.gsub!(/(af|bef|f)oah\\b/i, '\\1ore') # foah (fore & variants)\n phrase.gsub!(/\\bfoddy\\b/i, 'fourty') # foddy\n phrase.gsub!(/\\bfrappe\\b/i, 'a milkshake/malted (ice cream, milk, & syrup blended)') # frappe\n phrase.gsub!(/\\b(frickin|friggin)'?(?!\\z|\\s)/i, 'freaking') # the G-rated version of Boston's favorite adjective\n phrase.gsub!(/\\bfried\\b/i, 'weird') # fried\n phrase.gsub!(/\\bFudgicle\\b/i, 'Fudgsicle') # a fudgsicle that lost the \"s\"\n\n # G\n phrase.gsub!(/\\b(g)ahbidge\\b/i, '\\1arbage') # Wednesdiz is gahbidge day\n phrase.gsub!(/\\b(gawrls|gahls|gawhls)/i, 'girls') # gawrls just wanna...learn to code and change the girl to dave ratio, actually.\n phrase.gsub!(/(g)awd\\b/i, '\\1od') # oh my gawd\n phrase.gsub!(/\\b(g)ovahment\\b/i, '\\1overnment') # Govahment Centah! It's wheah Boston Cawllin' always is!\n phrase.gsub!(/\\b(ci|beg|vul|sug|vine)gah(s)?\\b/i, '\\1gar\\2') # gah --> sugah, cigah, etc.\n phrase.gsub!(/\\b(g)oah\\b/i, '\\1ore') # goah (Melissa-Leigh Goah, like Al Goah, he invented the intahnet)\n phrase.gsub!(/\\bg(o|a)tta\\b/i, 'have to') # gotta\n phrase.gsub!(/\\b(g)rammah\\b/i, '\\1rammar') # grammah\n phrase.gsub!(/\\bgrindah?(s)?\\b/i, 'sub\\1') # grindahs\n phrase.gsub!(/\\b(g)uitah\\b/i, '\\1uitar') # guitah (what's that game the kids ah playin? guitah hero?!)\n\n # H\n phrase.gsub!(/\\b(Hahvahd|Havahd|Havid|Hahvid)/i, 'Harvard') # Let's go to Hahvid and sit outside the Widenah Library\n phrase.gsub!(/\\b(hang|hook) a right\\b/i, 'take a right') # hang/hook a right\n phrase.gsub!(/\\bhamburg\\b/i, 'ground beef') # my grammy's go to dinnah was hamburg thingies..aka ground beef patties with mustard cooked on one side of a hamburger bun (this is an actual true story from the writer of this program, haha)\n phrase.gsub!(/\\b(heahd|heid)\\b/i, 'heard') # ya nevah heahd about that?\n phrase.gsub!(/heah/i, 'here') # heah, wheah, theah (wait, who's on first?!) -- this matches on at least 300 english words containing \"here\"\n #hahbah (no taxation without representation, ya dig?) covered under \"lahbah\"\n phrase.gsub!(/\\bHub\\b/i, 'Boston') # the Hub\n\n # I\n phrase.gsub!(/\\b(i)dear\\b/i, '\\1dea') # idear (so THAT'S where all those \"r\"'s went!')\n phrase.gsub!(/\\b(i)ntahfeah\\b/i, '\\1nterfere') # doan wanna intahfeah, ya know?\n\n # J\n phrase.gsub!(/\\b(a)?(j)ah\\b/i, '\\1\\2ar') # jah and ajah, like jams and doahs, but not doahjahms. well, maybe.\n phrase.gsub!(/\\bjimmies\\b/i, 'chocolate sprinkles') # jimmies, just be careful asking for these in NJ\n phrase.gsub!(/\\bJP\\b/, 'Jamaica Plain') # JP, fastest gentrifying neighbahood\n\n # K\n phrase.gsub!(/\\b(k)eggah?(s)\\b/i, '\\1eg party\\2') # kegga, aka something you throw at ya new apahtment in college\n phrase.gsub!(/\\b(k)inda\\b/i, '\\1ind of') #\n\n # L\n phrase.gsub!(/(chancel|council|sail|counsel|tai|pah|bache|co|sett)lah\\b/i, '\\1lor') # lah (words ending in lah are usually \"ler\", so this looks for the most common ones that should actually be \"lor\" first)\n phrase.gsub!(/([a-z])+ahbah\\b/i, '\\1abor') # lahbah (workin' hahd!) also covers hahbah (no taxation without representation, ya dig?!) and other bor words -- targeted rule so general rule doesn't make this \"laber\"\n phrase.gsub!(/\\b(l)abradoah(s)\\b/i, '\\1abrador\\2') # labradoah retrievah\n phrase.gsub!(/\\bLe(ay|i)?stuh\\b/i, 'Leicester') # Leicester\n phrase.gsub!(/\\bLem(o|i)nstah\\b/i, 'Leominster') # Leominster\n phrase.gsub!(/\\bLight Dawns ovah? Mahblehead\\b/i, 'Oh, DUH.') # light dawns ovah mahblehead\n phrase.gsub!(/\\b(l)iquah\\b/i, '\\1iquor') # liquah stoah...aka a packie, tbh\n phrase.gsub!(/\\blotta\\b/i, 'lot of') # lotta\n\n # M\n phrase.gsub!(/(ah|gla|hu|ru|tre|tu)mah\\b/i, 'mor') # words ending in mah, like rumah, humah (targeted gsub bc most are \"mer\")\n phrase.gsub!(/\\b(m)ajah\\b/i, '\\1ajor') # majah league baseball\n phrase.gsub!(/\\bmasshole\\b/i, 'a proud jerk from Massachusetts') # massholes :)\n phrase.gsub!(/\\b(m)ayah\\b/i, '\\1ayor') # Mayah Menino was the best mayah evah. (RIP)\n phrase.gsub!(/\\b(Mehfuh|Meffid|Medfid)\\b/i, 'Medford') # Meffid. Next to Somerville, home to Tufts\n phrase.gsub(/ministah\\b/i, 'minister') # ministah (the religious kind, but also administer, etc)\n\n # N\n phrase.gsub!(/\\b(nawht|naht)\\b/, 'not') # naht/nawt\n phrase.gsub!(/\\bnooyawka\\b/i, 'New Yorker') # Nooyawka, just the kind of person you don't want to meet at Fenway\n phrase.gsub!(/(semi|so|lu)nah\\b/i, '\\1nar') # \"nah\" ending words that aren't \"ner\"...seminah, solah\n phrase.gsub!(/(na-ah|nuh-uh|nuh-ah)/i, 'no way') # nah-ah\n phrase.gsub!(/\\bneighbahood\\b/i, 'neighborhood') # neighbahood\n\n # O\n phrase.gsub!(/\\b(o)ah\\b/, '\\1ur') # oah (this is ah (our) city!)\n phrase.gsub!(/(o)ffah/i, '\\1ffer') # offah\n phrase.gsub!(/onna(-|\\s)?conna/i, 'on account of') # onna-conna I gotta help my ma\n phrase.gsub!(/\\bopen ai(r|h)\\b/i, 'drive in movie') # open air (drive in movie theatre)\n phrase.gsub!(/(o)thah/i, '\\1ther') # othah (and also containing words like anothah or brothah)\n phrase.gsub!(/(o)vah/i, '\\1ver') # ovah (and also containing words like covah (at the bah!) rovah or ovahpass)\n phrase.gsub!(/(o)wah\\b/i, '\\1wer') # owah (all words ending in \"ower\", powah, flowah, etc)\n\n # P\n phrase.gsub!(/\\bpackie\\b/i, 'liquor store') # packie\n phrase.gsub!(/\\bpeab('dee|dee|ody)\\b/i, 'Peabody') # Peabody\n phrase.gsub!(/\\b(p)lenny\\b/i, '\\1lenty') # plenny ah beahs in the fridge\n phrase.gsub!(/\\bpissah?\\b/i, 'cool') # wicked pissah\n phrase.gsub!(/\\b(Ptown|P-Town|P Town)/i, 'Provincetown') # at the endah tha cape\n\n # Q\n phrase.gsub!(/\\bquality\\b/i, 'worthless') # sarcasm at its finest\n phrase.gsub!(/\\bQuinzee\\b/i, 'Quincy') # Quincy\n\n # R\n phrase.gsub!(/\\b(r)adah?\\b/i, '\\1adar') # radah (cops runnin the radah around to cawnah)\n phrase.gsub!(/\\brahya\\b/i, 'rare') # rahya (wicked rahya steak)\n phrase.gsub!(/\\b(r)apshah?\\b/i, '\\1apture') # rapsha (Jesus and/or Red Sox championship parades, either way)\n phrase.gsub!(/\\b(r)awregg\\b/i, '\\1aw egg') # rawregg can give ya salmonella\n phrase.gsub!(/\\b(r)eahview\\b/i, '\\1earview') # reahview (mirror)\n phrase.gsub!(/\\b(r)emembah\\b/i, '\\1emember') # remembah (when govahment centah was open?)\n phrase.gsub!(/\\breveah\\b/i, 'Revere') # Reveah (as in, Paul. or the beach. or from, kid!)\n phrase.gsub!(/\\brotary\\b/i, 'traffic circle') # second left on tha rotary\n\n # S\n phrase.gsub!(/\\bsangwich\\b/i, 'sandwich') # sangwich\n phrase.gsub!(/\\bsa(dda|ti|tih|ta|tah|tuh)d(ay|ee)\\b/i, 'Saturday') # Satahday\n phrase.gsub!(/\\bsat(a|i)hdiz\\b/i, 'Saturdays') # Satahdays\n phrase.gsub!(/\\bskeeve(s|d)/i, 'grossed out') # skeeved out by hair in food, lemme tell ya\n phrase.gsub!(/soah\\b/i, 'sore') # wicked soah from gettin swole at the gym, bro\n phrase.gsub!(/\\b(s)o do(an|n'?t) i\\b/i, '\\1o do I') # So do(a)n't I!\n phrase.gsub!(/\\bsouthie\\b/i, 'South Boston') # Southie\n phrase.gsub!(/\\bspa\\b/i, 'convenience store (family-owned, usually)') # spa (let's go get an italian ice!)\n phrase.gsub!(/\\b(co|lode|mega|supah|)?stah\\b/i, 'star') # stah (ben affleck/matt damon, need I say moah?)\n phrase.gsub!(/\\bsuppah?\\b/i, 'dinner') # suppah\n phrase.gsub!(/\\bsweet caroline\\b/i, 'Sweet Caroline (BUM BUM BUM)') # GOOD TIMES NEVER SEEMED SO GOOOODD\n\n # T\n phrase.gsub!(/\\bthe T\\b/i, 'subway') # after this winter, it's a wonder I didn't replace this one with \"unusable death trap\"\n # \"theah\" is covered under \"h\" in the heah substitution\n phrase.gsub!(/\\btah\\b/i, 'to') # tah (ready tah go!)\n phrase.gsub!(/\\btawnic\\b/i, 'tonic (soda)') # get a tawnic outta the fridge foh ya fahtah\n phrase.gsub!(/\\btempasha(h)?\\b/i, 'temperature') # David Epstein says the tempasha should go back up tomarrah.\n phrase.gsub!(/\\b(t)ha\\b/i, '\\1he') # tha\n phrase.gsub!(/thah?\\b/i, 'ther') # brothah, fathah, mothah, etc. (matches on 92 english words ending in \"ther\")\n phrase.gsub!(/\\bthi(h)?d\\b/i, 'third') # stealin' thihd\n phrase.gsub!(/\\bthree deckah?\\b/i, 'three story house') # usually three units\n phrase.gsub!(/(pic|ven|lec|cap|adven|sculp|frac|scrip|punc|conjec|rap)sha/i, '\\1ture') # sha sound on end of certain \"ture\" ending words\n\n # U\n phrase.gsub!(/(u)ndah/i, '\\1nder') # undah (including all the words it is a prefix of like undahweah, undahcovah, undahahm, plus bonus containing words like thunder)\n phrase.gsub!(/\\b(u)ey\\b/i, '\\1-turn') # U-turn\n\n # V\n phrase.gsub!(/\\b(v)endah(s)\\b/i, '\\1endor') # vendah(s) (fenway franks, anybody?)\n phrase.gsub!(/\\bvin(yihd|yahd)\\b/i, 'Martha\\'s Vineyard') # mahtha's vinyihd\n phrase.gsub!(/\\b(fahv|fehv|flav|sav|surviv)ah\\b/i, '\\1or') # \"vah\" words that are \"vor\"\n\n # W\n phrase.gsub!(/\\b(w)atah\\b/i, '\\1ater') # watah (as in \"love that dirty\")\n phrase.gsub!(/\\bwah\\b/i, 'war') # wah\n phrase.gsub!(/\\bWal(ltham|thumb)\\b/i, 'Waltham') # home of Brandeis\n phrase.gsub!(/\\bwanna go\\?\\b/i, 'let\\'s fight outside') # wanna go?\n phrase.gsub!(/\\b(w)e(eahd|eid|ahd|eihd)\\b/i, '\\1eird') # weeid\n # wheah is covered under \"t\"...theah/wheah (as in, dude wheah's my car...oh, under a snowbank where I left it in January 2015!)\n phrase.gsub!(/\\bwhole nothah?\\b/i, 'a complete replacement') # I gotta whole notha cah\n phrase.gsub!(/\\bweah\\b/i, 'were') # wheah weah ya?\n phrase.gsub!(/\\b(w)eathah\\b/i, '\\1eather') # wetheah (some weah havin!)\n phrase.gsub!(/\\bwicked\\b/i, 'really') # wicked (wicked weeid kid)\n phrase.gsub!(/\\bwuhst(u|a)h\\b/i, 'Worcester') # Worcester\n\n # X\n\n # Y\n phrase.gsub!(/\\b(y)a\\b/i, '\\1ou') # ya goin to the game?\n phrase.gsub!(/\\b(y)ar(?=\\s?i)/i, '\\1eah ') # yarit's awesome -> yeah it's awesome\n phrase.gsub!(/\\b(y)oah\\b/i, '\\1our') # yoah\n\n # Z\n\n # Last, we're gonna do some broad pickoffs for general sounds common to the Boston accent.\n # This will help translate commonly used words and broadly applicable use-cases. They are\n # a little dangerous without the targeted gsubs above, but with them in place as a filter for\n # uncommon/edge cases, you should get good results.\n\n phrase.gsub!(/atah(s)?\\b/i, 'ator\\1') # \"atah\" (words ending in \"ator\"...decoratah, delegatah)\n phrase.gsub!(/(a)wl(l)?/i, '\\1l\\2') # \"awl\" (going to the mawll, fawllin' down, cawll ya mothah etc)\n phrase.gsub!(/bah(s)?\\b/i, 'ber\\1') # \"bah\" (words ending in bah...bahbah). Works b/c only 30ish words in English end in ber, & targeted gsubs are used above for them.\n phrase.gsub!(/cah(s)?\\b/i, 'cer\\1') # \"cah\" (words ending in cer are more common than car or cor, targeted gsubs for the latter two are above)\n phrase.gsub!(/dah(s)?\\b/i, 'der\\1') # \"dah\" (words ending in dah...chowdah?).\n phrase.gsub!(/eah(s)?\\b/i, 'ear\\1') # \"eah\" (words ending in eah...yeah, cleah)\n phrase.gsub!(/fah(s)?\\b/i, 'fer\\1') # \"fah\" (words ending in fer...offah?).\n phrase.gsub!(/gah(s)?\\b/i, 'ger\\1') # \"gah\" (words ending in ger...swaggah?).\n phrase.gsub!(/ha(h)?(s)?\\b/i, 'her\\2') # \"gah\" (words ending in ger...swaggah?).\n phrase.gsub!(/iah(d)?/i, 'ire\\1') # \"iahd\" (words ending in ire...tiahd, wiahd or ired...fiahd)\n phrase.gsub!(/in'(?=\\z|\\s)/i, 'ing') # \"in'\" (words ending in ing...bring back the g!).\n phrase.gsub!(/kah(s)?\\b/i, 'ker\\1') # \"kah\" (words ending in ker...smokah)\n phrase.gsub!(/lah(s)?\\b/i, 'lar\\1') # \"lah\" (words ending in lar...molah, pillah)\n phrase.gsub!(/mah(s)?\\b/i, 'mer\\1') # \"mah\" (words ending in mer...swimmah, homah)\n phrase.gsub!(/nah(s)?\\b/i, 'ner\\1') # \"nah\" (words ending in ner...gonah, runnah)\n phrase.gsub!(/layah(s)?\\b/i, 'lare\\1') # \"layah\" (words ending in lare..flayah, declayah)\n phrase.gsub!(/(o)ah(s)?/i, '\\1re\\2') # \"oah\" (stoah, moah)\n phrase.gsub!(/pah(s)?\\b/i, 'per\\1') # \"pah\" (words ending in \"pah\"...helpah, peppah, whispah, developah...which I am totally going to be after I win this contest and become...a launchah!)\n phrase.gsub!(/sah(s)?\\b/i, 'ser\\1') # \"sah\" (words ending in ser...think about ya usah in the browsah)\n phrase.gsub!(/tah(s)?\\b/i, 'ter\\1') # \"tah\" (words ending in ter...watah)\n phrase.gsub!(/uahd(s)?\\b/i, 'ured\\1') # \"uahd\" (words ending in ured...figuahd, injuahd)\n phrase.gsub!(/vah(s)?\\b/i, 'ver\\1') # \"vah\" (words ending in ver...ovah, rivah)\n phrase.gsub!(/wah(s)?\\b/i, 'wer\\1') # \"wah\" (words ending in wer...lawnmowah, towah)\n phrase.gsub!(/xah(s)?\\b/i, 'xer\\1') # \"xah\" (words ending in xer...boxah, mixah)\n phrase.gsub!(/yah(s)?\\b/i, 'yer\\1') # \"yah\" (words ending in yer...foyah, lawyah)\n phrase.gsub!(/zah(s)?\\b/i, 'zer\\1') # \"zah\" (words ending in zer...organizah, seltzah)\n\n phrase.gsub!(/aw/i, 'o') # this one is super broad...tawnic/gawd/etc\n phrase.gsub!(/ah(?!\\b)+/, 'ar') # this one should always run last because it's so broad, but it will clean and cover a ton more cases than can be thought up individually\n\n\n # Finally, there is some stuff we just will NOT abide by in the Beantown Translation Machine.\n\n phrase.gsub!(/\\b(A-Rod|Eli Manning|Peyton Manning|the Jets|Bill Buckner|snow|disabled train|severe delays in service|parking ban|commuter rail)\\b/i, '[REDACTED]') # Redact it like the FBI releasing an embarrassing document, okay?\n phrase.gsub!(/\\bYankees\\b/i, 'Yankees (suck!)') # Yankees suck okay?\n phrase.gsub!(/\\bJohnny Damon\\b/i, 'He who shall not be named') # Looks like Jesus, talks like Judas, throws like...someone who can't throw because that's just rude to Mary.\n\n puts \"They said: \" + phrase\n\n # Special \"How Boston Are YOU?\" Beantown Points score for experts! Only shows up for users who earn at least two points.\n\n if beantown_points >= 15\n \tputs \"How Boston Are YOU?: WICKED LEGIT! Ah you from Reveah, kid?! You're as Boston as baked beans and clam chowdah without tomatoes. Hit up that packie, it's time for a toast!\"\n elsif beantown_points < 15 && beantown_points >= 10\n \tputs \"How Boston Are YOU?: Solid work! You probably yell \\\"Yankees Suck\\\" at sporting events where the Yankees aren't even playing. You drink your watah from a bubblah. We salute you.\"\n elsif beantown_points < 10 && beantown_points >= 5\n \tputs \"How Boston Are YOU?: Alright, now we're getting somewhere. This is pretty Boston, we'll admit. Just don't try to pahk ya cah in Hahvahd Yahd, or you'll get towed, alright?\"\n elsif beantown_points >=2 && beantown_points < 5\n \tputs \"How Boston are YOU?: Solid effort, but you need to hit the Pike and go back wheah ya came from, kid.\"\n end\n\n play_again\n\nend", "def say_hello_ten_times\n\nphrase = \"Hello World!\"\nputs phrase\nputs phrase\nputs phrase\nputs phrase\nputs phrase\nputs phrase\nputs phrase\nputs phrase\nputs phrase\nputs phrase\nend", "def tend_once(wait_for_end = true)\n refresh\n text = read_text\n return :broken if text =~ /Repair/\n match = Regexp.new('Spring Tension is +([0-9 ]+)').match(text)\n tension = match[1].tr(' ','').to_i\n return :max_tension if tension >= 100\n if !stat_ok? :end\n return :no_wait unless wait_for_end\n end\n\n stat_wait :end\n return :ok if click_on('Wind')\n puts \"DeepWellWindow: this should not happen.\"\n return :ok\n end", "def sing_loop(starting_verse, ending_verse=0)\n starting_verse.downto(ending_verse).inject(\"\") do |song, verse_number|\n song << verse(verse_number) + \"\\n\"\n end\n end", "def step(s,c)\n until @word[s + 1] == c or s == 0 do\n s = @back[s] # Backtrack if necessary.\n end\n\n if @word[s + 1] == c\n s += 1 # Move forvard if match found.\n end\n s # Return the new state.\n end", "def words(n)\n final = []\n while n > 0\n if n < 249\n final += FFaker::Lorem.words(n)\n n = 0\n else\n final += FFaker::Lorem.words(249)\n n -= 249\n end\n end\n final.join(\" \")\nend", "def move increment\n\t\tnew_text = Array.new\n\t\tif increment > 0\n\t\t\t@text_spacer += \" \" * increment\n\t\telse\n\t\t\t@text_spacer = @text_spacer[1..increment]\n\t\tend\n\t\[email protected](\"\\n\").each do |line|\n if increment > 0 \n line = (\" \" * increment) + line\n\t\t\telsif increment < 0 \n\t\t\t line = line[increment.abs..line.size]\n\t\t\tend\n\t\t\tnew_text << line\n\t end\n\t\t@text = new_text.join \"\\n\"\n\tend", "def speak(y)\n x = 0\n while x < y\n puts \"Woof!\"\n x += 1\n end\n end", "def doubler(start)\n puts start\n if start < 10\n doubler(start * 2)\n end\nend", "def doubler(start)\n puts start\n if start < 10\n doubler(start * 2)\n end\nend", "def doubler(start)\n puts start\n if start < 10\n doubler(start * 2)\n end\nend", "def doubler(start)\n puts start\n if start < 10\n doubler(start * 2)\n end\nend", "def rl_forward_word(count, key)\r\n if (count < 0)\r\n return (rl_backward_word(-count, key))\r\n end\r\n\r\n while (count>0)\r\n return 0 if (@rl_point == @rl_end)\r\n\r\n # If we are not in a word, move forward until we are in one.\r\n # Then, move forward until we hit a non-alphabetic character.\r\n c = _rl_char_value(@rl_line_buffer, @rl_point)\r\n\r\n if (!_rl_walphabetic(c))\r\n if !@rl_byte_oriented\r\n @rl_point = _rl_find_next_mbchar(@rl_line_buffer, @rl_point, 1, MB_FIND_NONZERO)\r\n else\r\n @rl_point += 1\r\n end\r\n while (@rl_point < @rl_end)\r\n c = _rl_char_value(@rl_line_buffer, @rl_point)\r\n if (_rl_walphabetic(c))\r\n break\r\n end\r\n if !@rl_byte_oriented\r\n @rl_point = _rl_find_next_mbchar(@rl_line_buffer, @rl_point, 1, MB_FIND_NONZERO)\r\n else\r\n @rl_point += 1\r\n end\r\n end\r\n end\r\n\r\n return 0 if (@rl_point == @rl_end)\r\n\r\n if !@rl_byte_oriented\r\n @rl_point = _rl_find_next_mbchar(@rl_line_buffer, @rl_point, 1, MB_FIND_NONZERO)\r\n else\r\n @rl_point += 1\r\n end\r\n while (@rl_point < @rl_end)\r\n c = _rl_char_value(@rl_line_buffer, @rl_point)\r\n if (!_rl_walphabetic(c))\r\n break\r\n end\r\n if !@rl_byte_oriented\r\n @rl_point = _rl_find_next_mbchar(@rl_line_buffer, @rl_point, 1, MB_FIND_NONZERO)\r\n else\r\n @rl_point += 1\r\n end\r\n end\r\n count -= 1\r\n end\r\n 0\r\n end", "def recite(number)\n # validate number\n validate_number(number)\n\n # get lyrics in range number to last index\n i = @size - number\n final_lyrics = []\n while i < @size\n final_lyrics.push(@lyrics[i])\n i+=1\n end\n\n final_lyrics = final_lyrics.join(' ')\n \n return \"This is \" + final_lyrics\n end", "def drive(distance)\r\n\t\t@total_distance += distance\r\n\t\tputs \"You drove #{distance} mile#{\"s\" unless distance == 1} while going #{@speed}mph.\"\r\n\t\tputs \"You have crashed your father's #{@color} #{@model}.\" if @speed > 80\r\n\tend", "def bump(x)\n x.count(\"n\") <= 15 ? \"Woohoo!\" : \"Car Dead\"\nend", "def letter_count limit\n letters = Hash[0, 0, 1, 3, 2, 3, 6, 3, 10, 3, 4, 4, 5, 4, 9, 4, 3, 5, 7, 5, 8, 5, 40, 5, 50, 5, 60, 5, 11, 6, 12, 6, 20, 6, 30, 6, 80, 6, 90, 6, 15, 7, 16, 7, 70, 7, 13, 8, 14, 8, 18, 8, 19, 8, 17, 9]\n words = Hash[\"and\", 3, \"hundred\", 7, \"thousand\", 8]\n num = 1\n digits = []\n count = 0\n i = 0\n\n letters.each do |k, v|\n # puts \"#{k}, #{v}\"\n end\n\n # puts \"HASH: #{letters[13]}\"\n\n\n while num <= limit\n count_for_word = 0\n\n if num > 9\n digits = num.to_s.reverse.split(//)\n \n # puts \"DIGITS[0]: #{digits[0]}, #{i}\"\n \n if digits[1] == \"1\"\n count_for_word = letters[[digits[0], digits[1]].join.reverse.to_i]\n\n else\n count_for_word = letters[digits[0].to_i] +\n letters[digits[1].to_i * 10]\n end\n count_for_word += letters[digits.fetch(2, 0).to_i] +\n letters[digits.fetch(3, 0).to_i]\n\n if digits[2] != nil && digits[2] != \"0\"\n # if letters[[digits[0], digits[1]].join.reverse.to_i] != 0 \n if [digits[0], digits[1]].join.reverse != \"00\" \n puts count_for_word\n\n count_for_word += words[\"hundred\"] + words[\"and\"]\n else\n count_for_word += words[\"hundred\"]\n end\n end\n\n puts count_for_word\n\n if digits[3] != nil\n count_for_word += words[\"thousand\"]\n end\n\n else\n count_for_word = letters[num].to_i\n end\n\n count += count_for_word\n num += 1\n end\n\n count \nend", "def dig_power_at_bridge\n slowly do\n\"\"\"\nWhen is there a wrong time to dig? Duncan ignores the bridge for now, and starts digging happily here and there.\n\nWho knows where you'll find a bone?\n\nHe digs and digs...\n\"\"\"\n end\n if dice_roll > 3\n slowly do \n \"...And discovers a chache of burried bones! Max strength! Treasure + 3\"\n end\n $stats[:strength] = 5\n $ending += 3\n spacing\n start_bridge_quest\n prompt\n bridge_choice(STDIN.gets.chomp!)\n else\n puts \"...And finds nothing. \"\n spacing\n start_bridge_quest\n prompt\n bridge_choice(STDIN.gets.chomp!)\n end\n end", "def cartman_hates(thing)\n\twhile true\n puts \"What's there to hate about #{thing}?\"\nend end", "def test_try_a_word_increments_num_tries\n\t\trandom_number = rand(10)\n\t\trandom_number.times {@pass_cracker.try_a_word!}\n\t\tnum_tries = @pass_cracker.num_tries\n\n\t\tassert num_tries == random_number\n\tend", "def loop_iterator(number_of_times)\n # Code your solution here using the \"loop\" keyword\n # to puts out the below phrase\n phrase = \"Welcome to Flatiron School's Web Development Course!\"\n # Maybe we should keep count of the number of times\n # we've puts out the phrase and break when the\n # counter hits the appropriate number...\n times = 1\n\n loop do\n puts phrase\n # How can we make sure the loop breaks once it\n # has puts out the phrase the correct number of\n # times?\n break if times == number_of_times\n times += 1\n end\nend", "def say_ruby_ten_times\n phrase = \"Hello World\"\n 10.times do puts phrase\n end\nend", "def rang\n x=2 \n y=10\nwhile x <= y do \n i = x * (x +1)\n puts i \n end\nend", "def hire_thief\r\n\t\t@thieves += 1\r\n\t\tputs \"*\"*50\r\n\t\tputs \"You just hired a new thief, you now have #{@thieves} thieves working for you.\"\r\n\t\tputs \"*\"*50\r\n\tend", "def hungry_andrew\n food = 5\n \n until food == 21\n puts \"PLEASE OH PLEASE COME BACK MARIE!\"\n puts food \n food += 1 \n end\nend", "def increment(resp)\n return if game_data.randomly_picked_word.include?(resp)\n\n game_data.guesses_remaining -= 1\n end", "def speak(n)\n \t\"Woof! \" * n\n end", "def bottles_of_beer (n)\n\treturn \"No more bottles of beer on the wall\" if n == 0\n\treturn \"#{n} bottles of beer on the wall\\r\\n\" + bottles_of_beer(n-1)\nend", "def cartman_hates(thing)\n while true\n puts \"What's there to hate about #{thing}?\"\n\tend\nend", "def drum_roll(dramatic_text, beep)\n print \"\\a\" unless beep == false\n c = 0\n dramatic_text.length.times do\n print dramatic_text[c]\n c += 1\n sleep 0.05\nend\nend", "def AdditivePersistence(num)\n addv_pers = 0\n until num < 10\n num = num.digits.sum\n addv_pers += 1\n end\n addv_pers\nend", "def increase_steps\r\n @steps = [@steps + 1, 9999999].min\r\n end", "def ninty_nine(beer)\n\t \n\tcurrent_beers = beer\n\n\twhile current_beers > 0\n\n\t\tif current_beers == 1 # to make sure the string is singular or plural\n\t\t\tsingular = ' bottle'\n\t\telse\n\t\t\tsingular = ' bottles'\n\t\tend\n\n\t\tputs english_number(current_beers).capitalize + singular + ' of beer on the wall,'\n\t\tputs english_number(current_beers) + singular + ' of beer!'\n\t\tputs 'Take one down, pass it around,'\n\t\tcurrent_beers -= 1\n\t\tputs english_number(current_beers).capitalize + singular + ' of beer on the wall.'\n\tend\nend", "def repeat_yourself(word, count)\n count.times {puts word}\n end", "def beer_bottles(start_number)\n start_number.downto(1) do |i|\n print \"#{i} bottle#{i > 1 ? \"s\" : \"\"} of beer on the wall,\", \" #{i} bottle#{i > 1 ? \"s\" : \"\"} of beer\", \"\\n\"\n if i >= 2\n print \"Take one down, pass it around\",\" #{i-1} bottle#{i > 2 ? \"s\" : \"\"} of beer on the wall!\\n\\n\"\n else\n print \"Take one down, pass it around,\",\" no more bottle#{i <= 1 ? \"s\" : \"\"} of beer on the wall!\\n\\n\"\n end\n end\nend", "def hamstrings_stretch\n \"Remaining seated, extend one leg outward. Reach toward your toes. Hold for 10 to 30 seconds. Repeat on the other side. Be sure to do this one leg at a time, as doing this exercise with both legs out can cause back issues.\"\nend", "def increment!\n self.left_half += 1\n # TODO: This breaks if the length of a palindrome changes, as odd doesn't update\n self\n end", "def cartman_hates(thing)\n\twhile true\n \tputs \"What's there to hate about #{thing}?\"\n end\nend", "def AdditivePersistence(num)\n count = 0\n\n while num > 9\n num = num.to_s.split(\"\").map{|i| i.to_i}.inject(:+)\n count += 1\n end\n\n count\nend", "def hungry_river\n food = 5\n until food == 21\n puts \"please oh please give me marie back\"\n puts food \n food *= 2 \n end \nend" ]
[ "0.66318274", "0.65974796", "0.6496439", "0.63508147", "0.57979727", "0.5726755", "0.57027847", "0.56796926", "0.56059444", "0.5557068", "0.5554313", "0.5539439", "0.54821247", "0.5457884", "0.545565", "0.545565", "0.5443542", "0.5431245", "0.53776056", "0.53753054", "0.53719634", "0.5368735", "0.5338637", "0.53375953", "0.5336886", "0.53326917", "0.5329374", "0.53228176", "0.5296586", "0.5292979", "0.5269812", "0.5262435", "0.52522516", "0.525102", "0.5232923", "0.5208238", "0.5207987", "0.52068186", "0.5201762", "0.5197534", "0.5175016", "0.51696545", "0.5167687", "0.5166611", "0.5140601", "0.51326513", "0.5126311", "0.5125285", "0.5123998", "0.51222855", "0.51222855", "0.511622", "0.5112982", "0.51098853", "0.51098853", "0.51094496", "0.5099013", "0.50906926", "0.50802314", "0.50715345", "0.5068913", "0.50595146", "0.50544274", "0.5052024", "0.5043376", "0.5019142", "0.5018142", "0.50155777", "0.50125027", "0.50125027", "0.50125027", "0.50125027", "0.50084186", "0.50061476", "0.50044525", "0.49927193", "0.49841306", "0.49812204", "0.49783272", "0.49753076", "0.4974415", "0.49737015", "0.49607423", "0.4957941", "0.49553657", "0.49531487", "0.49526137", "0.49444547", "0.4941622", "0.49399656", "0.4937727", "0.49372917", "0.4937085", "0.49346742", "0.49314997", "0.4928155", "0.49270907", "0.49205932", "0.49187568", "0.49066693" ]
0.6276529
4
Rewrites feeds to aim at their renamed equivalents
def rewrite_feed(group, id) case group when 'user' then ['profile', id] when 'user_aggr' then ['profile_aggr', id] when 'media_airing' then ['media_releases', id] when 'episode' then ['unit', "Episode-#{id}"] when 'episode_aggr' then ['unit_aggr', "Episode-#{id}"] when 'chapter' then ['unit', "Chapter-#{id}"] when 'chapter_aggr' then ['unit_aggr', "Chapter-#{id}"] when 'post_comments_aggr', 'private_library' then nil else [group, id] end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rewrite\n rewrited_content = parse_for_urls(content)\n parse_for_ids(rewrited_content)\n end", "def generate_rss_feed tweets, old_items\n version = \"2.0\"\n long_url = nil\n\n @logger.info \"Generating RSS feed to #{@rss_outfile}.\"\n\n content = RSS::Maker.make(version) do |m|\n m.channel.title = \"tweetfeed RSS feed #{@hashtags}\"\n m.channel.link = \"http://github.com/madhatter/tweetfeed\"\n m.channel.description = \"Automatically generated news from Twitter hashtags\"\n m.items.do_sort = true # sort items by date\n\n tweets.each do |tweet|\n orig_url = tweet.urls[0].url\n expanded_url = tweet.urls[0].expanded_url\n @logger.debug \"URL to fetch: #{orig_url}\"\n @logger.debug \"Already expanded url: #{expanded_url}\"\n short_url = expanded_url\n title = tweet['text'].sub(/(#{orig_url})/, \"\")\n long_url = @url_parser.get_original_url short_url\n\n # TODO: Maybe some kind of domain filter would be nice here...\n i = m.items.new_item\n i.title = title.gsub(/\\n/,\"\")\n #i.link = tweet['attrs']['entities']['urls'][0]['url']\n unless long_url == nil\n i.link = long_url.gsub(/\\r/,\"\")\n else\n i.link = orig_url.gsub(/\\r/,\"\") unless orig_url == nil\n end\n i.date = tweet['created_at']\n end\n\n @logger.debug \"Adding the old stuff...:\"\n old_items.items.each do |item|\n i = m.items.new_item\n i.title = item.title\n @logger.debug \"Adding item '#{item.title}'\"\n i.link = item.link\n i.date = item.date\n end unless old_items.nil?\n end\n save_rss_feed(content)\n end", "def rewrite\n end", "def trickledown_feed\n begin\n associations = [\"uris\"]\n associations.each do |a|\n object = self.send a\n if object.present? && self.feeds.present?\n object.each do |x| \n x.update_column(:feeds, self.feeds) \n x.try(:trickledown_feed)\n end \n end\n end\n rescue Exception => e\n ex_msg = \"Exception during trickledown_feed on: \" + self.class.name \n ExceptionLogger.debug(\"#{ex_msg}\" + \". #{e.to_s}\")\n end\n end", "def rewrite_resources\n replacements = {}\n self.file_mapper.new_names.values.each do |record|\n replacements[record.old_name] = record.name\n end\n self.file_mapper.new_names.values.each do |record|\n record.resave(replacements)\n end\n end", "def trickledown_feed \n begin \n if self.feeds.present? && self.stix_package.present?\n self.stix_package.update_attribute(:feeds, self.feeds) \n end\n rescue Exception => e\n ex_msg = \"Exception during trickledown_feed on: \" + self.class.name \n ExceptionLogger.debug(\"#{ex_msg}\" + \". #{e.to_s}\")\n end\n end", "def feeds=(*new_feeds)\n write_attribute :feeds, interpolate_feeds(new_feeds)\n end", "def trickledown_feed\n begin\n associations = [\"course_of_actions\", \"vulnerabilities\"]\n associations.each do |a|\n object = self.send a\n if object.present? && self.feeds.present?\n object.each do |x| \n x.update_column(:feeds, self.feeds) \n x.try(:trickledown_feed)\n end \n end\n end\n rescue Exception => e\n ex_msg = \"Exception during trickledown_feed on: \" + self.class.name \n ExceptionLogger.debug(\"#{ex_msg}\" + \". #{e.to_s}\")\n end\n end", "def trickledown_feed\n begin\n associations = [\"exploit_targets\", \"attack_patterns\"]\n associations.each do |a|\n object = self.send a\n if object.present? && self.feeds.present?\n object.each do |x| \n x.update_column(:feeds, self.feeds) \n x.try(:trickledown_feed)\n end \n end\n end\n rescue Exception => e\n ex_msg = \"Exception during trickledown_feed on: \" + self.class.name \n ExceptionLogger.debug(\"#{ex_msg}\" + \". #{e.to_s}\")\n end\n end", "def parse_by_feednormalizer(feed_text)\n feed_data = FeedNormalizer::FeedNormalizer.parse feed_text\n feed_data.entries.map do|e|\n metadata = {:author => e.author} if e.author\n {:did=>(e.id || e.urls.join(\" \")), :title=>e.title,:content=>e.content,:basetime=>e.date_published, \n :metadata=>metadata, :uri=>e.urls.join(\" \"), :tag_list=>e.categories.join(\",\")}\n end\n end", "def process_links!(source)\r\n links.each{ |l| source.gsub!(\"[[#{l}]]\", link(l)) }\r\n end", "def rewrite_statement_uris(old_subject, new_subject)\n graph.query(subject: old_subject).each do |st|\n graph.delete(st)\n\n st.subject = new_subject\n st.object = new_subject if st.object == old_subject\n graph.insert(st)\n end\n\n graph.query(object: old_subject).each do |st|\n graph.delete(st)\n\n st.object = new_subject\n graph.insert(st)\n end\n end", "def update_all_feeds\n Feed.all.each do |feed_entry|\n begin\n feed = Feedzirra::Feed.fetch_and_parse(feed_entry.feed_url)\n rescue Exception => e\n Rails.logger.error \"Feedzirra threw an error on feed_entry #{feed_entry.id}: #{e.inspect}\"\n end\n if !feed.blank? && !feed.is_a?(Fixnum) && !feed.entries.blank?\n feed.entries.each do |entry|\n begin\n entry.summary = @html_sanitizer.sanitize(entry.summary) unless entry.summary.blank?\n next if entry.title.blank? || entry.summary.blank? || entry.url.blank? || entry.id.blank? || entry.published.blank?\n guid = Base64.urlsafe_encode64(OpenSSL::Digest::MD5.digest(entry.id))\n unless FeedEntry.exists?(guid: guid)\n FeedEntry.create(title: clean_string(entry.title), summary: clean_string(entry.summary), url: clean_string(entry.url), published_at: entry.published, guid: guid, fetched: false)\n end\n rescue Exception => e\n Rails.logger.error \"Caught an error on inserting feed_entry #{entry.id}: #{e.inspect}\"\n end\n end\n end\n end\n end", "def trickledown_feed\n begin\n associations = [\"indicators\", \"course_of_actions\", \"exploit_targets\", \"ttps\"]\n associations.each do |a|\n object = self.send a\n if object.present? && self.feeds.present?\n object.each do |x| \n x.update_column(:feeds, self.feeds) \n x.try(:trickledown_feed)\n end \n end\n end\n rescue Exception => e\n ex_msg = \"Exception during trickledown_feed on: \" + self.class.name \n ExceptionLogger.debug(\"#{ex_msg}\" + \". #{e.to_s}\")\n end\n end", "def feed_data=(new_feed_data)\n for var in self.instance_variables\n self.instance_variable_set(var, nil)\n end\n @http_headers = {}\n @feed_data = new_feed_data\n unless self.cache_object.nil?\n self.cache_object.feed_data = new_feed_data\n end\n ugly_redirect = FeedTools::XmlHelper.try_xpaths(self.xml_document, [\n \"redirect/newLocation/text()\"\n ], :select_result_value => true)\n if !ugly_redirect.blank?\n for var in self.instance_variables\n self.instance_variable_set(var, nil)\n end\n @http_headers = {}\n @feed_data = nil\n self.href = ugly_redirect\n if FeedTools.feed_cache.nil?\n self.cache_object = nil\n else\n begin\n self.cache_object =\n FeedTools.feed_cache.find_by_href(ugly_redirect)\n rescue RuntimeError => error\n if error.message =~ /sorry, too many clients already/\n warn(\"There are too many connections to the database open.\")\n end\n raise error\n end\n end\n self.update!\n end\n \n # Get these things parsed in the correct order to avoid the retardedly\n # painful corecursion issues.\n self.href\n @links = nil\n @link = nil\n self.links\n self.link\n end", "def replace(from,to)\n #debugger\n if from == :all\n rule_list.each {|rule| rule.name = to.to_s} \n else\n rule_list.each do |rule|\n rule.name = to.to_s if rule.name == from\n end\n end\n end", "def rewrite(response)\n body = ''\n response.each{ |s| body << s.to_s }\n [body.gsub(PATTERN, '\\\\1\\\\2?\\\\3')]\n end", "def trickledown_feed\n begin\n associations = [\"dns_address\", \"dns_domain\"]\n associations.each do |a| \n object = self.send a\n if object.present? && self.feeds.present?\n object.update_column(:feeds, self.feeds) \n object.try(:trickledown_feed)\n end\n end\n rescue Exception => e\n ex_msg = \"Exception during trickledown_feed on: \" + self.class.name \n ExceptionLogger.debug(\"#{ex_msg}\" + \". #{e.to_s}\")\n end\n end", "def trickledown_feed\n begin\n associations = [\"source_socket_address_obj\", \"dest_socket_address_obj\", \"dns_queries\", \"http_sessions\"]\n associations.each do |a| \n object = self.send a\n if object.present? && self.feeds.present?\n if object.class.to_s.include?(\"Collection\")\n object.each do |x|\n x.update_column(:feeds, self.feeds)\n x.try(:trickledown_feed)\n end\n else\n object.update_column(:feeds, self.feeds) \n object.try(:trickledown_feed)\n end\n end\n end\n rescue Exception => e\n ex_msg = \"Exception during trickledown_feed on: \" + self.class.name \n ExceptionLogger.debug(\"#{ex_msg}\" + \". #{e.to_s}\")\n end\n end", "def update\n mod_key(\"permalink\") if data.has_key?(\"permalink\") && @fm_mods[\"permalink\"]\n merge_data\n @content.sub!(FRONTMATTER_REGEXP, to_frontmatter) || @content\n end", "def update_from_feed()\n\t\t\n\t@links = Link.all \n\n\[email protected] do |link| \n\n\t\tfeed = Feedzirra::Feed.fetch_and_parse(link.url)\n\n\t\tputs \"pulling feeds\"\n\t\tfeed.entries.each do |entry|\n\n\t\t\tif entry.published > link.updated_at\n\n\t\t\t\tif entry.url =~ /^#{URI::regexp}$/\n\t\t\t\t\tfind_keywords(entry.url, link.tags)\n\t\t\t\t\tputs entry.url\t\n\t\t\t\telse\n\t\t\t\t\tputs \"bad url\"\n\t\t\t\t\tputs entry.url\t\n\t\t\t\tend\n\t\t\t\t\t\n\t\t\tend\n\t\tend\n\n\tend\n\nend", "def refresh\n FeedSource.find(params[:feed_source_id]).refresh\n feed_sources = params[:feed_sources]\n @feed_source_titles = {}\n FeedSource.find(feed_sources).each { |source| @feed_source_titles[source.id] = source.title}\n @feed_items = FeedItem.where(\"feed_source_id IN (?)\", feed_sources).order(pub_date: :desc).limit(20).offset(0)\n @feed_items = @feed_items.sort_by{ |item| item.pub_date.to_i }.reverse\n render :index\n end", "def rewrite before, after, reg = /\\#\\{(\\w+)\\}/, reg2 = '\\1'\n File.open(after, 'w') do |a|\n File.open(before) do |b|\n b.each do |line|\n a << line.gsub(reg) do\n if reg2.include? '\\1'\n reg2.gsub(%r!\\\\1!, Object.const_get($1))\n else\n reg2\n end\n end\n end\n end\n end\n end", "def rewrite before, after, reg = /\\#\\{(\\w+)\\}/, reg2 = '\\1'\n File.open(after, 'w') do |a|\n File.open(before) do |b|\n b.each do |line|\n a << line.gsub(reg) do\n if reg2.include? '\\1'\n reg2.gsub(%r!\\\\1!, Object.const_get($1))\n else\n reg2\n end\n end\n end\n end\n end\n end", "def rewrite before, after, reg = /\\#\\{(\\w+)\\}/, reg2 = '\\1'\n File.open(after, 'w') do |a|\n File.open(before) do |b|\n b.each do |line|\n a << line.gsub(reg) do\n if reg2.include? '\\1'\n reg2.gsub(%r!\\\\1!, Object.const_get($1))\n else\n reg2\n end\n end\n end\n end\n end\n end", "def rewrite before, after, reg = /\\#\\{(\\w+)\\}/, reg2 = '\\1'\n File.open(after, 'w') do |a|\n File.open(before) do |b|\n b.each do |line|\n a << line.gsub(reg) do\n if reg2.include? '\\1'\n reg2.gsub(%r!\\\\1!, Object.const_get($1))\n else\n reg2\n end\n end\n end\n end\n end\n end", "def rewrite before, after, reg = /\\#\\{(\\w+)\\}/, reg2 = '\\1'\n File.open(after, 'w') do |a|\n File.open(before) do |b|\n b.each do |line|\n a << line.gsub(reg) do\n if reg2.include? '\\1'\n reg2.gsub(%r!\\\\1!, Object.const_get($1))\n else\n reg2\n end\n end\n end\n end\n end\n end", "def mergeNewsFeed\n newsFeed = aviator.merge flightglobal\n cleanNewsFeed= JSON.pretty_generate(newsFeed).gsub(\":\", \" =>\")\n cleanNewsFeed\nend", "def change_datalinks_for_processor(doc, processor_name, new_name)\n # loop through all datalinks containing processor_name as sink or source\n # at least one data link should be found\n dl_source_path = 'source/processor'\n dl_sink_path = 'sink/processor'\n datalinks = doc.root.elements[Top_dataflow].elements[\"datalinks\"]\n datalinks.children.each do |x|\n if x.class == REXML::Element\n if !x.elements[dl_source_path].nil? &&\n x.elements[dl_source_path].text == processor_name\n x.elements[dl_source_path].text = new_name\n end\n if !x.elements[dl_sink_path].nil? &&\n x.elements[dl_sink_path].text == processor_name\n x.elements[dl_sink_path].text = new_name\n end\n end\n end\n end", "def feed_sorter\n\t\[email protected] do |url|\n\t\t\topen(url) do |rss|\n \t\t\tfeed = RSS::Parser.parse(rss)\n\t\t\t\n\t\t\t\tcase \n\t\t\t\twhen feed.feed_type == \"rss\"\n\t\t\t\t\trss_parser(feed)\n\t\t\t\twhen feed.feed_type == \"atom\"\n\t\t\t\t\tatom_parser(feed) \n\t\t\t\tend \n\t\t\tend \n\t\tend \n\tend", "def rewrite_rdf(turn_off_safety=false)\n unless((ENV['i_know_what_i_am_doing'].yes?) || turn_off_safety)\n puts \"WARNING: Rewriting the RDF will ERASE all data that does not come from the Talia API\"\n puts \"This includes ALL SWICKY notebooks\"\n puts \n puts \"To proceed run this task again, and give the following option:\"\n puts \"i_know_what_i_am_doing=yes\"\n raise ArgumentError, \"Can't proceed without confirmation.\"\n end\n flush_rdf\n # We'll get all data from single query.\n fat_rels = TaliaCore::SemanticRelation.find(:all, :joins => fat_record_joins,\n :select => fat_record_select)\n fat_rels.each do |rec|\n subject = N::URI.new(rec.subject_uri)\n predicate = N::URI.new(rec.predicate_uri)\n object = if(rec.object_uri)\n N::URI.new(rec.object_uri)\n else\n rec.property_value\n end\n ActiveRDF::FederationManager.add(subject, predicate, object)\n yield if(block_given?)\n end\n\n # Rewriting all the \"runtime type\" rdf triples\n # We'll select the type as something else, so that it doesn't try to do\n # STI instantiation (which would cause this to blow for classes that\n # are defined outside the core.\n TaliaCore::ActiveSource.find(:all, :select => 'uri, type AS runtime_type').each do |src|\n type = (src.runtime_type || 'ActiveSource')\n ActiveRDF::FederationManager.add(src, N::RDF.type, N::TALIA + type)\n yield if(block_given?)\n end\n end", "def rewrite\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 32)\n return_value = RewriteReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n rew2 = nil\n rew = nil\n preds = nil\n list_of_rew = []\n list_of_preds = []\n list_of_predicated = []\n last = nil\n predicated = nil\n predicated = nil\n\n tree_for_rew2 = nil\n tree_for_rew = nil\n tree_for_preds = nil\n stream_SEMPRED = ANTLR3::AST::RewriteRuleTokenStream.new(@adaptor, \"token SEMPRED\")\n stream_REWRITE = ANTLR3::AST::RewriteRuleTokenStream.new(@adaptor, \"token REWRITE\")\n stream_rewrite_alternative = ANTLR3::AST::RewriteRuleSubtreeStream.new(@adaptor, \"rule rewrite_alternative\")# - - - - @init action - - - -\n\n \tfirst_token = @input.look(1)\n\n\n begin\n # at line 352:2: ( (rew+= '->' preds+= SEMPRED predicated+= rewrite_alternative )* rew2= '->' last= rewrite_alternative -> ( ^( $rew $preds $predicated) )* ^( $rew2 $last) | )\n alt_72 = 2\n look_72_0 = @input.peek(1)\n\n if (look_72_0 == REWRITE) \n alt_72 = 1\n elsif (look_72_0 == T__71 || look_72_0.between?(T__82, T__83)) \n alt_72 = 2\n else\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\n nvae = NoViableAlternative(\"\", 72, 0)\n raise nvae\n end\n case alt_72\n when 1\n # at line 352:4: (rew+= '->' preds+= SEMPRED predicated+= rewrite_alternative )* rew2= '->' last= rewrite_alternative\n # at line 352:4: (rew+= '->' preds+= SEMPRED predicated+= rewrite_alternative )*\n loop do #loop 71\n alt_71 = 2\n look_71_0 = @input.peek(1)\n\n if (look_71_0 == REWRITE) \n look_71_1 = @input.peek(2)\n\n if (look_71_1 == SEMPRED) \n alt_71 = 1\n\n end\n\n end\n case alt_71\n when 1\n # at line 352:5: rew+= '->' preds+= SEMPRED predicated+= rewrite_alternative\n rew = match(REWRITE, TOKENS_FOLLOWING_REWRITE_IN_rewrite_2480) \n if @state.backtracking == 0\n stream_REWRITE.add(rew)\n end\n list_of_rew << rew\n\n preds = match(SEMPRED, TOKENS_FOLLOWING_SEMPRED_IN_rewrite_2484) \n if @state.backtracking == 0\n stream_SEMPRED.add(preds)\n end\n list_of_preds << preds\n\n @state.following.push(TOKENS_FOLLOWING_rewrite_alternative_IN_rewrite_2488)\n predicated = rewrite_alternative\n @state.following.pop\n if @state.backtracking == 0\n stream_rewrite_alternative.add(predicated.tree)\n end\n list_of_predicated << predicated.tree\n\n\n else\n break #loop 71\n end\n end\n rew2 = match(REWRITE, TOKENS_FOLLOWING_REWRITE_IN_rewrite_2496) \n if @state.backtracking == 0\n stream_REWRITE.add(rew2)\n end\n @state.following.push(TOKENS_FOLLOWING_rewrite_alternative_IN_rewrite_2500)\n last = rewrite_alternative\n @state.following.pop\n if @state.backtracking == 0\n stream_rewrite_alternative.add(last.tree)\n end\n # AST Rewrite\n # elements: predicated, rew, last, preds, rew2\n # token labels: rew2\n # rule labels: return_value, last\n # token list labels: rew, preds\n # rule list labels: predicated\n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_rew2 = token_stream(\"token rew2\", rew2)\n stream_rew = token_stream(\"token rew\", list_of_rew)\n stream_preds = token_stream(\"token preds\", list_of_preds)\n stream_return_value = return_value ? subtree_stream(\"rule return_value\", return_value.tree) : subtree_stream(\"token return_value\")\n stream_last = last ? subtree_stream(\"rule last\", last.tree) : subtree_stream(\"token last\")\n stream_predicated = subtree_stream(\"token predicated\", list_of_predicated)\n root_0 = @adaptor.create_flat_list!\n # 354:9: -> ( ^( $rew $preds $predicated) )* ^( $rew2 $last)\n # at line 354:12: ( ^( $rew $preds $predicated) )*\n while stream_predicated.has_next? || stream_rew.has_next? || stream_preds.has_next?\n # at line 354:12: ^( $rew $preds $predicated)\n root_1 = @adaptor.create_flat_list!\n root_1 = @adaptor.become_root(stream_rew.next_node, root_1)\n\n @adaptor.add_child(root_1, stream_preds.next_node)\n @adaptor.add_child(root_1, stream_predicated.next_tree)\n\n @adaptor.add_child(root_0, root_1)\n\n end\n\n stream_predicated.reset();\n stream_rew.reset();\n stream_preds.reset();\n # at line 354:40: ^( $rew2 $last)\n root_1 = @adaptor.create_flat_list!\n root_1 = @adaptor.become_root(stream_rew2.next_node, root_1)\n\n @adaptor.add_child(root_1, stream_last.next_tree)\n\n @adaptor.add_child(root_0, root_1)\n\n\n\n return_value.tree = root_0\n\n end\n when 2\n root_0 = @adaptor.create_flat_list!\n\n\n # at line 356:2: \n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look(-1)\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing(root_0)\n @adaptor.set_token_boundaries(return_value.tree, return_value.start, return_value.stop)\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node!(@input, return_value.start, @input.look(-1), re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 32)\n\n end\n \n return return_value\n end", "def postprocess\n @@morphs.each do |morph|\n # this does a simple replacement for character groups, so that:\n # \"(|A)\" becomes the equivalent of \"(#{Rule['A'].chars.join('|')})\"\n morph.from.gsub!(/(\\||\\&)([A-Z])/) { Rule[$2].chars.join($1 == '|' ? $1 : '') }\n morph.from = Regexp.new(morph.from)\n end\n end", "def generic_url_rewriter \n env = Request.new(:method => :get, :url => Steam.config[:request_url]).env\n UrlRewriter.new(ActionController::Request.new(env), {})\n end", "def update_from_feed(feed_url)\n\t\tputs \"pulling feeds\"\n\t\tfeed = Feedzirra::Feed.fetch_and_parse(feed_url)\n\t\t# feed.last_modified - if it's been modified since last time\n\t\tfeed.entries.each do |entry|\n\t\t\t# if the post occured after it was last checked\n\t\t\tfind_keywords(entry.url)\n\t\t\tputs entry.url\n\t\t\t# call the keyword check and save on the actual post url\t\n\t\tend\nend", "def rewrite_reference_tokens\n each_term do |term|\n next unless is?(term, :reference)\n term[:token] = yield term[:token]\n end\n end", "def sort\n params[:feeds].each_with_index do |id, index|\n Feed.update_all(['position=?', index+1], ['id=?', id])\n end\n render :nothing => true\n end", "def cache_feeds\n puts \"Caching feeds... (can be slow)\"\n feeds = Conf.feeds.map do |uri|\n # silly to need this, but if the feed fails to fetch,\n # don't kill the ruby thread ...\n begin\n feed = FeedTools::Feed.open( uri )\n { :uri => uri, :title => feed.title, \n :items => feed.items.map { |item| { :title => item.title, :author => item.author.name, :published => item.published, :link => item.link } } }\n rescue FeedTools::FeedAccessError\n puts uri\n next\n end\n end\n feeds.each { |feed|\n new = CachedFeed.find_or_initialize_by_uri( feed[:uri] )\n new.parsed_feed = feed\n new.save!\n }\n end", "def merge! other_feed\n [:id, :title, :subtitle, :updated, :rights, :logo, :icon].each do |p|\n if (v = other_feed.get(p))\n set p, v\n end\n end\n\n [:links, :categories, :authors, :contributors].each do |p|\n other_feed.get(p).each do |e|\n get(p) << e\n end\n end\n\n @extensions = other_feed.extensions\n\n merge_entries! other_feed\n end", "def rewrite!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 8)\n\n type = REWRITE\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 14:11: '->'\n match(\"->\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 8)\n\n end", "def rewrite\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 32 )\n return_value = RewriteReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n rew2 = nil\n rew = nil\n preds = nil\n last = nil\n predicated = nil\n list_of_rew = []\n list_of_preds = []\n list_of_predicated = []\n\n tree_for_rew2 = nil\n tree_for_rew = nil\n tree_for_preds = nil\n stream_SEMPRED = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token SEMPRED\" )\n stream_REWRITE = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token REWRITE\" )\n stream_rewrite_alternative = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule rewrite_alternative\" )# - - - - @init action - - - -\n\n \tfirst_token = @input.look(1)\n\n\n begin\n # at line 343:2: ( (rew+= '->' preds+= SEMPRED predicated+= rewrite_alternative )* rew2= '->' last= rewrite_alternative -> ( ^( $rew $preds $predicated) )* ^( $rew2 $last) | )\n alt_72 = 2\n look_72_0 = @input.peek( 1 )\n\n if ( look_72_0 == REWRITE )\n alt_72 = 1\n elsif ( look_72_0 == T__71 || look_72_0.between?( T__82, T__83 ) )\n alt_72 = 2\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n raise NoViableAlternative( \"\", 72, 0 )\n end\n case alt_72\n when 1\n # at line 343:4: (rew+= '->' preds+= SEMPRED predicated+= rewrite_alternative )* rew2= '->' last= rewrite_alternative\n # at line 343:4: (rew+= '->' preds+= SEMPRED predicated+= rewrite_alternative )*\n while true # decision 71\n alt_71 = 2\n look_71_0 = @input.peek( 1 )\n\n if ( look_71_0 == REWRITE )\n look_71_1 = @input.peek( 2 )\n\n if ( look_71_1 == SEMPRED )\n alt_71 = 1\n\n end\n\n end\n case alt_71\n when 1\n # at line 343:5: rew+= '->' preds+= SEMPRED predicated+= rewrite_alternative\n rew = match( REWRITE, TOKENS_FOLLOWING_REWRITE_IN_rewrite_2475 )\n if @state.backtracking == 0\n stream_REWRITE.add( rew )\n end\n list_of_rew << rew\n\n preds = match( SEMPRED, TOKENS_FOLLOWING_SEMPRED_IN_rewrite_2479 )\n if @state.backtracking == 0\n stream_SEMPRED.add( preds )\n end\n list_of_preds << preds\n\n @state.following.push( TOKENS_FOLLOWING_rewrite_alternative_IN_rewrite_2483 )\n predicated = rewrite_alternative\n @state.following.pop\n if @state.backtracking == 0\n stream_rewrite_alternative.add( predicated.tree )\n end\n list_of_predicated << predicated.tree\n\n\n else\n break # out of loop for decision 71\n end\n end # loop for decision 71\n rew2 = match( REWRITE, TOKENS_FOLLOWING_REWRITE_IN_rewrite_2491 )\n if @state.backtracking == 0\n stream_REWRITE.add( rew2 )\n end\n @state.following.push( TOKENS_FOLLOWING_rewrite_alternative_IN_rewrite_2495 )\n last = rewrite_alternative\n @state.following.pop\n if @state.backtracking == 0\n stream_rewrite_alternative.add( last.tree )\n end\n # AST Rewrite\n # elements: last, predicated, preds, rew, rew2\n # token labels: rew2\n # rule labels: return_value, last\n # token list labels: rew, preds\n # rule list labels: predicated\n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_rew2 = token_stream( \"token rew2\", rew2 )\n stream_rew = token_stream( \"token rew\", list_of_rew )\n stream_preds = token_stream( \"token preds\", list_of_preds )\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n stream_last = last ? subtree_stream( \"rule last\", last.tree ) : subtree_stream( \"token last\" )\n stream_predicated = subtree_stream( \"token predicated\", list_of_predicated )\n root_0 = @adaptor.create_flat_list\n # 345:9: -> ( ^( $rew $preds $predicated) )* ^( $rew2 $last)\n # at line 345:12: ( ^( $rew $preds $predicated) )*\n while stream_predicated.has_next? || stream_preds.has_next? || stream_rew.has_next?\n # at line 345:12: ^( $rew $preds $predicated)\n root_1 = @adaptor.create_flat_list\n root_1 = @adaptor.become_root( stream_rew.next_node, root_1 )\n\n @adaptor.add_child( root_1, stream_preds.next_node )\n @adaptor.add_child( root_1, stream_predicated.next_tree )\n\n @adaptor.add_child( root_0, root_1 )\n\n end\n\n stream_predicated.reset();\n stream_preds.reset();\n stream_rew.reset();\n # at line 345:40: ^( $rew2 $last)\n root_1 = @adaptor.create_flat_list\n root_1 = @adaptor.become_root( stream_rew2.next_node, root_1 )\n\n @adaptor.add_child( root_1, stream_last.next_tree )\n\n @adaptor.add_child( root_0, root_1 )\n\n\n\n return_value.tree = root_0\n\n end\n when 2\n root_0 = @adaptor.create_flat_list\n\n\n # at line 347:2: \n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 32 )\n\n end\n \n return return_value\n end", "def driveNameReplace(original, name)\n folder_path = File.dirname(__FILE__) + \"/Cyclo\"\n Dir.glob(folder_path + \"/*\").sort.each do |path|\n f = File.open(path, \"r+\")\n doc = Nokogiri::XML(f)\n doc.search(\".//image\").each do |node|\n #puts node['href']\n newLink = node['href'].split('/').last\n #complete = \"file:///Users/freelance/Google Drive/Specialized Docs/_photosBIKE/#{newLink}\"\n complete = \"file:///Users/freelance/Google Drive/Specialized Docs/dump_output/#{newLink}\"\n puts complete\n #node['href'] = node['href'].gsub(original, name)\n node['href'] = complete\n end\n f.close()\n o = File.new(path, \"w\")\n o.write(doc)\n o.close()\n\n end\nend", "def generic_url_rewriter \n env = Request.env_for('http://localhost')\n UrlRewriter.new(ActionController::Request.new(env), {})\n end", "def map(rss_file_or_url, override_mapping=nil)\n open(rss_file_or_url) do |feed|\n @rss = RSS::Parser.parse(feed.read, false)\n super(rss.items.collect, override_mapping)\n end\n end", "def refresh\n Feed.update_all\n # @feeds = Feed.all\n # feed_array = []\n # @feeds.each do |f|\n # EntryFeed.create_from_feed(f)\n # end\n\n redirect_to blogs_path\n flash[:notice] = \"Blogs successfully updated\"\n end", "def update\n @list = List.find(params[:id])\n \n @lists = current_user.lists\n @feeds = current_user.feeds\n \n # Case where feed is dropped\n puts params[:id]\n if(params[:feed_title]!=nil || params[:feed_id]!=nil)\n if(params[:feed_title]==nil)\n params[:feed_title] = Feed.find(params[:feed_id]).title\n end\n respond_to do |format|\n if(@list.add_feed(@list.id,params[:feed_title]))\n format.html { redirect_to(@list, :notice => 'List was successfully updated.') }\n format.xml { head :ok }\n format.js {render :layout => false}\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @list.errors, :status => :unprocessable_entity }\n format.js {render :layout => false}\n end\n end\n # Case where list is updated\n else\n @list.name = params[:list][:name]\n puts \"params!!!!!!!\"\n puts params[:list][:name]\n puts @list.convert_titles_to_string(params[:feeds])\n @list.feeds_by_id = @list.convert_titles_to_string(params[:feeds])\n respond_to do |format|\n if @list.save\n flash[:notice] = \"List successfully updated\"\n format.html { redirect_to(@list, :notice => 'List was successfully updated.') }\n format.xml { head :ok }\n format.js {render :layout => false}\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @list.errors, :status => :unprocessable_entity }\n format.js {render :layout => false}\n end\n end\n end\n end", "def regenerate_feed!\n user_set = active_followed_users + [@user.id]\n\n stories = Story.for_user(@user).order('updated_at DESC').where(user_id: user_set).includes(:user, :target, :substories).limit(FRESH_FETCH_SIZE)\n stories.each {|story| add! story }\n end", "def trickledown_feed\n begin\n associations = [\"indicators\"]\n associations.each do |a|\n object = self.send a\n if object.present? && self.feeds.present?\n object.each do |x| \n x.update_column(:feeds, self.feeds) \n x.try(:trickledown_feed)\n end \n end\n end\n rescue Exception => e\n ex_msg = \"Exception during trickledown_feed on: \" + self.class.name \n ExceptionLogger.debug(\"#{ex_msg}\" + \". #{e.to_s}\")\n end\n end", "def parse_feed\n remove_previous_entries\n @items = @content[\"rss\"][\"channel\"][\"item\"]\n if [email protected]?\n for item in @items do\n item[\"pubDate\"] ||= \"\"\n item[\"creator\"] ||= \"\"\n item[\"guid\"] ||= \"\"\n item[\"title\"] ||= \"\"\n item[\"description\"] ||= \"\"\n clean_content(item[\"encoded\"] ||= \"\")\n item[\"link\"] ||= \"\"\n params = { \n :pubdate => item[\"pubDate\"], \n :creator => item[\"creator\"], \n :guid => relative_link(item[\"guid\"]), \n :title => item[\"title\"], \n :description => item[\"description\"], \n :content => @content, \n :link => relative_link(item[\"link\"])\n }\n insert_entry(params)\n end\n end\n end", "def replacements; end", "def trickledown_feed\n begin\n associations = [\"observables\", \"parameter_observables\"]\n associations.each do |a|\n object = self.send a\n if object.present? && self.feeds.present?\n object.each do |x| \n x.update_column(:feeds, self.feeds) \n x.try(:trickledown_feed)\n end \n end\n end\n rescue Exception => e\n ex_msg = \"Exception during trickledown_feed on: \" + self.class.name \n ExceptionLogger.debug(\"#{ex_msg}\" + \". #{e.to_s}\")\n end\nend", "def create\n @personal_blog = PersonalBlog.new(params[:personal_blog])\n @personal_blog.feed = @personal_blog.feed.gsub(/^feed/, 'http')\n\n respond_to do |format|\n if @personal_blog.save\n format.html { redirect_to(@personal_blog) }\n format.xml { render :xml => @personal_blog, :status => :created, :location => @personal_blog }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @personal_blog.errors, :status => :unprocessable_entity }\n end\n end\n end", "def fix_image_links( file_name )\r\n\tlines = File.readlines(file_name)\r\n lines.each do |line| \r\n \tline.gsub!(/processed_files/, File.basename( file_name, '.htm') + \"_files\")\r\n\tend\r\n\tFile.open( file_name, 'w') { |f| f.write lines }\r\nend", "def news_list_to_rss(news)\n aux = \"\"\n news.each{|n|\n aux << news_to_rss(n)\n }\n aux\nend", "def generate_links rss_file, basedir='/'\n\tbasedir = \"/#{basedir}\" unless basedir.start_with? '/'\n\tbasedir = \"#{basedir}/\" unless basedir.end_with? '/'\n\n\tdir = File.dirname(File.expand_path(rss_file))\n\trss = File.read(rss_file)\n\n\tfeed = RSS::Parser.parse(rss, false)\n\n\titem_map = Hash[*feed.items.map{|item|\n\t\tlink = item.link.split('/').last\n\t\t[link, {:item => item, :filename => item.pubDate.strftime(\"source/#{link}/index.html\")}]\n\t}.flatten]\n\n\tfeed.items.each do |item|\n\t\tpost_uri = URI.parse(item.link)\n\n\t\tpermalink = item.link.split('/').last\n\t\tfilename = item_map[permalink][:filename]\n\t\tdirname = File.dirname(filename)\n\t\thref = item.pubDate.strftime(\"#{basedir}%Y/%m/%d/#{permalink}/\")\n\t\ttitle = item.title\n\n\t\tFileUtils.mkdir_p(dirname)\n\t\toutfile = File.new(filename, \"w\")\n\t\toutfile.write <<-HTML\n\t\t<!DOCTYPE html>\n\t\t<html>\n\t\t\t<head>\n\t\t\t\t<title>#{title}</title>\n\t\t\t\t<meta http-equiv=\"Refresh\" content=\"0; url=#{href}\">\n\t\t\t\t<link href=\"#{basedir}stylesheets/screen.css\" rel=\"stylesheet\" type=\"text/css\">\n\t\t\t</head>\n\t\t\t<body>\n\t\t\t\t<a style=\"color: inherit; text-decoration: none\" href=\"#{href}\">#{title}</a>\n\t\t\t</body>\n\t\t</html>\n\t\tHTML\n\t\toutfile.close\n\tend\n\n\tnil\nend", "def change_datalinks_for_port(doc, port_name, new_name, port_type=1)\n # loop through all datalinks containing port_name as source\n # at least one data link should be found\n dl_port_path = 'source/port'\n if port_type == 2\n dl_port_path = 'sink/port'\n end\n datalinks = doc.root.elements[Top_dataflow].elements[\"datalinks\"]\n datalinks.children.each do |x|\n if x.class == REXML::Element\n if x.elements[dl_port_path].text == port_name\n x.elements[dl_port_path].text = new_name\n end\n end\n end\n end", "def patch_url_from_field(syms = [])\n notify \"URL replace, old : #{@url}\"\n syms.each do |sym|\n pattern = sym.id2name\n if @url =~ /#{pattern}/\n @url.gsub!(%r{#{pattern}=([^&]*)},\"#{pattern}=\" + @fields[sym])\n else\n @url += \"&#{pattern}=#{@fields[sym]}\"\n end\n end\n notify \"URL replace result : #{@url}\"\n end", "def generate_posts rss_file, basedir='/'\n\tbasedir = \"/#{basedir}\" unless basedir.start_with? '/'\n\tbasedir = \"#{basedir}/\" unless basedir.end_with? '/'\n\n\tdir = File.dirname(File.expand_path(rss_file))\n\trss = File.read(rss_file)\n\n\tfeed = RSS::Parser.parse(rss, false)\n\n\titem_map = Hash[*feed.items.map{|item|\n\t\tlink = item.link.split('/').last\n\t\t[link, {:item => item, :filename => item.pubDate.strftime(\"source/_posts/%Y-%m-%d-#{link}.html\")}]\n\t}.flatten]\n\n\tfeed.items.each do |item|\n\t\tpost_uri = URI.parse(item.link)\n\n\t\tpermalink = item.link.split('/').last\n\t\tfilename = item_map[permalink][:filename]\n\t\tdate = item.pubDate\n\t\theader = {\n\t\t\t'layout' => \"post\",\n\t\t\t'title' => item.title,\n\t\t\t'date' => date,\n\t\t\t'comments' => true,\n\t\t\t'categories' => item.categories.select{|cat| cat.domain == \"tag\"}.map{|cat| cat.content},\n\t\t\t'published' => !post_uri.path.start_with?('/private/')\n\t\t}\n\n\t\tputs \"Generating #{filename}#{header['published'] ? '' : ' (unpublished)'}\"\n\n\t\timgdir = \"source/images/#{date.strftime('%Y/%m/%d')}/#{permalink}/\"\n\t\tserverdir = '/' + imgdir.split('/', 2).last\n\t\tFileUtils.mkdir_p(imgdir)\n\n\t\toutfile = File.new(filename, \"w\")\n\t\toutfile.puts header.to_yaml\n\t\toutfile.puts \"---\"\n\n\t\t# Fix up images and video\n\t\thtml = Nokogiri::HTML(\"<div id=\\\"import_#{permalink}\\\">#{EscapeUtils.unescape_html(item.content_encoded)}</div>\")\n\t\timages = html.css('img')\n\t\tfix_sources html, date.strftime(\"#{dir}/image/%Y/%m\"), imgdir, serverdir\n\t\tfix_sources html, nil, imgdir, serverdir, 'source'\n\t\tfix_sources html, nil, nil, nil, 'video', 'poster' do nil end\n\n\t\t# Fix up links to other posts\n\t\tfix_sources html, nil, nil, nil, 'a', 'href' do |tag, href|\n\t\t\tlink_uri = URI.parse(href)\n\t\t\tnext unless post_uri.host == link_uri.host\n\n\t\t\tlink_shortname = href.split('/').last.split('#').first\n\t\t\tif item_map.include? link_shortname\n\t\t\t\tlink = item_map[link_shortname][:item]\n\t\t\t\thref = link.pubDate.strftime(\"#{basedir}%Y/%m/%d/#{link_shortname}/\")\n\t\t\t\thref += \"##{link_uri.fragment}\" if link_uri.fragment\n\t\t\t\tputs \"\\t\\tUsing #{link.title} (#{href})\"\n\t\t\telse\n\t\t\t\tputs \"\\t######## No match found for #{href}\"\n\t\t\tend\n\n\t\t\thref\n\t\tend\n\n\t\toutfile.puts html.css(\"div#import_#{permalink}\").first.children.map{|node| node.to_html}.join\n\t\toutfile.close\n\tend\n\n\tnil\nend", "def rename(old, new)\n args = [\"old=#{old.uri_escape}\", \"new=#{new.uri_escape}\"]\n get('/api/tags/rename?' << args.join('&amp;'))\n nil\n end", "def normalize!\n doc = xmldoc\n nodes doc.xpath(ITEMS_XPATH) do |node|\n content_node = node.xpath(ITEM_FILE_XPATH).first\n src = content_node.attributes['src'].to_s\n\n src = URI(src)\n item = get_item(src.to_s)\n\n filepath = URI(item.normalized_hashed_path(:relative_to => self))\n if src.fragment\n filepath.fragment = src.fragment\n end\n\n content_node['src'] = filepath.to_s\n end\n\n\n root = read_xml\n\n # Replace the node, bit messy\n node = root.xpath(ROOT_XPATH).first\n doc_partial = Nokogiri::XML(doc.to_s)\n node.replace(doc_partial.root)\n\n # Write it back\n data = root.to_s\n write(data)\n end", "def update\n @feed.attributes = params[:feed]\n\n respond_to do |format|\n if @feed.save(user: current_user)\n format.html { render 'admin/shared/update' }\n format.xml { head :ok }\n else\n @feed.reload # to retrieve the old title\n format.html { render template: 'admin/shared/edit', locals: { record: @feed }, status: :unprocessable_entity }\n format.xml { render xml: @feed.errors, status: :unprocessable_entity }\n end\n end\n end", "def rewrite\n @corrections.each do |correction|\n begin\n @source_rewriter.transaction do\n correction.call(self)\n end\n rescue ErrorWithAnalyzedFileLocation => e\n raise e unless e.cause.is_a?(::Parser::ClobberingError)\n end\n end\n\n @source_rewriter.process\n end", "def news_to_rss(news)\n domain = news.domain\n news = {}.merge(news) # Copy the object so we can modify it as we wish.\n news[\"ln_url\"] = \"#{SiteUrl}/news/#{news[\"id\"]}\"\n news[\"url\"] = news[\"ln_url\"] if !domain\n\n H.item {\n H.title {\n H.entities news[\"title\"]\n } + \" \" +\n H.guid {\n H.entities news[\"url\"]\n } + \" \" +\n H.link {\n H.entities news[\"url\"]\n } + \" \" +\n H.description {\n \"<![CDATA[\" +\n H.a(:href=>news[\"ln_url\"]) {\n \"Comments\"\n } + \"]]>\"\n } + \" \" +\n H.comments {\n H.entities news[\"ln_url\"]\n }\n }+\"\\n\"\nend", "def refresh(force=false)\n # check headers and etag and last modified\n raise \"Missing feed_url\" if feed_url.nil?\n ff = Feedbase::FetchFeed.new(feed_url)\n headers = ff.headers\n if !force \n if last_etag && (headers[:etag] == last_etag)\n puts \"-- #{feed_url} -- ETag cache hit\"\n return\n end\n end\n data = ff.fetch \n params = data[:feed_params].merge(:alpha_title => make_alpha_title(data[:feed_params][:title])) \n if params[:feed_url] != self[:feed_url]\n if x = self.class.filter(:feed_url => params[:feed_url]).first\n raise Redirected.new(\"Redirected to existing feed: #{x.feed_url}\")\n end\n end\n params.delete(:feed_url) \n begin Sequel::DatabaseError\n update params\n rescue StandardError # PGError\n puts \"The offending record is #{self.inspect}\"\n raise\n end\n\n Feedbase::FeedDownload.create({feed_id: feed_id}.merge(data[:download_params])) \n items_created = data[:items].\n select {|item| Feedbase::Item[:guid => item[:guid]].nil?}.\n map { |item|\n params = {\n feed_id: feed_id,\n title: item[:title].encode(\"utf-8\"), \n guid: item[:guid], \n link: item[:link],\n content: item[:content],\n author: item[:author],\n word_count: item[:word_count],\n pub_date: item[:pub_date]\n }\n Feedbase::Item.create params\n }\n # caller can extract an item count from this\n items_created\n end", "def update_from_feed(auth_feed=nil)\n # If there are existing entries, then create a feed \n # object using the most recent entry's data and use Feedzirra's update method\n # to only fetch those new entries\n if entries.any?\n feed = Feedzirra::Feed.update(create_feed_for_update)\n add_entries(feed.new_entries) if valid_parse_result(feed) && !feed.is_a?(Array) && feed.updated?\n else\n # Fetch whole feed (may not be entire feed - depends on source)\n feed = auth_feed || Feedzirra::Feed.fetch_and_parse(feed_url_s)\n # Can return error status code on parse error\n add_entries(feed.entries) if valid_parse_result(feed)\n end\n # Save latest feed attributes for updates\n if valid_parse_result(feed)\n update_attributes(:etag => feed.etag, :last_modified => feed.last_modified, :feed_url_s => feed.feed_url)\n end\n end", "def fix_dates( data )\n\n ## check for missing / no dates \n ## examples\n ## - rubytogether feed @ https://rubytogether.org/news.xml\n data.items.each do |item|\n if item.updated.nil? &&\n item.published.nil?\n ## try to get date from slug in url\n ## e.g. /news/2019-10-17-growing-ruby-together\n if (m=FIX_DATE_SLUG_RE.match( item.url ))\n ## todo/fix: make sure DateTime gets utc (no timezone/offset +000)\n published = DateTime.new( m[:year].to_i(10),\n m[:month].to_i(10),\n m[:day].to_i(10) )\n item.published_local = published\n item.published = published\n end\n end\n end\n\n \n ## check if all updated dates are the same (uniq count is 1)\n ## AND if all published dates are present\n ## than assume \"fake\" updated dates and nullify updated dates\n ## example real-world \"messed-up\" feeds include:\n ## - https://bundler.io/blog/feed.xml\n ## - https://dry-rb.org/feed.xml\n ##\n ## todo/check - limit to atom feed format only - why? why not?\n\n count = data.items.size\n count_published = data.items.reduce( 0 ) {|count,item| count += 1 if item.published; count }\n\n if count == count_published\n uniq_count_updated = 0\n last_updated = nil\n\n data.items.each do |item|\n uniq_count_updated += 1 if item.updated != last_updated\n last_updated = item.updated\n end\n\n if uniq_count_updated == 1\n puts \"bingo!! nullify all updated dates\"\n ## todo/fix: log report updated date fix!!!!\n data.items.each do |item|\n item.updated = nil\n item.updated_local = nil\n end\n end\n end\n end", "def transforms; end", "def transformations; end", "def fixDupePeople\n puts \"Scanning for unconnected authors.\"\n connectAuthors # make sure all newly converted (or reconverted) items have author->people links\n\n puts \"Scanning for referenced people.\"\n referencedPeople = Set.new\n ItemAuthor.where(Sequel.lit(\"person_id is not null\")).each { |row|\n row[:person_id] and referencedPeople << row[:person_id]\n }\n\n puts \"Scanning for duplicate people.\"\n emailToPeople = Hash.new { |h,k| h[k] = Set.new }\n Person.where(Sequel.lit(\"attrs->'$.email' is not null\")).each { |person|\n attrs = JSON.parse(person.attrs)\n next if attrs['forwarded_to']\n Set.new([attrs['email']] + (attrs['prev_emails'] || [])).each { |email|\n emailToPeople[email.downcase] << person.id\n }\n }\n\n puts \"Change phase starting.\"\n DB.transaction {\n emailToPeople.each { |email, people|\n next if people.size == 1\n\n keep = people & referencedPeople\n keep.empty? and keep << people.to_a.sort[0]\n\n toss = people - keep\n if !toss.empty?\n puts \"#{email}: keep=#{keep.to_a.join(\";\")} toss=#{toss.to_a.join(\";\")}\"\n toss.each { |id| Person[id].delete }\n end\n\n if keep.size > 1\n sorted = keep.to_a.sort\n target = sorted[0]\n remap = sorted[1..-1]\n puts \"#{email}: target=#{target} remap=#{remap.join(\";\")}\"\n remap.each { |source|\n ItemAuthor.where(person_id: source).update(person_id: target)\n }\n end\n }\n }\nend", "def rename_story\n\n end", "def rewrite!(content)\n return content unless match?\n \n content.gsub(/#{pattern}/, replacement)\n end", "def replace_names!(former,nname)\n # Recurse on the match.\n self.match.replace_names!(former,nname)\n # Recurse on the statement.\n self.statement.replace_names!(former,nname)\n end", "def make_rss_feed\n require 'rss/maker'\n fname = Wiki_path + \"/rss-temp\"\n rss_entries = Marshal::load(File.read(fname))\n\n version = \"2.0\" # [\"0.9\", \"1.0\", \"2.0\"]\n\n content = RSS::Maker.make(version) do |m|\n m.channel.title = Wiki_title\n m.channel.link = Internet_path\n m.channel.description = Wiki_desc\n m.items.do_sort = true # sort items by date\n \n rss_entries.each do |entry|\n i = m.items.new_item\n i.title = entry[:title]\n i.link = entry[:link]\n i.date = entry[:date]\n i.description = entry[:description]\n end\n end\n\n File.write(Wiki_path + \"/data/media/pages.xml\", content) \nend", "def feed aFile, aItems, aName, aInfo = nil, aSummarize = true\n dst = File.join('output', aFile)\n entries = [aItems].flatten.uniq\n\n feedObj = Feed.new(aFile, entries, aName, aInfo, aSummarize)\n FEEDS << feedObj\n\n file dst => COMMON_DEPS + entries.map {|e| e.input_file} do |t|\n notify :feed, t.name\n File.write t.name, FEED_TEMPLATE.render_with(:@feed => feedObj)\n end\n\n task :feed => dst\n CLEAN.include dst\n end", "def show\n @feed = Feed.find(params[:id]) rescue Feed.find_by_uri(params[:id])\n if @feed.is_duplicate? and @feed.duplicate\n redirect_to feed_url(@feed.duplicate)\n else\n respond_to do |wants|\n wants.html do\n render :action => 'show'\n end\n wants.atom do\n render :xml => @feed.to_atom(:base => \"http://#{request.host}:#{request.port}\", :include_entries => true, :page => params[:page]) \n end\n wants.xml { render :xml => @feed.to_xml }\n end\n end\n end", "def renamenx(old_name, new_name); end", "def renamenx(old_name, new_name); end", "def as_replacements; end", "def as_replacements; end", "def as_replacements; end", "def replace_refs\n doc.xpath('.//ref').each_with_index.map do |node, index|\n text = node.inner_html\n\n ref_node = create_ref_node(node, index + 1)\n node.replace(ref_node)\n\n text\n end\n end", "def convert_links links, dropped_links_count\n TraceProtos::Span::Links.new \\\n link: links.map { |link| convert_link link },\n dropped_links_count: dropped_links_count\n end", "def fix_skel_migrations(skel_dir = File.dirname(__FILE__) + '/../skel')\n # expect, remove and modify need to be fixed, add doesn't\n for verb in %w(expect remove modify)\n skel_targets(skel_dir, verb, '/db/migrate') do |src_file, target_file|\n pattern = target_file.sub(/\\d{14}/, '*')\n matches = Dir.glob(pattern)\n raise FileNotFound, pattern if matches.empty?\n raise AmbiguousMigration, matches.inspect if matches.size > 1\n File.rename(matches.first, target_file)\n end\n end\n end", "def replace_filter(new_filter = nil)\n filters = @current_filters.map{ |filter|\n unless filter[:title] == new_filter\n \"&#{filter[:title].downcase}=#{filter[:query]}\"\n end\n }\n filters.compact.join\n end", "def replace( *ruleses )\n self.dup.replace!( *ruleses )\n end", "def migrate_contact_entity_linkages\n contacts_for_keys = @source_redis.keys('contacts_for:*')\n\n contacts_for_keys.each do |contacts_for_key|\n\n if contacts_for_key =~ /\\Acontacts_for:(#{ID_PATTERN_FRAGMENT})(?::(#{CHECK_PATTERN_FRAGMENT}))?\\z/\n\n entity_id = $1\n check_name = $2\n\n contact_ids = @source_redis.smembers(contacts_for_key)\n\n next if contact_ids.empty?\n\n contacts = contact_ids.collect do |contact_id|\n find_contact(contact_id)\n end\n\n entity = find_entity(:id => entity_id)\n\n if check_name.nil?\n # interested in entity\n entity.contacts.add(*contacts)\n else\n # interested in check\n check = find_or_create_check(entity.name, check_name)\n check.contacts.add(*contacts)\n end\n\n else\n raise \"Bad regex for '#{contacts_for_key}'\"\n end\n\n end\n\n entity_tag_keys = @source_redis.keys('entity_tag:*')\n\n entities_with_changed_tags = {}\n\n entity_tag_keys.each do |entity_tag_key|\n\n # TODO fix regex, check current code\n raise \"Bad regex for '#{entity_tag_key}'\" unless entity_tag_key =~ /\\Aentity_tag:(#{TAG_PATTERN_FRAGMENT})\\z/\n\n tag = $1\n\n entity_ids = @source_redis.smembers(entity_tag_key)\n\n entity_ids.each do |entity_id|\n\n entity = Flapjack::Data::Entity.find_by_id(entity_id)\n raise \"No entity with id #{entity_id}\" if entity.nil?\n entity.tags << tag\n entities_with_changed_tags[entity_id] = entity\n end\n end\n\n entities_with_changed_tags.values.each do |entity|\n entity.save\n end\n\nend", "def raw_mapping_rss_docs\n rss = RSS::Parser.parse(File.read(rss_file), false)\n mapping = {\n :channel=>rss.channel.title,\n :url=>rss.channel.link,\n :total=>rss.items.size,\n :title=>proc {|item,index| item.title },\n :link=>proc{|item,index| item.link },\n :published=>proc{|item,index| item.date },\n :description=>proc{|item,index| item.description }\n }\n mapper = Solr::Mapper::Base.new(mapping)\n mapper.map(rss.items)\n end", "def feed\n\t feeds[0] = feeds.create unless feeds[0]\n\t feeds[0]\n\tend", "def build_rss\n ::RSS::Maker.make('2.0') do |maker|\n maker.channel.link = @wiki.settings.url\n maker.channel.title = @wiki.settings.title\n maker.channel.description = @wiki.settings.description.to_s\n maker.channel.author = @wiki.settings.author.to_s\n maker.channel.updated = Time.now.to_s\n maker.items.do_sort = true\n\n posts.each do |post|\n html = post.content\n date = Time.parse(post.post_date)\n\n next if date > Time.now unless @wiki.settings.future\n\n if i = html.index('</p>')\n text = html[0..i+4]\n else\n text = html\n end\n\n maker.items.new_item do |item|\n item.title = post.title\n item.link = File.join(@wiki.settings.url, post.href)\n item.date = date\n item.description = text\n end\n end\n end\n end", "def convert!\n # Fonts and headings\n semanticize_font_styles!\n semanticize_headings!\n\n # Tables\n remove_paragraphs_from_tables!\n semanticize_table_headers!\n\n # list items\n remove_paragraphs_from_list_items!\n remove_unicode_bullets_from_list_items!\n remove_whitespace_from_list_items!\n remove_numbering_from_list_items!\n end", "def transform; end", "def highlight_and_link(source, remove_top_namespace = false)\n\n # debug\n # is_page_of_interest = @context.registers[:page]['fancy_name'] =='reshape') \n \n if remove_top_namespace then \n page_namespace = @context.registers[:page]['namespace'] + \"::\"\n ns = page_namespace.split(\"::\")[0] + \"::\"\n end\n\n highlighted_types = @context.registers[:site].data['highlighted_types'] \n \n # for all types in highlighted_types, \n # - find them \n # - replace them with _X0001X_, _X0002X, which the highlighter will not cut\n # - highlight by calling Rouge\n # - replace back the _X0001X_, _X0002X with the name and adequate url\n # if remove_top_namespace is true, we rerun this a second type with the top namespace removed from the type\n # It is useful for signature when the namespace is not always explicit and would be verbose (e.g. nda:: everywhere in all nda:: functions ?)\n #\n repl_to_original = {}\n c = 1\n highlighted_types.each do |type, url|\n\n type_to_replace = type\n # we are going to run this twice : once with the full type, \n # once with the type_to_replace truncated from top ns if remove_top_namespace is true\n # lambda are closure, it will see the change in type_to_replace\n worker = lambda { \n # the type_to_replace, not followed by a word (e.g. array does not match array_adapter, and not preceded by a :)\n # e.g. array will match array, not nda::array (which could be matched in another part of the loop...), and NOT std::array !\n re = Regexp.new '(?<!:)' + type_to_replace + '(?!\\w)' \n source = source.gsub(re){ |w|\n repl = \"_X000\" + c.to_s + \"X_\"\n repl_to_original[repl] = type # Must be the full type\n c = c + 1\n repl\n }\n }\n worker.call\n if remove_top_namespace then\n type_to_replace = type.gsub(ns, '')\n worker.call\n end\n end\n\n formatter = Rouge::Formatters::HTML.new\n lexer = Rouge::Lexers::Cpp.new\n r = formatter.format(lexer.lex(source))\n r = '<figure class=\"highlight\"><pre><code class=\"language-c--\" data-lang=\"c++\">' + r.strip + '</code></pre></figure>'\n\n repl_to_original.each do |repl, type|\n url = highlighted_types[type] \n\n if remove_top_namespace then\n type = type.gsub(ns, '')\n end\n re = Regexp.new '(' + repl + ')(?!\\w)'\n r = r.gsub(re){ |w| '<a href=\"%s\">%s</a>' %[url, type]}\n end\n\n return r\n end", "def replace_names!(former,nname)\n # Stop here if the name is redeclared.\n return if self.each_type.find {|type| type.name == former }\n return if self.each_systemT.find {|systemT| systemT.name == former }\n return if self.each_inner.find {|inner| inner.name == former }\n # Recurse on the internals.\n replace_names_subs!(former,nname)\n end", "def update_podcast_feeds()\n @ole.UpdatePodcastFeeds()\n end", "def rewrite_content(path)\n Dir.glob(\"#{path}/**/*.html\") do |html_file|\n doc = Nokogiri::HTML(File.read(html_file))\n\n # add '.enterprise' to `@class` in `body`\n body = doc.search('body').first\n unless body.nil?\n classes = body.get_attribute('class').to_s.split(' ')\n body.set_attribute('class', classes.push('enterprise').uniq.join(' '))\n end\n\n doc.css('a').each do |a|\n a['href'] = \"/enterprise/#{VERSION}#{a['href']}\" if a['href'] =~ /^\\//\n end\n\n doc.css('link').each do |link|\n link['href'] = \"/enterprise/#{VERSION}#{link['href']}\" if link['href'] =~ /^\\//\n end\n\n doc.css('script').each do |script|\n script['src'] = \"/enterprise/#{VERSION}#{script['src']}\" if script['src'] =~ /^\\//\n end\n\n doc.css('img').each do |img|\n img['src'] = \"/enterprise/#{VERSION}#{img['src']}\" if img['src'] =~ /^\\//\n end\n\n doc.search('//*[@class=\"not-enterprise\"]').remove\n File.open(html_file, 'w') { |file| file.write(doc.to_html) }\n end\n\n Dir.glob(\"#{path}/**/*.css\") do |css_file|\n contents = File.read(css_file)\n contents.gsub!(/url\\(\\/shared/, \"url(/enterprise/#{VERSION}/shared\")\n File.open(css_file, 'w') { |file| file.write(contents) }\n end\nend", "def routes_fix_names(old_routes)\n new_routes = {}\n old_routes.each do |key,values|\n # puts \"old_routes[#{key}] => #{values.inspect}\"\n new_routes[key] = values.collect do |subname|\n searchname = nil\n if old_routes[subname]\n searchname = subname \n elsif old_routes[subname.camel_case]\n searchname = subname.camel_case\n elsif old_routes[subname.singularize.camel_case]\n searchname = subname.singularize.camel_case\n end\n searchname\n end.compact.uniq\n # puts \"new_routes[#{key}] => #{new_routes[key].inspect}\"\n end\n new_routes\n end", "def rewrite(pattern)\r\n if match = pattern.match(result)\r\n start = match.begin(0)\r\n target.pos = start\r\n target.truncate start\r\n end\r\n \r\n block_given? ? yield(match) : match\r\n end", "def update_rss(id, body)\n doc = Nokogiri::XML(body)\n doc.xpath('rss/channel/item').each do |i|\n title = i.xpath('title').text\n link = i.xpath('link').text\n st = @sql.prepare \"select exists(select 1 from article_lists where article_url=?)\"\n st.execute(link).each_with_index do |res, index|\n insert_article_list(res, id, title, link) if index == 0\n end\n end\n end", "def post_in_feed\n # update tag\n @tag = ID3Lib::Tag.new(tmp_filename)\n @tag.artist = params[\"tag\"][\"artist\"]\n @tag.album = params[\"tag\"][\"album\"]\n @tag.title = params[\"tag\"][\"title\"]\n @tag.comment = params[\"tag\"][\"comment\"]\n @tag.update!\n \n # neuen, endgueltigen dateinamen bestimmen\n new_filename = get_filename(@tag.artist, @tag.title)\n \n # store the post in database\n # bis jetzt wurden die informationen im tag der datei mitgefuehrt\n @post = Post.create({\n :user => current_user,\n :song => @tag.title,\n :artist => @tag.artist,\n :album => @tag.album,\n :comment => @tag.comment,\n :rating => 0,\n :rating_count => 0,\n :filename => new_filename\n })\n \n if @post.save\n if File.rename(tmp_filename, new_filename) and File.chmod(0644, new_filename)\n \n # wenn speichern klappt und datei auch umbenennt werden kann\n # leg auch gleich noch ein neues, erstes kommentar fuer den post an\n Comment.new(\n :post_id => @post.id,\n :comment_text => @tag.comment,\n :user_id => current_user.id\n ).save\n\n # store the time when user posted\n current_user.last_post = Date.today\n current_user.save\n \n # verhindern, dass man die eigenen posts bewerten darf\n @rating = Rating.new(\n :user_id => current_user.id,\n :post_id => @post.id\n )\n @rating.save\n\n @user = current_user\n\n # create the new feed\n Post.make_rss\n\n else\n flash[:notice] = \"renaming problem\" #sollte nicht passieren\n logger.info(\"a problem occured while renaming the temporary file\")\n redirect_to :action => \"index\"\n end\n else\n \n # speichern hat nicht funktioniert, zurueck zum upload formular\n @original_name = params[\"original_name\"]\n render :action => \"upload_file\"\n end\n \n end", "def update!\n raise(RuntimeError, \"can't fetch without a uri.\") unless @uri\n\n res = @http.get(@uri, \"Accept\" => \"application/atom+xml\")\n\n if @etag and res['etag'] == @etag\n # we're already all up to date\n return self\n elsif res.code == \"410\"\n raise Atom::FeedGone, \"410 Gone (#{@uri})\"\n elsif res.code != \"200\"\n raise Atom::HTTPException, \"Unexpected HTTP response code: #{res.code}\"\n end\n\n # we'll be forgiving about feed content types.\n res.validate_content_type([\"application/atom+xml\",\n \"application/xml\",\n \"text/xml\"])\n\n @etag = res[\"ETag\"] if res[\"ETag\"]\n\n xml = res.body\n\n coll = REXML::Document.new(xml)\n\n update_el = REXML::XPath.first(coll, \"/atom:feed/atom:updated\", { \"atom\" => Atom::NS } )\n\n # the feed hasn't been updated, don't do anything.\n if update_el and self.updated and self.updated >= Time.parse(update_el.text)\n return self\n end\n\n coll = self.class.parse(coll.root, self.base.to_s)\n merge! coll\n\n if abs_uri = next_link\n @next = self.class.new(abs_uri.to_s, @http)\n end\n\n if abs_uri = previous_link\n @prev = self.class.new(abs_uri.to_s, @http)\n end\n\n self\n end" ]
[ "0.60642225", "0.5815195", "0.57091093", "0.5630513", "0.5424835", "0.5391509", "0.53438705", "0.52823013", "0.52770996", "0.52759415", "0.52368027", "0.5233641", "0.51931375", "0.51360023", "0.51305586", "0.5120545", "0.5113283", "0.5100719", "0.50862527", "0.5084352", "0.50841284", "0.50697243", "0.504463", "0.504463", "0.504463", "0.504463", "0.504463", "0.50352585", "0.5023443", "0.49946544", "0.49633926", "0.49389675", "0.493712", "0.4936061", "0.48954883", "0.48937237", "0.48907894", "0.48866662", "0.4867027", "0.48548242", "0.48528132", "0.48525688", "0.4851418", "0.48512173", "0.48501712", "0.48336965", "0.48253623", "0.48236895", "0.48180977", "0.47907722", "0.47838408", "0.4760029", "0.47507575", "0.47506028", "0.4741724", "0.47272184", "0.4722013", "0.47145274", "0.47020084", "0.47005695", "0.46885186", "0.46806505", "0.46730712", "0.46650174", "0.46621802", "0.46587813", "0.46468112", "0.46434793", "0.4640754", "0.46295932", "0.46269783", "0.46246964", "0.46223658", "0.46207526", "0.46207133", "0.46089265", "0.46089265", "0.4605165", "0.4605165", "0.4605165", "0.45958066", "0.45950946", "0.45944232", "0.45915797", "0.45884132", "0.45853013", "0.45845923", "0.45795423", "0.45791468", "0.45712852", "0.45685643", "0.4566174", "0.4564868", "0.45648474", "0.45631266", "0.45602012", "0.45573118", "0.45569065", "0.45548728", "0.4546093" ]
0.5662303
3
Does this authority configuration have term defined?
def supports_term? term_config.present? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def term_required?( term )\n #puts \"=====> GenericWork.term_required? #{term}\"\n return true if [:author_email, :author_first_name, :author_last_name, :author_institution, :title, :creator, :contributor, :description, :publisher, :rights, :identifier, :department, :degree, :license].include? term\n false\n end", "def term_subauthorities?\n term_subauthority_count.positive?\n end", "def authority?\n false\n end", "def term_subauthority?(subauth_name)\n subauth_name = subauth_name.to_sym if subauth_name.is_a? String\n term_subauthorities.key? subauth_name\n end", "def term_id_expects_id?\n return false if term_config.nil? || !(term_config.key? :term_id)\n term_config[:term_id] == \"ID\"\n end", "def term_id_expects_uri?\n return false if term_config.nil? || !(term_config.key? :term_id)\n term_config[:term_id] == \"URI\"\n end", "def authorize?\n @root.attributes[\"ath\"].to_i == 1\n end", "def is_assessment_term?\n @reportable.class.table_name == 'assessment_terms'\n end", "def term_readonly?( term )\n #puts \"=====> GenericWork.term_readonly? #{term}\"\n return true if [:author_email, :author_institution, :date_created, :identifier, :publisher, :department, :degree, :license].include? term\n return true if term == :title && is_sis_thesis?\n false\n end", "def check_term(term_type, term) \n if !@term_authority[term_type]\n authorized_term = term\n elsif !@term_authority[term_type][term].nil?\n @term_authority[term_type][term] == \"REMOVE\" ? authorized_term = \"\" : authorized_term = @term_authority[term_type][term]\n else\n authorized_term = term\n end\n \n return authorized_term\n \n end", "def has_terms?\n ! @data['terms'].nil?\n end", "def catalog?\n @resource_name == \"catalog\" && @actions[0] == \"*\"\n end", "def trusted_authority?(authority)\n @configuration['trust'].include?(authority)\n end", "def term_multiple?( term )\n #puts \"=====> GenericWork.term_multiple? #{term}\"\n return true if [:keyword, :title, :contributor, :subject, :related_url, :sponsoring_agency, :admin_notes].include? term\n false\n end", "def type_authorization?()\n return(true) if(@type == TAC_PLUS_AUTHOR)\n return(false)\n end", "def ontology_based?\n source_ontology.present? && ols_root_term_uri.present?\n end", "def valid?\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n allowed_values = [\"TERM\", \"NUMBERRANGE\", \"NUMBERHISTOGRAM\", \"DATERANGE\", \"DATEHISTOGRAM\", \"ID\"]\n if @term_type && !allowed_values.include?(@term_type)\n return false\n end\n \n \n \n \n \n \n \n end", "def secret_word_account?\n return false unless teacher_managed_account?\n sections_as_student.any? {|section| section.login_type == Section::LOGIN_TYPE_WORD}\n end", "def term?\n type.in?(%i[tag metatag wildcard all none])\n end", "def role_given?\n self.resources_configuration[:self][:role].present?\n end", "def read_terms\n object.tnc_last_accepted.present?\n end", "def is_root_term?\n return false\n end", "def terms_accepted?\n true\n end", "def system_vocab?\n # currently determined by whether it has a special key, which cannot be set by user defined CV's\n key.present? && SystemVocabs.database_key_known?(key)\n end", "def term_valid?(term)\n term.is_a?(String)\n end", "def arv?\n arvs = [\"Stavudine Lamivudine\", \"Stavudine Lamivudine Nevirapine\", \"Efavirenz\", \"Zidovudine Lamivudine\", \"Nevirapine\", \"Abacavir\", \"Didanosine\", \"Lopinavir Ritonavir\", \"Didanosine\", \"Tenofovir\"]\n return arvs.include?(self.concept.name)\n end", "def is_accessory?\n return true if self.accessory_to_products.size > 0\n families = self.product_families.map{|pf| pf.tree_names}.join(\" \")\n !!!(families.match(/controller/)) ? false : !!(families.match(/accessor/i))\n end", "def luxury_search_authorized?\n authorized_for?(:action => :read)\n end", "def authorized_artsy_token?(token)\n ArtsyAdminAuth.valid?(token)\n end", "def analyst?\n has_role?(:analyst)\n end", "def other_entry?\n principle == \"EVERYONE\"\n end", "def has_additional_terms_of_use\n false\n end", "def has_accepted_medicaid_terms?\n SUBMITTED_STATUS.include?(aasm_state)\n end", "def is_alumno?\n self.role.name.eql?(Role::ALUMNO)\n end", "def ace?\n :ace == @identifier\n end", "def is_agreement?\n return false if self.observation.taxon.nil?\n return true if self.taxon_id == self.observation.taxon_id\n self.taxon.in_taxon? self.observation.taxon\n end", "def territorial_core?\n @node[\"territorial_core\"]\n end", "def complete_word?(term)\n term =~ /#{ArchiveConfig.autocomplete[:terminator]}$/\n end", "def can_see_schedule_name_in_entries_list?\n system_admin? || leaderbits_employee_with_access_to_any_organization?\n end", "def cas_configured?\n return true unless @facility.details[:configurable_835]\n @segments_list[:CAS][:CAS00][0].eql?('code_value') ? true : false\n end", "def authen_type_arap?()\n return true if (@authen_type == TAC_PLUS_AUTHEN_TYPE_ARAP)\n return false\n end", "def has_privilege?\n has_all? || has_direct?\n end", "def needs_permission_badge?\n solr_document.visibility != Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC\n end", "def btl_enabled?\n primary_employment.present? && primary_employment.restaurant_role.present?\n end", "def is_authorized\n (!current_user.nil? and auth_types.include? current_user.user_attributes[:bor_type])\n end", "def liaison?\n role == 'liaison'\n end", "def has_catalog?\n false\n end", "def can_be_loaned_for_solr\n result = \"no\"\n result = \"yes\" if available_for_loan == true\n result\n end", "def type_authentication?()\n return(true) if(@type == TAC_PLUS_AUTHEN)\n return(false)\n end", "def has_access? c\n access_rights[controller2right c] == '1'\n end", "def active?\n asana_api_key.present? && workspace.present?\n end", "def administration?\n self.privileges == PRIVILEGE_CODES[:administration]\n end", "def existing_agreement?\n (existing_agreement == 'Y')\n end", "def authorised\n if self.roles.size > 0\n true\n end\n end", "def pain_generation_enabled?\n creditor_detail.present?\n end", "def usa_admin?\n has_role?(:admin) && jurisdiction&.name == 'USA'\n end", "def has_accepted_attestation_terms?\n SUBMITTED_STATUS.include?(aasm_state)\n end", "def loan_officers?\n\t\t!!current_admin || !!current_loan_manager || !!current_accountant\n\tend", "def verify\n response = script_mode do \n query(\"configshow | grep RBAC\")\n end \n response.data.match(/#{Replies::RBAC_DENIED}/) ? false : true\n end", "def att_register_enabled?\n Figaro.env.respond_to?(:att_client_id) && Figaro.env.respond_to?(:att_client_secret)\n end", "def user_authorizes_token?\n params[:authorize] == '1'\n end", "def user_authorizes_token?\n params[:authorize] == '1'\n end", "def user_authorizes_token?\n params[:authorize] == '1'\n end", "def authorize_term(field, term)\n authorized_terms = []\n if field.include?(\"_facet\") or field.include?(\"_display\")\n authorized_terms << check_term(field.split(\"_\")[0], term) # the .split is b/c \"originator_display\" would be under the \"originator\" values in the yaml file\n else\n authorized_terms << term\n authorized_terms << check_term(field.split(\"_\")[0], term)\n end\n \n return authorized_terms.uniq\n \n end", "def term_subauthority_count\n term_subauthorities.size\n end", "def required_authorization?\n unauthorized_commit_authors.any?\n end", "def has_license_key?\n if Agent.config[:license_key] && Agent.config[:license_key].length > 0\n true\n else\n ::NewRelic::Agent.logger.warn('No license key found. ' +\n 'This often means your newrelic.yml file was not found, or it lacks a section for the running ' \\\n \"environment, '#{NewRelic::Control.instance.env}'. You may also want to try linting your newrelic.yml \" \\\n 'to ensure it is valid YML.')\n false\n end\n end", "def show_configuration?\n super ||\n can?(:manage, Site) ||\n can?(:manage, User) ||\n can?(:manage, Hyku::Group)\n end", "def has_accessories_percept\n if (self.has_accessories && self.has_services)\n return false\n else\n return true\n end\n end", "def is_app_authorizer?\n if is_admin_realm_authenticated?\n session[:rights].include?('EDORG_APP_AUTHZ')\n elsif !session[:edOrgRights].blank?\n session[:edOrgRights].any? { |edorg, rights| rights.include?('APP_AUTHORIZE') }\n else\n false\n end\n end", "def has_oauth_credentials?\n return false if @configuration.nil?\n RightSignature2013::Connection.oauth_keys.each do |key| \n return false if @configuration[key].nil? || @configuration[key].match(/^\\s*$/)\n end\n\n return true\n end", "def check_absorptance?()\n \n @construction.check_keyword?(\"ABSORPTANCE\") \n \n end", "def is_doctor?\n \treturn role === 1 \n end", "def has_auth?\n !current_person.nil?\n end", "def authenticable?\n Chimps.config[:catalog][:key] && Chimps.config[:catalog][:secret]\n end", "def authentication?\n @capabilities and @capabilities.include? 'auth'\n end", "def concesionaria?\n\t\thas_role?(:admin) or has_role?(:concesionaria)\n\tend", "def is_categories?\n is_entries? && params[:_taxonomies_].present? && params[:_slug_].present? && is_not_page?\n end", "def isAuthorized? account\n return true if current_user.admin?\n house = House.where(:account => account)\n return false if (house.nil || current_user.tenantOnly?)\n end", "def catalog_scoped?\n false\n end", "def role?\n false\n end", "def should_validate_organization?\n\t\troles.include?('Customer')\n\tend", "def authorized?\n %w(new create plans canceled thanks).include?(self.action_name) || \n ((self.action_name == 'dashboard') && current_user) ||\n admin?\n end", "def authorized?\n %w(new create plans canceled thanks).include?(self.action_name) || \n ((self.action_name == 'dashboard') && current_user) ||\n admin?\n end", "def advanced_search_authorized?\n authorized_for?(:action => :read)\n end", "def role_authorized?(resource)\n return role_strings.include?(resource)\n end", "def display_acl?\n convention_admin? || super_admin?\n end", "def accepted_agreement?\n return license != DEFAULT_LICENSE\n end", "def has_aliases?\n @context.aliases.length > 0\n end", "def customize_authorized?\n authorized_for?(:action => :read)\n end", "def has_officer_rights?\n if current_user\n if current_user.role == 'officer' || current_user.role == 'admin'\n true\n else\n false\n end\n else\n false\n end\n end", "def granular?\n @granular ||= begin\n return false if resource_class.nil?\n return true if resource_type == 'Host'\n resource_class.included_modules.include?(Authorizable) && resource_class.respond_to?(:search_for)\n end\n end", "def tenanted?\n @roomer_scope == :tenanted\n end", "def exists?\n begin\n rbac_role_resource.head\n true\n rescue RestClient::Forbidden\n true\n rescue RestClient::ResourceNotFound\n false\n end\n end", "def has_accepted_submission_terms?\n SUBMITTED_STATUS.include?(aasm_state)\n end", "def has_api_token?\n return false if @configuration.nil?\n RightSignature2013::Connection.api_token_keys.each do |key|\n return false if @configuration[key].nil? || @configuration[key].match(/^\\s*$/)\n end\n\n return true\n end", "def permissive_roles?\n admin? || agent? || mdt? || council_service?\n end", "def tool_defined?(words)\n @tool_data.key?(words)\n end", "def action_allowed?\n ['Instructor', 'Teaching Assistant', 'Administrator'].include? current_role_name\n end", "def approved?\n [ 'AUTHORISED' ].include? status\n end" ]
[ "0.71338826", "0.69512326", "0.6938955", "0.68242306", "0.65766585", "0.655206", "0.6327525", "0.62968785", "0.62422967", "0.6239428", "0.62140924", "0.6170013", "0.61289275", "0.6117691", "0.60525143", "0.604674", "0.6044572", "0.600686", "0.59570533", "0.5916419", "0.59119046", "0.59079605", "0.5898705", "0.5851887", "0.58291984", "0.58237535", "0.58214533", "0.5816201", "0.57991135", "0.5792458", "0.5787435", "0.5761033", "0.5754088", "0.5729667", "0.57275456", "0.57257295", "0.5723742", "0.5719565", "0.571716", "0.5714272", "0.5701119", "0.5690721", "0.5690235", "0.5690002", "0.568447", "0.5678126", "0.5676003", "0.5639761", "0.56320995", "0.56318456", "0.5631307", "0.562194", "0.56204265", "0.5604624", "0.5601514", "0.5600553", "0.55940706", "0.55894035", "0.55869967", "0.5586962", "0.5582264", "0.5582264", "0.5582264", "0.5581364", "0.5574015", "0.5564817", "0.5560864", "0.5552953", "0.5549119", "0.55472", "0.5545328", "0.5542065", "0.5535993", "0.5533931", "0.5533795", "0.5532916", "0.55228883", "0.55144364", "0.5512639", "0.55116343", "0.5510174", "0.55094075", "0.55037165", "0.55037165", "0.55001616", "0.548995", "0.5488385", "0.54726094", "0.5472592", "0.5472516", "0.5469195", "0.54629725", "0.54617596", "0.5460886", "0.5460872", "0.54596853", "0.5458496", "0.5456156", "0.54545295", "0.5453231" ]
0.742577
0
Return term url encoding defined in the configuration for this authority.
def term_url Config.config_value(term_config, :url) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def encoding\n @attributes[:encoding]\n end", "def encoding\n @external_encoding\n end", "def encoding; end", "def encoding; end", "def encoding; end", "def encoding; end", "def encoding; end", "def encoding; end", "def encoding; end", "def encoding; end", "def encoding; end", "def encoding; end", "def encoding; end", "def encoding; end", "def encoding; end", "def encoding; end", "def encoding; end", "def encoding\n\t'ISO-8859-1'\nend", "def encoding\n @content[pn(:Encoding)]\n end", "def meta_encoding; end", "def meta_encoding; end", "def encoding\n @encoding ||= Encoding.const_get(\n Hunspell.Hunspell_get_dic_encoding(self).gsub('-','_')\n )\n end", "def encodings; end", "def default_encoding; end", "def default_encoding; end", "def encoding(encoding); end", "def encoding\n Encoding::UTF_8\n end", "def encoding\n Encoding::UTF_8\n end", "def external_encoding\n Encoding.default_external\n end", "def encoding()\n #This is a stub, used for indexing\n end", "def found_encoding; end", "def found_encoding; end", "def encoding\n @connection.encoding.to_s\n end", "def external_encoding()\n #This is a stub, used for indexing\n end", "def internal_encoding()\n #This is a stub, used for indexing\n end", "def canonical_uri; end", "def encoding\n @io.external_encoding\n end", "def encoding\n @io.external_encoding\n end", "def encoded_url\n CGI.escape(url)\n end", "def encoding=(_arg0); end", "def encoding=(_arg0); end", "def encoding=(_arg0); end", "def encoding=(_arg0); end", "def encoding=(_arg0); end", "def encoding=(_arg0); end", "def encoding=(_arg0); end", "def to_s\n @uri_string ||=\n begin\n uri_string = \"#{normalized_authority}:#{normalized_path}\"\n if uri_string.respond_to?(:force_encoding)\n uri_string.force_encoding(Encoding::UTF_8)\n end\n uri_string\n end\n end", "def encoding_line; end", "def charset\n metadata[:charset]\n end", "def charset; end", "def charset; end", "def charset; end", "def name\n 'Accept-Encoding'\n end", "def encoding\n if @encoding.blank?\n if !self.http_headers.blank?\n if self.http_headers['content-type'] =~ /charset=([\\w\\d-]+)/\n @encoding = $1.downcase\n else\n @encoding = self.encoding_from_feed_data\n end \n else\n @encoding = self.encoding_from_feed_data\n end\n end\n return @encoding\n end", "def mobile_encoding\n\t'ISO-8859-1'\nend", "def encoding=(enc); end", "def encoding(encoding)\n primitive \"encoding #{encoding}\"\n end", "def encoding\n @gapi.encoding\n end", "def encoding\n @gapi.encoding\n end", "def canonical\n Globalize.with_locale(::Refinery::I18n.default_frontend_locale) { url }\n end", "def term_url_template\n Config.config_value(term_url, :template)\n end", "def find_encoding(encoding); end", "def charset\n 'UTF8'\n end", "def default_encoding\n Encoding::UTF_8\n end", "def EncodeConfig(valueToEncode)\r\n\t\tchars = {\r\n\t\t\t'&' => '%26',\r\n\t\t\t'=' => '%3D',\r\n\t\t\t'\"' => '%22'\r\n\t\t}\r\n\t\t\r\n\t\treturn Php4r.strtr(valueToEncode, chars)\r\n\tend", "def term_replacement_encoded?(map_key)\n return false unless term_url_mappings[map_key].key? :encode\n term_url_mappings[map_key][:encode]\n end", "def character_set_name\n @charset.name\n end", "def utf8_enforcer_tag; end", "def encoding\n @body.encoding\n end", "def charset\n 'utf-8'\n end", "def determine_encodings!(*)\n @encoding ||= super\n end", "def params_encoding\n @params_encoding ||= query_options.fetch(:params_encoding, :typhoeus)\n end", "def encode_string; end", "def content_encoding\n v = @meta['content-encoding']\n if v && %r{\\A#{RE_LWS}?#{RE_TOKEN}#{RE_LWS}?(?:,#{RE_LWS}?#{RE_TOKEN}#{RE_LWS}?)*}o =~ v\n v.scan(RE_TOKEN).map {|content_coding| content_coding.downcase}\n else\n []\n end\n end", "def default_encoding=(_arg0); end", "def external_encoding; @_external_encoding || _external_encoding; end", "def urlencode\n #URI.escape(self)\n _rfc2396_parser.escape(self)\n end", "def force_default_encoding; end", "def encode_uri(uri)\n uri = uri.join(\"/\") if uri.class == Array\n additional_encoding(URI.parse(URI.encode(uri)).to_s)\n end", "def url_encode\n Rack::Utils.escape self\n end", "def encodings(safe_path)\n @encodings ||= determine_encodings!(safe_path)\n end", "def uri_escape\n CGI.escape(self)\n end", "def meta_encoding=(encoding); end", "def meta_encoding=(encoding); end", "def get_encoding()\n puts @csv_encoding\n end", "def urlescape\n @@uri_parser ||= URI::RFC2396_Parser.new\n @@uri_parser.escape(self)\n end", "def term_language\n return @term_language unless @term_language.nil?\n lang = Config.config_value(term_config, :language)\n return nil if lang.nil?\n lang = [lang] if lang.is_a? String\n @term_language = lang.collect(&:to_sym)\n end", "def force_entry_names_encoding; end", "def encode( address )\n address = URI.encode_www_form_component( address ) if address =~ /\\?dt\\=/i\n return address\n end", "def authority\n\t\t\t@options[:authority]\n\t\tend", "def enc_type\n hyper_schema_link.enc_type\n end", "def encoding_found; end", "def encoding_found; end", "def encoding\n # noop?\n end", "def force_encoding(*); self; end", "def default_encoding\n (@media_type == \"text\") ? \"quoted-printable\" : \"base64\"\n end", "def encoding\n @stdin.external_encoding\n end", "def encoding\n @stdin.external_encoding\n end", "def encoding\n @stdin.external_encoding\n end", "def encoding(*args)\n if args.empty?\n return @encoding\n else\n @encoding = args[0]\n return self\n end\n end" ]
[ "0.6375255", "0.6303597", "0.6057524", "0.6057524", "0.6057524", "0.6057524", "0.6057524", "0.6057524", "0.6057524", "0.6057524", "0.6057524", "0.6057524", "0.6057524", "0.6057524", "0.6057524", "0.6057524", "0.6057524", "0.595883", "0.5930487", "0.5901438", "0.5901438", "0.5898544", "0.58603364", "0.5825296", "0.5825296", "0.5795387", "0.57803965", "0.57803965", "0.57320744", "0.571392", "0.56735367", "0.56735367", "0.56475174", "0.5635804", "0.5553501", "0.55475", "0.5547326", "0.5547326", "0.5500497", "0.55004954", "0.55004954", "0.55004954", "0.55004954", "0.55004954", "0.549951", "0.549951", "0.5482626", "0.54335946", "0.5430871", "0.5415061", "0.5415061", "0.5415061", "0.5414528", "0.5399378", "0.5396674", "0.539127", "0.53891623", "0.53593683", "0.53593683", "0.535054", "0.5346376", "0.5323156", "0.53072804", "0.5306365", "0.5303075", "0.5299728", "0.5290995", "0.52883863", "0.52839243", "0.5283681", "0.52812994", "0.5272814", "0.5268519", "0.5255714", "0.52442116", "0.52381814", "0.5205525", "0.5174", "0.5161183", "0.51429665", "0.5138325", "0.5129201", "0.5117721", "0.5117721", "0.51148313", "0.5113151", "0.5108495", "0.50988364", "0.50940776", "0.5089778", "0.5083417", "0.50671685", "0.50671685", "0.50584525", "0.5041554", "0.50312465", "0.5027228", "0.5027228", "0.5027228", "0.50249296" ]
0.6081776
2
Return term url template defined in the configuration for this authority.
def term_url_template Config.config_value(term_url, :template) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def term_url\n Config.config_value(term_config, :url)\n end", "def get_resource_tpl(term)\n list_resource_tpl.to_a.select { |m| m.term == term }.first\n end", "def template\n Pathname.new(@template || OodPortalGenerator.root.join('templates', 'ood-portal.conf.erb'))\n end", "def template\n Pathname.new(@template || OodPortalGenerator.root.join(\"templates\", \"ood-portal.conf.erb\"))\n end", "def url_template\n @url_template ||= metadata.fetch(\"permalink\") do\n Utils.add_permalink_suffix(\"/:collection/:path\", site.permalink_style)\n end\n end", "def _uri_template\n @uri_template ||= Addressable::Template.new(@link['href'])\n end", "def uri_template\n return @uri_template ||= Addressable::Template.new(\n self.method_base.join(Addressable::URI.parse(@discovery_document['path']))\n )\n end", "def url_template; end", "def url_template; end", "def template\n if !html?\n \"/:path/:basename:output_ext\"\n elsif index?\n \"/:path/\"\n else\n Utils.add_permalink_suffix(\"/:path/:basename\", site.permalink_style)\n end\n end", "def template\n if !html?\n \"/:path/:basename:output_ext\"\n elsif index?\n \"/:path/\"\n else\n Utils.add_permalink_suffix(\"/:path/:basename\", site.permalink_style)\n end\n end", "def uri_template(base=nil)\n if @uri_template\n @uri_template\n elsif base && path_template\n base + path_template\n end\n end", "def uri\n @uri ||= resource_template.uri_for(params, application.base)\n end", "def terms_of_use_url\n return @children['terms-of-use-url'][:value]\n end", "def interpolation_options\n { resource_name: @term.display_name }\n end", "def template_path\n @options[:template_path]\n end", "def template\n if site.config['content_pages'] && site.config['content_pages']['permalink_template']\n site.config['content_pages']['permalink_template']\n else\n super\n end\n end", "def permalink\n return \"#{uri}\"\n end", "def path_template\n @attributes[:path_template]\n end", "def url\n return permalink if permalink\n\n @url ||= (ext == '.html') ? template.gsub(':name', basename) : \"/#{name}\"\n end", "def url_template\n collection.url_template\n end", "def generate_url(template); end", "def get_url_template(template)\n schema = config.get(:schema)\n version = schema[:urls][:version]\n url = schema[:urls].fetch(template, version)\n Addressable::Template.new(url)\n end", "def uri_template(tmpl_src)\n # Support the RFC6470 templates directly if people use them\n if tmpl_src.include?(':')\n tmpl_src = tmpl_src.gsub(/:([A-Za-z0-9]+)/, '{\\1}')\n end\n\n Addressable::Template.new ::Middleman::Util.normalize_path(tmpl_src)\n end", "def url\n @url ||= URL.new(\n template: template,\n placeholders: url_placeholders,\n permalink: permalink\n ).to_s\n end", "def template\n '/:lang/portfolio/:categories/:basename/'\n end", "def config_for_term_or_uri(term)\n return properties[term.to_s] unless term.kind_of? RDF::Resource\n properties.each_value { |v| return v if v.predicate == term.to_uri }\n end", "def path_template\n\t\t\t\[email protected][@path_spec]\n\t\t\tend", "def url\n @url ||= URL.new(\n :template => template,\n :placeholders => url_placeholders,\n :permalink => permalink\n ).to_s\n end", "def term_name\n self.content\n end", "def config_for_term_or_uri(term)\n return properties[term.to_s] unless\n term.is_a?(RDF::Resource) && !term.is_a?(RDFSource)\n properties.each_value { |v| return v if v.predicate == term.to_uri }\n end", "def uri_template(tmpl_src)\n # Support the RFC6470 templates directly if people use them\n if tmpl_src.include?(':')\n tmpl_src = tmpl_src.gsub(/:([A-Za-z0-9]+)/, '{\\1}')\n end\n\n ::Addressable::Template.new(::Middleman::Util.normalize_path(tmpl_src))\n end", "def raw_href\n templated? ? template.pattern : target.href\n end", "def _url\n return @link['href'] unless _templated?\n\n @url ||= _uri_template.expand(@uri_variables || {}).to_s\n end", "def template_name; end", "def template_name; end", "def template\n @template\n end", "def template_path\n @default_options.fetch(:template_path, nil)\n end", "def tenant_name\n url_shortcut\n end", "def apply_uri_template(template, data)\n ::Middleman::Util.normalize_path Addressable::URI.unencode(template.expand(data)).to_s\n end", "def atom_url\n Config.site.url.chomp('/') + R(TagController, :atom, CGI.escape(name))\n end", "def term_subauthority_replacement_pattern\n return {} unless term_subauthorities?\n @term_subauthority_replacement_pattern ||= {} if term_config.nil? || !term_subauthorities?\n pattern = term_qa_replacement_patterns[:subauth]\n @term_subauthority_replacement_pattern ||= { pattern: pattern, default: term_url_mappings[pattern.to_sym][:default] }\n end", "def template\n @__template\n end", "def termref(name, role_name = nil)\n role_name ||= name\n element(role_name, {:href=>'#'+name, :class=>:term}, 'a')\n end", "def get_template_file\n @config['template']\n end", "def help_term( text )\n content_tag( :u, text )\n end", "def url\n return @url if @url\n\n url = permalink ?\n if site.config['relative_permalinks']\n File.join(@dir, permalink)\n else\n permalink\n end :\n {\n 'lang' => self.lang,\n 'categories' => self.categories,\n 'basename' => self.basename,\n }.inject(template) { |result, token|\n result.gsub(/:#{token.first}/, token.last)\n }.gsub(/\\/\\//, '/')\n\n # sanitize url\n @url = url.split('/').reject { |part| part =~ /^\\.+$/ }.join('/')\n @url += '/' if url =~ /\\/$/\n @url.gsub!(/\\A([^\\/])/, '/\\1')\n @url\n end", "def template\n return @template\n end", "def get_template_text(template)\n if template.key? '_thunder_url'\n return template['_thunder_url']\n else\n return template.to_json\n end\n end", "def termref(name, role_name = nil)\n role_name ||= name\n element(role_name, {:href=>'#'+name, :class=>:object_type}, 'a')\n end", "def termref(name, role_name = nil)\n role_name ||= name\n element(role_name, {:href=>'#'+name, :class=>:object_type}, 'a')\n end", "def get_template(template); end", "def template\n\t\t\t@signature[:templates][@action_name]\n\t\tend", "def _template_location(action, type = nil, controller = controller_name)\n \"#{controller}/#{action}.#{type}\"\n end", "def to_uri_template(options = {})\n Wrest::UriTemplate.new(strip, options)\n end", "def t\n @template\n end", "def template_for(action, resource)\n\t\t\t\"#{resource.gsub(\" \",\"_\")}/#{action}\"\n\t\tend", "def _template\n @template\n end", "def url\n @url ||= URL.new(\n :template => url_template,\n :placeholders => url_placeholders,\n :permalink => permalink\n ).to_s\n end", "def template_name\n command.text_value\n end", "def term\n @term\n end", "def get_template\n @template\n end", "def token_uri; end", "def uri\n ::Spyke::Path.new(@uri_template, fmrest_uri_attributes) if @uri_template\n end", "def _template_location(action, type = nil, controller = controller_name)\n \"#{controller}/#{action}.#{type}\"\n end", "def template\n @template.join(\"\\n\")\n end", "def template\n @template.join(\"\\n\")\n end", "def templates_path\n @templates_path\n end", "def typus_template(attribute)\n template = Typus::Configuration.config[self.name]['fields']['options']['templates'][attribute] rescue nil\n return template\n end", "def url\n File.join(*tag_path)\n end", "def apply_uri_template(template, data)\n ::Middleman::Util.normalize_path(::Addressable::URI.unencode(template.expand(data)).to_s)\n end", "def style_howto\n\t%Q|/<a href=\"http://docs.tdiary.org/en/?#{@conf.style}Style\">How to write</a>|\nend", "def tt_path\n segments[1..-1].join('/')\n end", "def get_template\n # Filters the name of the current theme.\n apply_filters('template', get_option('template'))\n end", "def catalog_generator(bib)\n QuickSearch::Engine::WORLD_CAT_DISCOVERY_API_ARTICLE_CONFIG['url_link'] +\n bib.oclc_number.to_s\n end", "def uri\n uri_for({}, nil)\n end", "def rest_url_document\n template = ::Addressable::Template.new(current_resource.class.rest_api_document)\n template.expand(property_map).to_s\n end", "def template_name\n self.path.scan(/[^\\/]+$/).first\n end", "def template\n @template.nil? ? format_underscore(shortname) : @template\n end", "def template\n \"#{@@template_path}/#{@status}\"\n end", "def get_default_tpl\n return self.script_name.sub(/^#{BASE_URL}\\//, '').sub(/\\..+?$/, '')\n end", "def typus_template(attribute)\n Typus::Configuration.config[name]['fields']['options']['templates'][attribute.to_s]\n rescue\n nil\n end", "def text_url\n link_uri\n end", "def to_s\n return uri_builder_delegate.to_s if uri_builder_delegate\n specs = uri_builder_specs\n # if a.none? ????\n if specs.none?\n raise NoURISpecFound.new(self)\n end\n return specs.first.template.expand(self.variables || {}).to_s\n end", "def url(uri=nil)\n @uri = Addressable::Template.new(uri.gsub(/:(?![0-9])(\\w+)/) { \"{#{$1}}\" }) unless uri.nil?\n @uri\n end", "def url\n [ Configuration.url, @path ].join\n end", "def template\n @template.content\n end", "def term\n self.name\n end", "def edit_template_url\r\n url = @cobrand.params.find_by_key 'store_news_and_events_template_url'\r\n @template_url = url.value if url\r\n end", "def typus_template(attribute)\n options = read_model_config['fields']['options']\n if options && options['templates'] && options['templates'][attribute.to_s]\n options['templates'][attribute.to_s]\n end\n end", "def template_path\n @template_path ||= @env[:templates_path] || default_settings[:templates_path]\n Pathname.new @template_path\n end", "def context_url\n if params[:context_type] == 'countries'\n admin_country_url(@country)\n else\n admin_market_url(@market)\n end\n end", "def term(**mapping)\n render(TERM, **mapping)\n end", "def resource_tpl_get(term)\n ###\n # See #resource_tpl_list for details on how to create Occi::Core::Mixin instances.\n # Here you simply select a specific instance with a matching term.\n # Since terms must be unique, you should always return at most one instance.\n ###\n found = resource_tpl_list.to_a.select { |m| m.term == term }.first\n fail Backends::Errors::ResourceNotFoundError, \"Mixin with term #{term.inspect} does not exist!\" unless found\n\n found\n end", "def template_path(template, node)\n cookbook_name = template.cookbook || template.cookbook_name\n cookbook = node.cookbook_collection[cookbook_name]\n cookbook.preferred_filename_on_disk_location(node, :templates, template.source)\nend", "def create_permalink\n \"#{self.name.latinize.to_ascii}-#{self.edition.latinize.to_ascii}\".gsub(/[^0-9A-Za-z|_\\- ]/,'')\n end", "def template\n Kernel.const_get(template_name.upcase << '_TEMPLATE')\n end", "def template(arg=nil)\n set_or_return(:template, arg, :kind_of => String, :required => true)\n end", "def canonical\n Globalize.with_locale(::Refinery::I18n.default_frontend_locale) { url }\n end", "def name_template\n @name_template || self.to_s\n end" ]
[ "0.6998017", "0.63634884", "0.6192363", "0.6179194", "0.61766136", "0.6048937", "0.60303634", "0.5966091", "0.5966091", "0.59564334", "0.59560263", "0.59018266", "0.5830176", "0.5783523", "0.57087463", "0.565974", "0.5658968", "0.5630148", "0.56186986", "0.56004274", "0.55985415", "0.55939776", "0.55196214", "0.5498689", "0.5496878", "0.5464346", "0.54529506", "0.5444585", "0.54385465", "0.54359615", "0.5419128", "0.5399479", "0.53988475", "0.53769416", "0.536301", "0.536301", "0.5317582", "0.5312454", "0.5285774", "0.5272532", "0.5266212", "0.526339", "0.52607906", "0.5254799", "0.52274686", "0.52192396", "0.5190252", "0.51866066", "0.51830477", "0.5181346", "0.5181346", "0.51540625", "0.514005", "0.5137599", "0.51278436", "0.5115623", "0.5069084", "0.50689673", "0.506621", "0.5064899", "0.50643396", "0.5062897", "0.5062594", "0.5061136", "0.5053063", "0.50399", "0.50399", "0.50377554", "0.5020747", "0.501453", "0.5014234", "0.5012027", "0.50045127", "0.49963325", "0.4988077", "0.4982965", "0.4979225", "0.49707666", "0.49668714", "0.4962699", "0.4961372", "0.49609363", "0.49581134", "0.4948299", "0.4944402", "0.49434638", "0.49311697", "0.49293125", "0.49230534", "0.49224532", "0.49220648", "0.49157104", "0.49137715", "0.49136296", "0.4913214", "0.49006218", "0.48944315", "0.48882806", "0.48827913", "0.48780492" ]
0.86491334
0
Return term url parameter mapping defined in the configuration for this authority.
def term_url_mappings return @term_url_mappings unless @term_url_mappings.nil? mappings = Config.config_value(term_url, :mapping) return {} if mappings.nil? Hash[*mappings.collect { |m| [m[:variable].to_sym, m] }.flatten] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def term_param(name)\n term_params.select {|t| t.name == name}[0]\n end", "def term_params\n if TERM_ADDITIONAL_FIELDS[params[:term]['controlled_vocabulary_string_key']].blank?\n addl_term_params = []\n else\n addl_term_params = TERM_ADDITIONAL_FIELDS[params[:term]['controlled_vocabulary_string_key']].map { |key, _value| key.to_sym }\n end\n params.require(:term).permit([:controlled_vocabulary_string_key, :value, :uri, :type, :authority] + addl_term_params)\n end", "def term_url\n Config.config_value(term_config, :url)\n end", "def config_for_term_or_uri(term)\n return properties[term.to_s] unless term.kind_of? RDF::Resource\n properties.each_value { |v| return v if v.predicate == term.to_uri }\n end", "def parameter_key(term)\n string = term.to_s\n string = string.sub(/^[a-z\\d]*/) { $&.capitalize }\n string.gsub!(/(?:_|(\\/))([a-z\\d]*)/i) { \"#{$1}#{$2.capitalize}\" }\n string\n end", "def parameter_key(term)\n string = term.to_s\n string = string.sub(/^[a-z\\d]*/) { $&.capitalize }\n string.gsub!(/(?:_|(\\/))([a-z\\d]*)/i) { \"#{$1}#{$2.capitalize}\" }\n string\n end", "def term(**mapping)\n render(TERM, **mapping)\n end", "def config_for_term_or_uri(term)\n return properties[term.to_s] unless\n term.is_a?(RDF::Resource) && !term.is_a?(RDFSource)\n properties.each_value { |v| return v if v.predicate == term.to_uri }\n end", "def term_subauthority_replacement_pattern\n return {} unless term_subauthorities?\n @term_subauthority_replacement_pattern ||= {} if term_config.nil? || !term_subauthorities?\n pattern = term_qa_replacement_patterns[:subauth]\n @term_subauthority_replacement_pattern ||= { pattern: pattern, default: term_url_mappings[pattern.to_sym][:default] }\n end", "def mapping_for(name)\n params[MAPPING[name]]\n end", "def mapping_for(name)\n params[MAPPING[name]]\n end", "def routing_params\n routing_params_with_patterns.map { |param, _| param }\n end", "def term_url_template\n Config.config_value(term_url, :template)\n end", "def routing_params\n routing_params_with_patterns.map { |param, _| param }\n end", "def search_url(term='')\n param = URI.encode_www_form('term' => term)\n \"http://api.urbandictionary.com/v0/define?#{param}\"\n end", "def term\n @term\n end", "def interpolation_options\n { resource_name: @term.display_name }\n end", "def open_url_params_map\n {\n issn: 'rft.issn',\n volume: 'rft.volume',\n issue: 'rft.issue',\n start_page: 'rft.spage',\n publication_date: 'rft.date'\n }\n end", "def parameters\n url_params = \"\"\n\n if @resource == :catalog\n url_params += \"&\" + \"offset=#{URI.escape(@offset.to_s)}\" if @offset\n url_params += \"&\" + \"size=#{URI.escape(@size.to_s)}\" if @size\n url_params += \"&\" + \"search=#{URI.escape(@search)}\" if @search\n url_params += \"&\" + \"filter=#{URI.escape(@filter)}\" if @filter\n url_params += \"&\" + \"state=#{URI.escape(@state)}\" if @state\n url_params += \"&\" + \"sort=#{URI.escape(@sort)}\" if @sort\n url_params += \"&\" + \"instock=#{@instock}\" if @instock\n elsif @resource == :categorymap\n url_params += \"&\" + \"filter=#{URI.escape(@filter)}\" if @filter\n url_params += \"&\" + \"search=#{URI.escape(@search)}\" if @search\n elsif @resource == :reference\n url_params += \"&\" + \"filter=#{URI.escape(@filter)}\" if @filter\n end\n\n return url_params\n end", "def read\n mappings.inject({}) do |params, mapping|\n params.merge(mapping.read_as_params)\n end\n end", "def param_map\n\t\tintent.parameters\n\tend", "def uri_params\n return unless(card_params)\n # TODO: Hack for problem with autocomplete and \"hidden\" paramters\n card_params[:iconclass_terms] = card_params[:iconclass_terms].collect { |it| (it =~ /http:\\/\\//) ? it : IconclassTerm.make_uri(it) }if(card_params[:iconclass_terms])\n end", "def property_for(term)\n if mapping.key?(term) && metadata.respond_to?(mapping[term])\n mapping[term]\n elsif metadata.respond_to?(term)\n term\n end\n end", "def get_mapping\n request :get, \"_mapping\"\n end", "def get_mapping\n request :get, \"_mapping\"\n end", "def reverse_mapping\n @@reverse_mapping ||= Hash[Danbooru.config.full_tag_config_info.map { |k, v| [v[\"category\"], k] }]\n end", "def query_string_params\n super + [\n :chtm, # region\n :chld, # countries/states\n ]\n end", "def parameters\n resolve_parameters(link_schema['href'].scan(PARAMETER_REGEX))\n end", "def search_term\n params[:searchTerm]\n end", "def search_url(term, opts = {})\n param = URI.encode_www_form(\"term\" => term)\n\n if opts[:api] != false\n \"#{API_ROOT}/define?#{param}\"\n else\n \"#{WWW_ROOT}/define.php?#{param}\"\n end\n end", "def values\n render :json => gen_slugs(params[:term].upcase)\n end", "def to_param\n permalink\n end", "def params\n split_query_string.flat_map do |keyword|\n [\"%#{keyword}%\".mb_chars.downcase.to_s] * query_for_one_keyword.count('?')\n end\n end", "def to_param\n name_for_url\n end", "def term\n self.name\n end", "def amphibian_params\n base_params\n end", "def parameters\n context.parameters.map(&:name)\n end", "def term_list(terms)\n ignored = params.keys - ['q', 'solr_document_id', 'action', 'controller']\n list_id = request.original_url\n term_list = IIIF::Presentation::Resource.new('@id' => list_id)\n term_list['@context'] = 'http://iiif.io/api/search/1/context.json'\n term_list['@type'] = 'search:TermList'\n term_list['terms'] = terms\n term_list['ignored'] = ignored\n term_list.to_ordered_hash(force: true, include_context: false)\n end", "def term_replacements\n return @term_replacements unless @term_replacements.nil?\n @term_replacements = {}\n @term_replacements = term_url_mappings.select { |k, _v| !term_qa_replacement_patterns.value?(k.to_s) } unless term_config.nil? || term_url_mappings.nil?\n @term_replacements\n end", "def resources\n instance_variable_get(\"@#{mapping.plural}\")\n end", "def search_url(term, scope, per_page)\n [PRIMO_API_URL, '/search?q=any,contains,', clean_term(term), '&vid=',\n PRIMO_VID, '&tab=', PRIMO_TAB, '&scope=', scope, '&limit=',\n per_page, '&apikey=', PRIMO_API_KEY].join\n end", "def autocomplete_known_uri_values\n lookup_predicate\n if params[:term].blank? || params[:term].strip.blank?\n if @predicate && @predicate.has_values?\n @known_uris = @predicate.allowed_values.select{ |ku| ku.visible? }\n else\n @known_uris = []\n end\n else\n @known_uris = search_known_uris_by_name_or_uri(params[:term])\n if @predicate\n @known_uris.delete_if{ |ku| ! @predicate.allowed_values.include?(ku) }\n else\n @known_uris.delete_if{ |ku| ! ku.value? }\n end\n end\n render_autocomplete_results\n end", "def url_for_info(terms)\n require 'cgi'\n\n 'http://aur.archlinux.org/rpc.php?type=multiinfo' +\n terms.collect { |t| '&arg[]=' + CGI::escape(t) }.join\n end", "def search_param_terms\n\t\t\tp = params.permit(:terms, :order)\n\t\t\tp['terms']\n\t\tend", "def term_subauthorities\n @term_subauthorities ||= {} if term_config.nil? || !(term_config.key? :subauthorities)\n @term_subauthorities ||= term_config[:subauthorities]\n end", "def mapping_params\n params.require(:mapping).permit(:index_term, :page_id, :comment)\n end", "def terms\n @term_hash.values\n end", "def term\r\n Riddle::Query.escape params[:term]\r\n end", "def term\r\n Riddle::Query.escape params[:term]\r\n end", "def to_param\n abbr\n end", "def process_term(element, value, **options)\n if options[:vocab]\n # If there is a local default vocabulary, the IRI is obtained by concatenating that value and the term\n return uri(options[:vocab] + value)\n elsif options[:term_mappings].is_a?(Hash)\n # If the term is in the local term mappings, use the associated URI (case sensitive).\n return uri(options[:term_mappings][value.to_s.to_sym]) if options[:term_mappings].has_key?(value.to_s.to_sym)\n\n # Otherwise, check for case-insensitive match\n options[:term_mappings].each_pair do |term, uri|\n return uri(uri) if term.to_s.downcase == value.to_s.downcase\n end\n end\n\n # Finally, if there is no local default vocabulary, the term has no associated URI and must be ignored.\n add_warning(element, \"Term #{value} is not defined\", RDF::RDFA.UnresolvedTerm)\n nil\n end", "def parameters\n data_fields = descriptors_fields.select{|field| field.scope == PARAMETER_FIELDS }\n Addressable::Template.new(retrieve(HREF_KEY)).variables.map do |template_variable_name|\n field_specified = data_fields.find{|field| field.name.to_s == template_variable_name.to_s}\n if field_specified\n field_specified\n else\n Field.new({template_variable_name.to_sym => {type: 'string', scope: 'href'}})\n end\n end\n # descriptors_fields.select{|field| field.scope == PARAMETER_FIELDS }\n end", "def to_param\n permalink\n end", "def to_param\n permalink\n end", "def to_param\n url_name\n end", "def url_for_options_paramdef_hash\n {\n :anchor => nil,\n :escape => nil,\n :host => nil,\n :only_path => nil,\n :password => nil,\n :port => nil,\n :protocol => nil,\n :skip_relative_url_root => nil,\n :trailing_slash => nil,\n :user => nil,\n\n :enable_optional_keys => true\n }.merge(routes_generate_options)\n end", "def description_params\n I18n.available_locales.map { |l| \"#{l}_description\".to_sym }\n end", "def canonical_mapping\n @@canonical_mapping ||= Hash[Danbooru.config.full_tag_config_info.map { |k, v| [k.capitalize, v[\"category\"]] }]\n end", "def art_directors_hash\n search_by_text_hash 'художник'\n end", "def query_parameters\n end", "def param_value\n :\"#{as.to_s.singularize}_ids\"\n end", "def literature_params\n params.fetch(:literature, {})\n end", "def show\n @taxonomy_term = TaxonomyTerm.find(params[:id])\n \n @locations = apply_scopes(@taxonomy_term.locations).uniq().page(params[:page]).per(params[:per_page])\n \n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @taxonomy_term }\n end\n end", "def to_param\n permalink_was\n end", "def to_param\n permalink_was\n end", "def sanskrit_term_params\n params.require(:sanskrit_term).permit(:term, :definition)\n end", "def liga_tymy_are_params\n params[:liga_tymy_are]\n end", "def to_param; self.permalink end", "def authority_params\n params.fetch(:authority, {}).permit(:name, :region_id)\n end", "def term_name\n self.content\n end", "def search_term\n if params[:props]\n params[:props][:search_term]\n else\n return nil\n end\n end", "def searchterm\r\n @@st.get_searchterm(referer)\r\n end", "def query_string_params\n super + [:chls]\n end", "def rdfa_description_hash(about,options={})\n options[:typeof] ||= self.class.resource_model_uri\n options[:about] = about\n\n options\n end", "def typerelsequence_params\n params.fetch(:typerelsequence, {})\n end", "def mapping\n {key => name}\n end", "def to_param\n abbrev\n end", "def suggest_handler_path\n @autocomplete_config[\"solr_endpoint\"]\n end", "def default_autocomplete\n [\n { label: \"My Profile settings\", url: profile_path },\n { label: \"My SSH Keys\", url: profile_keys_path },\n { label: \"My Dashboard\", url: root_path },\n { label: \"Admin Section\", url: admin_root_path },\n ]\n end", "def property_for(term)\n if mapping.key?(term) && object.respond_to?(mapping[term])\n mapping[term]\n elsif object.respond_to?(term)\n term\n end\n end", "def get_for_field_and_term(name, term)\n @locations.select { |location| location.field == name && location.term == term }\n end", "def url_param(index)\n @lunetas_url_instance_params[index]\n end", "def languages_as_uri\n languages.pluck(:name).map do |language|\n CONTROLLED_VOCABULARIES[:language].send(language)\n end\n end", "def thema_params\n params[:thema]\n end", "def identifier_alias_redirect\n opt = request_parameters\n aliases = opt.extract!(*PublicationIdentifier.identifier_types)\n return if aliases.blank?\n opt[:identifier] = aliases.map { |type, term| \"#{type}:#{term}\" }.join(' ')\n redirect_to opt\n end", "def params_auth_hash\n params[scope]\n end", "def params_auth_hash\n params[scope]\n end", "def resources_for http_verb, path\n param_vals = []\n curr_node = @routes_tree[http_verb.to_s.downcase]\n return unless curr_node\n\n path.scan(%r{/([^/]+|$)}) do |(key)|\n next if key.empty?\n\n if curr_node[key]\n curr_node = curr_node[key]\n\n elsif curr_node[\"%s\"]\n param_vals << key\n curr_node = curr_node[\"%s\"]\n\n else\n return\n end\n end\n\n return unless curr_node.value\n rsc = curr_node.value.dup\n\n rsc[-1] = param_vals.empty? ?\n Hash.new :\n rsc[-1].inject({}){|h, name| h[name] = param_vals.shift; h}\n\n rsc\n end", "def vocabulary_term_params\n params.require(:vocabulary_term).permit(:label, :uri, :code, :tgm_label, :lcsh_label, :vocabulary_id)\n end", "def uri_params\n params.require(:uri).permit(:absolute, :path, :aliases, :envvars, :vm_id,\n :framework_id, :port, :ipfilter, :customvhost,\n :is_sh, :is_import, :is_redir_alias, :is_main, :is_ssl)\n end", "def get_bibkey_parameters(rft)\n # filter out special chars that ought not to be in there anyway,\n # and that HathiTrust barfs on. \n isbn = get_isbn(rft)\n \n oclcnum = get_identifier(:info, \"oclcnum\", rft)\n oclcnum = oclcnum.gsub(/[\\-\\[\\]]/, '') unless oclcnum.blank?\n \n lccn = get_lccn(rft)\n lccn = lccn.gsub(/[\\-\\[\\]]/, '') unless lccn.blank?\n \n yield(isbn, lccn, oclcnum) \n end", "def term_qa_replacement_patterns\n Config.config_value(term_config, :qa_replacement_patterns)\n end", "def term\n Term.find(self.term_id)\n end", "def jurisdiction_path\n jurisdiction&.path&.map(&:name)\n end", "def jurisdiction_path\n jurisdiction&.path&.map(&:name)\n end", "def authority\n\t\t\t@options[:authority]\n\t\tend", "def common_term_params\n params.require(:common_term).permit(:search_term, :pages)\n end", "def authorize_params\n super.tap do |params|\n %w[display scope auth_type].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end", "def get_allowed_parameters\n return _get_specific_action_config(:allowed_action_parameters, :allowed_parameters)&.map(&:to_s)\n end", "def project_entry_params\n params.permit(:term)\n end" ]
[ "0.621949", "0.59115183", "0.58987963", "0.5858358", "0.5856254", "0.5856254", "0.5633246", "0.55860895", "0.54817295", "0.5464743", "0.5464743", "0.5449388", "0.5443508", "0.5424088", "0.5381914", "0.5307165", "0.5304823", "0.5242304", "0.5218561", "0.5170587", "0.5099392", "0.50989956", "0.508608", "0.50685674", "0.50685674", "0.50631064", "0.5047889", "0.5046946", "0.50397784", "0.50312465", "0.5029748", "0.5022147", "0.5020656", "0.5020482", "0.50193954", "0.500653", "0.49871036", "0.498409", "0.4966671", "0.49626866", "0.49571192", "0.49542686", "0.4953335", "0.49391854", "0.49360675", "0.4919861", "0.49146527", "0.49103627", "0.49103627", "0.4882265", "0.48734593", "0.48707926", "0.48626873", "0.48626873", "0.4834768", "0.48196468", "0.4817711", "0.48163083", "0.4813682", "0.48078805", "0.48047954", "0.4800478", "0.4791289", "0.4790571", "0.4790571", "0.478679", "0.4776523", "0.47722703", "0.4771229", "0.47684526", "0.47684342", "0.47659075", "0.47530553", "0.474251", "0.47423607", "0.47393006", "0.4728434", "0.47274774", "0.4725468", "0.47249824", "0.47166762", "0.47089604", "0.4706039", "0.4701294", "0.47012272", "0.4698652", "0.4698652", "0.46981153", "0.46955642", "0.46926966", "0.46899304", "0.46898755", "0.46852133", "0.46829557", "0.46829557", "0.468019", "0.4676166", "0.46658212", "0.46639237", "0.4663296" ]
0.6767433
0
Is the term_id substitution expected to be a URI?
def term_id_expects_uri? return false if term_config.nil? || !(term_config.key? :term_id) term_config[:term_id] == "URI" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def term_id_expects_id?\n return false if term_config.nil? || !(term_config.key? :term_id)\n term_config[:term_id] == \"ID\"\n end", "def uri?(word)\n return false if config.include_uris\n !(word =~ URI.regexp).nil?\n end", "def term_valid?(term)\n term.is_a?(String)\n end", "def terms_id\n parse_terms_id_response(SolrQuery.new.solr_query(q='rdftype_tesim:\"http://www.w3.org/2004/02/skos/core#ConceptScheme\" AND preflabel_tesim:\"places\"'))\n end", "def process_term(element, value, **options)\n if options[:vocab]\n # If there is a local default vocabulary, the IRI is obtained by concatenating that value and the term\n return uri(options[:vocab] + value)\n elsif options[:term_mappings].is_a?(Hash)\n # If the term is in the local term mappings, use the associated URI (case sensitive).\n return uri(options[:term_mappings][value.to_s.to_sym]) if options[:term_mappings].has_key?(value.to_s.to_sym)\n\n # Otherwise, check for case-insensitive match\n options[:term_mappings].each_pair do |term, uri|\n return uri(uri) if term.to_s.downcase == value.to_s.downcase\n end\n end\n\n # Finally, if there is no local default vocabulary, the term has no associated URI and must be ignored.\n add_warning(element, \"Term #{value} is not defined\", RDF::RDFA.UnresolvedTerm)\n nil\n end", "def test_uri_validator\n # invalid\n assert !RDF::valid_uri?(\"use`quote\")\n # assert !RDF::valid_uri?(\"use%7quote\")\n\n # valid\n assert RDF::valid_uri?(\"use%07quote\")\n\n end", "def valid?\n RDF::URI::IRI.match?(to_s) || false\n end", "def nodeElementURI_check(el)\n if (CORE_SYNTAX_TERMS + [RDF_NS.li.to_s] + OLD_TERMS).include?(el.uri.to_s)\n warn = \"Invalid use of rdf:#{el.name}\"\n add_debug(el, warn)\n raise InvalidNode.new(warn) if @strict\n end\n end", "def validate_uri(uri)\n return validate({:doc => uri})\n end", "def is_uri?(source)\n !!(source =~ URI_REGEXP)\n end", "def uriish? str\n (str.include? ':') && (UriSniffRx.match? str)\n end", "def is_uri?(uri)\n URI::Generic===uri\n end", "def set_term\n @term = UriService.client.find_term_by_internal_id(params[:id])\n raise ActionController::RoutingError, \"Could not find Term with internal_id: #{params[:id]}\" if @term.nil?\n end", "def propertyElementURI_check(el)\n if (CORE_SYNTAX_TERMS + [RDF_NS.Description.to_s] + OLD_TERMS).include?(el.uri.to_s)\n warn = \"Invalid use of rdf:#{el.name}\"\n add_debug(el, warn)\n raise InvalidPredicate.new(warn) if @strict\n end\n end", "def bad_slug?(object)\n params[:id] != object.to_param\n end", "def bad_slug?(object)\n params[:id] != object.to_param\n end", "def clean_term(term)\n URI::Parser.new.escape(term.strip.tr(' ', '+').delete(',').tr(':', '+'))\n end", "def clean_term(term)\n URI.encode(term.strip.tr(' ', '+').tr(':', '%3A').delete(','))\n end", "def bad_slug?(object)\n params[:id] != object.to_param\nend", "def test_is_uri\n assert(N::URI.is_uri?(\"http://foobar.org/\"))\n assert(N::URI.is_uri?(\"http://foobar.org/\"))\n assert(N::URI.is_uri?(\"baa:boo\"))\n assert(!N::URI.is_uri?(\"foo\"))\n end", "def validate_uri(uri)\n unless uri.is_a?(String)\n return false\n end\n\n unless uri.slice(HG_REGEXP).nil?\n return true\n end\n\n false\n end", "def id_check(el, id, base)\n if NC_REGEXP.match(id)\n # ID may only be specified once for the same URI\n if base\n uri = URIRef.intern(\"##{id}\", base, :normalize => false)\n if @id_mapping[id] && @id_mapping[id] == uri\n warn = \"ID addtribute '#{id}' may only be defined once for the same URI\"\n add_debug(el, warn)\n raise RdfContext::ParserException.new(warn) if @strict\n end\n \n @id_mapping[id] = uri\n # Returns URI, in this case\n else\n id\n end\n else\n warn = \"ID addtribute '#{id}' must be a NCName\"\n add_debug(el, \"ID addtribute '#{id}' must be a NCName\")\n add_debug(el, warn)\n raise RdfContext::ParserException.new(warn) if @strict\n nil\n end\n end", "def uri?\n !!@uri\n end", "def uri?\n !!@uri\n end", "def validate_uri(uri)\n return validate({:uri => uri})\n end", "def term_replacement_encoded?(map_key)\n return false unless term_url_mappings[map_key].key? :encode\n term_url_mappings[map_key][:encode]\n end", "def config_for_term_or_uri(term)\n return properties[term.to_s] unless\n term.is_a?(RDF::Resource) && !term.is_a?(RDFSource)\n properties.each_value { |v| return v if v.predicate == term.to_uri }\n end", "def update\n @errors = []\n term_opts = flat_term_data_to_term_opts(term_params)\n\n begin\n @term = UriService.client.update_term(@term['uri'], term_opts)\n rescue UriService::NonExistentUriError, UriService::InvalidAdditionalFieldKeyError, UriService::CannotChangeTemporaryTerm => e\n @errors << e.message\n end\n\n respond_to do |format|\n if @errors.blank?\n format.html { redirect_to term_path(@term['internal_id']), notice: 'Term was successfully updated.' }\n format.json do\n render json: @term\n end\n else\n format.html { render action: 'new' }\n format.json do\n render json: { errors: @errors }\n end\n end\n end\n end", "def uri?(string)\n URI.parse(string)\n rescue URI::BadURIError\n false\n rescue URI::InvalidURIError\n false\n end", "def config_for_term_or_uri(term)\n return properties[term.to_s] unless term.kind_of? RDF::Resource\n properties.each_value { |v| return v if v.predicate == term.to_uri }\n end", "def term_multiple?( term )\n #puts \"=====> GenericWork.term_multiple? #{term}\"\n return true if [:keyword, :title, :contributor, :subject, :related_url, :sponsoring_agency, :admin_notes].include? term\n false\n end", "def check_uri_build\n\n end", "def var_or_iriref maybe_uri, var='?resource'\n if maybe_uri\n \"<#{maybe_uri}>\"\n else\n var\n end\n end", "def validate_uri(uri)\n unless uri.is_a?(String)\n return false\n end\n\n unless uri.slice(GIT_REGEXP).nil?\n return true\n end\n\n unless uri.slice(SCP_REGEXP).nil?\n return true\n end\n\n false\n end", "def uri_eligible?(uri)\n eligible = uri =~ /#{Regexp.escape(@config[:base_url])}/\n debug \"Islandora uri eligible: #{uri}\" if eligible\n eligible\n end", "def validate_uri(uri)\n validate_text(Net::HTTP.get(URI.parse(uri)))\n end", "def id_link?\n @url[0] == '#'\n end", "def url?(uri)\n /\\w+\\:\\/\\// =~ uri\n end", "def valid?\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n allowed_values = [\"TERM\", \"NUMBERRANGE\", \"NUMBERHISTOGRAM\", \"DATERANGE\", \"DATEHISTOGRAM\", \"ID\"]\n if @term_type && !allowed_values.include?(@term_type)\n return false\n end\n \n \n \n \n \n \n \n end", "def check_taxon antcat_reference, valid_hol_taxon, taxon\n\n antcat_protonym = taxon.protonym\n citation = antcat_protonym.authorship\n reference = citation.reference\n\n if !antcat_reference.nil? and antcat_reference.id == reference.id\n #puts \"References and name match - it's antcat taxon \" + taxon.id.to_s\n return taxon.id\n end\n\n first_author_name = reference.reference_author_names.first\n if !first_author_name.nil? and first_author_name.author_name.author_id ==\n valid_hol_taxon.antcat_author_id\n #puts \"Author match\"\n else\n # puts \"author mismatch - antcat: #{reference.reference_author_names.first.author_name.author_id} vs #{valid_hol_taxon.antcat_author_id}\"\n return nil\n end\n\n if reference.year == valid_hol_taxon.year\n #puts \"year match\"\n else\n # puts \"year mismatch antcat: #{reference.year} vs #{valid_hol_taxon.year}\"\n return nil\n\n end\n\n\n hol_start_page = valid_hol_taxon['start_page']\n hol_end_page = valid_hol_taxon['end_page']\n page_hash = get_page_from_string citation.pages\n\n unless page_hash.nil?\n start_page = page_hash[:start_page]\n end_page = page_hash[:end_page]\n if page_in_range hol_start_page, hol_end_page, start_page, end_page\n #puts \"page range match\"\n # puts \"Good match, no reference to antcat id #{taxon.id}\"\n return taxon.id\n else\n # puts \"pages mismatch\"\n return nil\n end\n end\n\n end", "def validate_uri(uri)\n unless uri.is_a?(String)\n return false\n end\n\n unless uri.slice(SSH_REGEXP).nil?\n return true\n end\n\n unless uri.slice(GIT_REGEXP).nil?\n return true\n end\n\n false\n end", "def mapped_uri?(uri)\n return get_name(uri) != nil\n end", "def check_term(term_type, term) \n if !@term_authority[term_type]\n authorized_term = term\n elsif !@term_authority[term_type][term].nil?\n @term_authority[term_type][term] == \"REMOVE\" ? authorized_term = \"\" : authorized_term = @term_authority[term_type][term]\n else\n authorized_term = term\n end\n \n return authorized_term\n \n end", "def url?(uri)\n /\\w+\\:\\/\\// =~ uri\n end", "def valid_uri?\n !self.contentable.blank? || !self.uri_path.blank?\n end", "def answers_to? qurl\n Alias.urleq(qurl, url) || alias_for?(qurl)\n end", "def gen_url url, text\n return super unless url =~ /\\Ardoc-ref:/\n\n name = $'\n cross_reference name, text, name == text\n end", "def fix_term(term, author: false, **)\n return term unless term.is_a?(String)\n value = term.strip\n\n # Strip quote mistakenly surrounding the whole term.\n value.sub!(/^([\"'])\\s*(.*)\\s*\\1$/, '\\2')\n\n # Extract the query type prefix.\n value.sub!(/^([^:]+)\\s*:\\s*/, '')\n prefix = $1&.presence&.downcase || DEFAULT_QUERY\n\n # Strip surrounding quotes from the query term.\n value.sub!(/^([\"'])\\s*(.*)\\s*\\1$/, '\\2')\n\n # Strip date from author name if requested.\n author = author.include?(prefix) if author.is_a?(Array)\n value.sub!(/\\s*,?\\s*(\\[.*\\]|\\(.*\\)|\\d+.*\\d+|\\d+-?)$/, '') if author\n\n \"#{prefix}:#{value}\"\n end", "def term_required?( term )\n #puts \"=====> GenericWork.term_required? #{term}\"\n return true if [:author_email, :author_first_name, :author_last_name, :author_institution, :title, :creator, :contributor, :description, :publisher, :rights, :identifier, :department, :degree, :license].include? term\n false\n end", "def has_better_id?\n slug and found_using_numeric_id? || found_using_outdated_friendly_id?\n end", "def found_using_numeric_id?\n !found_using_friendly_id?\n end", "def is?(term, type_sym)\n return term[:type] == type_sym\n end", "def invalid_uri?(uri)\n uri.grep(/^(#{PROTOCOLS.join('|')}):\\/\\/\\w/).empty?\n end", "def more_general_uri?(uri1, uri2)\n ua1 = uri1.nil? ? [] : uri1.split('/')\n ua2 = uri2.nil? ? [] : uri2.split('/')\n ua1.each_with_index do |p, i|\n return false unless ua2[i] == p\n end\n true\n end", "def validate_anchor( uri, doc )\n return false if uri.fragment.nil?\n\n anchor = '#' + uri.fragment\n if doc.at(anchor).nil?\n @log.error \"invalid URI '#{uri.to_s}'\"\n false\n else true end\n end", "def uri?(string)\n\t\turi = URI.parse(string)\n\t\t%w( http https ).include?(uri.scheme)\n\trescue URI::BadURIError\n\t\tfalse\n\trescue URI::InvalidURIError\n\t\tfalse\n\tend", "def term_url\n Config.config_value(term_config, :url)\n end", "def slug?(arg)\n false if Integer(arg)\n rescue ArgumentError, TypeError\n true\n end", "def id?(str); end", "def uri?(string)\n uri = URI.parse(string)\n %w( http https ).include?(uri.scheme)\nrescue URI::BadURIError\n false\nrescue URI::InvalidURIError\n false\nend", "def uri?(string)\n uri = URI.parse(string)\n %w( http https ).include?(uri.scheme)\nrescue URI::BadURIError\n false\nrescue URI::InvalidURIError\n false\nend", "def uri?(string)\n uri = URI.parse(string)\n %w( http https ).include?(uri.scheme)\nrescue URI::BadURIError\n false\nrescue URI::InvalidURIError\n false\nend", "def absolute_url?(string); end", "def vivo_uri(id)\n RDF::URI.parse \"#{vivo_prefix}/#{id}\"\nend", "def term?\n type.in?(%i[tag metatag wildcard all none])\n end", "def is_a_uri?(value)\n uri = URI.parse(value)\n uri.is_a?(URI::HTTP) && !uri.host.nil? && uri.host.split(\".\").size > 1\n rescue URI::InvalidURIError\n false\n end", "def uri_persisted?(test_uri)\n test_uri = RDF::URI.intern(test_uri) unless test_uri.is_a?(RDF::URI)\n\n ActiveTriples::Repositories.has_subject?(test_uri)\n end", "def term_includes_r99_sf20?(term)\n !!term.try(:[], :positiveIndicators).find do |indicator|\n indicator.try(:[], 'type').try(:[], 'code') == '+R99' && indicator.try(:[], 'reason').try(:[], 'code') == 'SF20%'\n end\n end", "def search_url(term='')\n param = URI.encode_www_form('term' => term)\n \"http://api.urbandictionary.com/v0/define?#{param}\"\n end", "def resolve(resource, position:)\n RDF::Literal(resource.to_s.downcase) if resource.term?\n end", "def resolve(resource, position:)\n RDF::Literal(resource.to_s.downcase) if resource.term?\n end", "def uri_normalizer; end", "def type_to_uri(type)\n case type\n when ::RDF::URI\n type\n when String\n ::RDF::URI(type)\n else\n fail ArgumentError, 'Invalid file type. You must submit a URI or a symbol.'\n end\n end", "def is_url?\n self =~ /^#{URI::regexp}$/\n end", "def validate_uri(url)\n !!URI.parse(url)\n end", "def add_uri_to_options(options)\n if @object\n options[:predicate] = @and_predicate && @and_predicate[:uri]\n options[:object_term] = @and_object ?\n [@term[:uri], @and_object[:uri]] :\n @term[:uri]\n else\n options[:predicate] = @and_predicate ?\n [@term[:uri], @and_predicate[:uri]] :\n @term[:uri]\n options[:object_term] = @and_object && @and_object[:uri]\n end\n end", "def fake_url?\n url =~ /^\\d\\d\\d\\d-/\n end", "def autocomplete_known_uri_predicates\n @known_uris = search_known_uris_by_name_or_uri(params[:term])\n @known_uris.delete_if{ |ku| ku.uri_type_id != UriType.measurement.id || ! EOL::Sparql.connection.all_measurement_type_known_uris.include?(ku) }\n render_autocomplete_results\n end", "def validate_uri(url)\n !!URI.parse(url)\n end", "def term_id(category, term, select)\n s = term_str(category, term, select)\n i = $terms.index s\n unless i\n $terms << s\n i = $terms.size - 1\n end\n i += 3001\nend", "def extract_uris( graph ) \n graph.terms.map{|t| t.to_s if t.uri?}.compact\nend", "def valid_id(text)\n\t NinjaGen.id_filter.match(text)\n end", "def term_url_template\n Config.config_value(term_url, :template)\n end", "def valid_id(major)\n unless major =~ /^[a-zA-Z0-9]*$/\n puts \"#{major} is not a valid imgur ID or URL\"\n return false\n end\n return true\n end", "def uri?(string)\n uri = URI.parse(string)\n %w[http https].include?(uri.scheme)\n rescue URI::BadURIError, URI::InvalidURIError\n false\n end", "def result\n ::RDF::URI.new(value.sub(/^uri-/, ''))\n end", "def rdf_type_uri\n JERMVocab[rdf_type_entity_fragment]\n end", "def new_slug_needed?\n !slug || slug_text != slug.name\n end", "def destroy\n UriService.client.delete_term(@term['uri'])\n respond_to do |format|\n format.html { redirect_to terms_controlled_vocabulary_path(@controlled_vocabulary), notice: 'Term has been deleted.' }\n format.json { head :no_content }\n end\n end", "def check_ai!(ai, query_string)\n action_param = action_from_query_string(query_string)\n fail ::Errors::ArgumentError, 'Provided action does not have a term!' unless ai && ai.action && ai.action.term\n fail ::Errors::ArgumentTypeMismatchError, \"Action terms in params and body do not \" \\\n \"match! #{action_param.inspect} vs. #{ai.action.term.inspect}\" unless ai.action.term == action_param\n end", "def create\n @errors = []\n term_prms = term_params\n validate_new_term_params(term_prms)\n\n unless @errors.present?\n\n type = term_prms.delete('type')\n term_opts = flat_term_data_to_term_opts(term_prms)\n\n begin\n @term = UriService.client.create_term(type, term_opts)\n rescue UriService::NonExistentVocabularyError, UriService::InvalidUriError, UriService::ExistingUriError, UriService::InvalidAdditionalFieldKeyError, UriService::InvalidOptsError => e\n @errors << e.message\n end\n end\n\n respond_to do |format|\n if @errors.blank?\n format.html { redirect_to term_path(@term['internal_id']), notice: 'Term was successfully created.' }\n format.json do\n render json: @term\n end\n else\n format.html { render action: 'new' }\n format.json do\n render json: { errors: @errors }\n end\n end\n end\n end", "def item_type_as_uri\n code = ITEM_TYPE_TO_URI_CODE.fetch(type.name.to_sym)\n ControlledVocabulary.era.item_type.from_value(code)\n end", "def canonical_uri; end", "def found_using_friendly_id?\n finder_slug\n end", "def schemed?\n identifier_scheme.present?\n end", "def schema_redirect\n redirect_to_glossary_entry(SCHEMA_URI_FORMAT % params[:uri_part])\n end", "def rdf_type_predicate\n RDF::URI(\"http://www.w3.org/1999/02/22-rdf-syntax-ns#type\")\n end", "def uri?\n children[0] && children[0].is_a?(Uri)\n end", "def term\r\n Riddle::Query.escape params[:term]\r\n end", "def term\r\n Riddle::Query.escape params[:term]\r\n end" ]
[ "0.6893717", "0.67285734", "0.6393089", "0.6375922", "0.6329138", "0.6263812", "0.62020475", "0.6009201", "0.60051835", "0.59203947", "0.59112513", "0.5784375", "0.57709205", "0.57378757", "0.57201916", "0.57201916", "0.5718945", "0.5714796", "0.5650531", "0.563585", "0.5596414", "0.55523866", "0.55053073", "0.55053073", "0.55024", "0.5484118", "0.54728365", "0.5441555", "0.5414296", "0.53937846", "0.53927505", "0.53721625", "0.5351001", "0.53467244", "0.53315926", "0.53072625", "0.5299198", "0.5284213", "0.528137", "0.5278897", "0.52751994", "0.5274499", "0.5265136", "0.52581227", "0.5255168", "0.52487546", "0.5235148", "0.52267057", "0.52173394", "0.5195936", "0.5194178", "0.51711625", "0.51621944", "0.51594234", "0.5149546", "0.51483345", "0.51330584", "0.51317537", "0.5126363", "0.5125258", "0.5125258", "0.5115701", "0.51144886", "0.5113778", "0.5111412", "0.5107718", "0.50994474", "0.50944126", "0.5091861", "0.5091533", "0.5091533", "0.5088805", "0.5084244", "0.5083912", "0.50750536", "0.506058", "0.5054098", "0.5051371", "0.5048497", "0.5031757", "0.5020332", "0.5012853", "0.50043505", "0.49932367", "0.49901316", "0.49864087", "0.49813306", "0.49791673", "0.49721518", "0.49711436", "0.49701694", "0.4968589", "0.49574795", "0.49504438", "0.49490687", "0.49355182", "0.49327222", "0.49289262", "0.4919837", "0.4919837" ]
0.84111893
0
Is the term_id substitution expected to be an ID?
def term_id_expects_id? return false if term_config.nil? || !(term_config.key? :term_id) term_config[:term_id] == "ID" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def terms_id\n parse_terms_id_response(SolrQuery.new.solr_query(q='rdftype_tesim:\"http://www.w3.org/2004/02/skos/core#ConceptScheme\" AND preflabel_tesim:\"places\"'))\n end", "def term_id(category, term, select)\n s = term_str(category, term, select)\n i = $terms.index s\n unless i\n $terms << s\n i = $terms.size - 1\n end\n i += 3001\nend", "def valid_id(text)\n\t NinjaGen.id_filter.match(text)\n end", "def term_id_expects_uri?\n return false if term_config.nil? || !(term_config.key? :term_id)\n term_config[:term_id] == \"URI\"\n end", "def term_valid?(term)\n term.is_a?(String)\n end", "def term\n Term.find(self.term_id)\n end", "def id?(str); end", "def set_term\n @term = UriService.client.find_term_by_internal_id(params[:id])\n raise ActionController::RoutingError, \"Could not find Term with internal_id: #{params[:id]}\" if @term.nil?\n end", "def check_term(term_type, term) \n if !@term_authority[term_type]\n authorized_term = term\n elsif !@term_authority[term_type][term].nil?\n @term_authority[term_type][term] == \"REMOVE\" ? authorized_term = \"\" : authorized_term = @term_authority[term_type][term]\n else\n authorized_term = term\n end\n \n return authorized_term\n \n end", "def id_check(el, id, base)\n if NC_REGEXP.match(id)\n # ID may only be specified once for the same URI\n if base\n uri = URIRef.intern(\"##{id}\", base, :normalize => false)\n if @id_mapping[id] && @id_mapping[id] == uri\n warn = \"ID addtribute '#{id}' may only be defined once for the same URI\"\n add_debug(el, warn)\n raise RdfContext::ParserException.new(warn) if @strict\n end\n \n @id_mapping[id] = uri\n # Returns URI, in this case\n else\n id\n end\n else\n warn = \"ID addtribute '#{id}' must be a NCName\"\n add_debug(el, \"ID addtribute '#{id}' must be a NCName\")\n add_debug(el, warn)\n raise RdfContext::ParserException.new(warn) if @strict\n nil\n end\n end", "def set_term\n @term = Term.find(params[:id])\n end", "def registration_term_id=( id )\n write_attribute :registration_term_id, id\n if registration_term && registration_term.external_id?\n self.external_term_id = regisration_term.external_id\n end\n id\n end", "def full_org_id; (term_id && org_id) ? \"#{term_id}_#{org_id}\" : nil; end", "def term_multiple?( term )\n #puts \"=====> GenericWork.term_multiple? #{term}\"\n return true if [:keyword, :title, :contributor, :subject, :related_url, :sponsoring_agency, :admin_notes].include? term\n false\n end", "def set_term\n @term = Term.find(params[:id])\n end", "def set_term\n @term = Term.find(params[:id])\n end", "def id?(str)\n token = @tokens[@p]\n return false unless token && token[0] == :id\n return false unless token[1] == str\n @p += 1\n token[1]\n end", "def getID(word)\n return Keyword.where(name: word).first.id\n end", "def has_better_id?\n slug and found_using_numeric_id? || found_using_outdated_friendly_id?\n end", "def is_id?(key)\n key =~ /^[A-Z0-9]+$/\n end", "def set_term\n @term = Term.find(params[:id])\n raise ActiveRecord::RecordNotFound unless @term.user_id == session[:user_id]\n end", "def term_readonly?( term )\n #puts \"=====> GenericWork.term_readonly? #{term}\"\n return true if [:author_email, :author_institution, :date_created, :identifier, :publisher, :department, :degree, :license].include? term\n return true if term == :title && is_sis_thesis?\n false\n end", "def found_using_numeric_id?\n !found_using_friendly_id?\n end", "def find_glossary_term!\n @glossary_term = find_or_goto_index(GlossaryTerm,\n params[:id].to_s)\n end", "def term_required?( term )\n #puts \"=====> GenericWork.term_required? #{term}\"\n return true if [:author_email, :author_first_name, :author_last_name, :author_institution, :title, :creator, :contributor, :description, :publisher, :rights, :identifier, :department, :degree, :license].include? term\n false\n end", "def is_id? str\n match = [KVP,DELIM]\n return false if match.any? {|w| str.include? w}\n return true\n end", "def set_term_item_term\n @term_item_term = TermItemTerm.find(params[:id])\n end", "def id_found?\n token && decoded_token && decoded_token[:id]\n end", "def is?(term, type_sym)\n return term[:type] == type_sym\n end", "def tfidf(term)\n term = to_term_record(term)\n tf(term) * term.idf\n end", "def id\n solr_document.fetch('id').sub(/^id-/, '')\n end", "def delete_doc_with_unique_term(term)\n writer.delete_document(\"Q#{term}\")\n true\n end", "def bad_slug?(object)\n params[:id] != object.to_param\n end", "def bad_slug?(object)\n params[:id] != object.to_param\n end", "def term\n @term\n end", "def fix_term(term, author: false, **)\n return term unless term.is_a?(String)\n value = term.strip\n\n # Strip quote mistakenly surrounding the whole term.\n value.sub!(/^([\"'])\\s*(.*)\\s*\\1$/, '\\2')\n\n # Extract the query type prefix.\n value.sub!(/^([^:]+)\\s*:\\s*/, '')\n prefix = $1&.presence&.downcase || DEFAULT_QUERY\n\n # Strip surrounding quotes from the query term.\n value.sub!(/^([\"'])\\s*(.*)\\s*\\1$/, '\\2')\n\n # Strip date from author name if requested.\n author = author.include?(prefix) if author.is_a?(Array)\n value.sub!(/\\s*,?\\s*(\\[.*\\]|\\(.*\\)|\\d+.*\\d+|\\d+-?)$/, '') if author\n\n \"#{prefix}:#{value}\"\n end", "def set_vocabulary_term\n @vocabulary_term = VocabularyTerm.find(params[:id])\n end", "def term_replacements?\n term_replacement_count.positive?\n end", "def on_id(node)\n id = node.to_a[0]\n if tester.literal_flags\n node.updated(nil, [id])\n else\n node.updated(nil, [clean(id)])\n end\n end", "def mongoid_id?\n to_s =~ /^(|_)id$/\n end", "def term_name\n self.content\n end", "def term_param(name)\n term_params.select {|t| t.name == name}[0]\n end", "def id?\n @kind == :id\n end", "def get_word_id\n word = @text.downcase.singularize\n @word_id = EnglishWords.find_by(english_meaning: word)\n return @word_id\n end", "def bad_slug?(object)\n params[:id] != object.to_param\nend", "def set_neglected_term\n @neglected_term = NeglectedTerm.find(params[:id])\n end", "def id\n\t\tif(@tokens[@counter].type == @ID || @tokens[@counter].type == @INT || @tokens[@counter].type == @STRING )\n\t\t\treturn true \n\t\telse \n\t\t\treturn false \n\t\tend \n\tend", "def array_term?(data, term)\n data.first&.send(:[], term)&.is_a?(Array)\n end", "def is_id?\n get_classes.any? { |e| e =~ /\\Aid_/ }\n end", "def update\n @errors = []\n term_opts = flat_term_data_to_term_opts(term_params)\n\n begin\n @term = UriService.client.update_term(@term['uri'], term_opts)\n rescue UriService::NonExistentUriError, UriService::InvalidAdditionalFieldKeyError, UriService::CannotChangeTemporaryTerm => e\n @errors << e.message\n end\n\n respond_to do |format|\n if @errors.blank?\n format.html { redirect_to term_path(@term['internal_id']), notice: 'Term was successfully updated.' }\n format.json do\n render json: @term\n end\n else\n format.html { render action: 'new' }\n format.json do\n render json: { errors: @errors }\n end\n end\n end\n end", "def valid_id?(id)\n return false if (id || \"\").length == 0\n match = /[[:alnum:]\\-\\_\\.]*/.match(id)\n # If the resulting match is identical to the received id it means\n # the id includes only valid characters.\n return match[0] == id\n end", "def nested_form_id_for(id_prefix, id_sufix=\"\")\n if id_sufix.blank?\n page.evaluate_script(%Q{ $(\"[id^='#{id_prefix}']\").attr(\"id\") })\n else\n page.evaluate_script(%Q{\n $(\"input[id^='#{id_prefix}'][id$='#{id_sufix}']\").attr(\"id\")\n })\n end\n end", "def validate_identifiers(value)\n ids = []\n errors = []\n PublicationIdentifier.object_map(value).each_pair do |term, id|\n if id&.valid?\n ids << id.to_s\n elsif id\n errors << \"#{id.to_s.inspect} is not a valid #{id.type.upcase}\" # TODO: I18n\n else\n errors << \"#{term.inspect} is not a standard identifier\" # TODO: I18n\n end\n end\n { valid: errors.blank?, ids: ids, errors: errors}\n end", "def process_term(element, value, **options)\n if options[:vocab]\n # If there is a local default vocabulary, the IRI is obtained by concatenating that value and the term\n return uri(options[:vocab] + value)\n elsif options[:term_mappings].is_a?(Hash)\n # If the term is in the local term mappings, use the associated URI (case sensitive).\n return uri(options[:term_mappings][value.to_s.to_sym]) if options[:term_mappings].has_key?(value.to_s.to_sym)\n\n # Otherwise, check for case-insensitive match\n options[:term_mappings].each_pair do |term, uri|\n return uri(uri) if term.to_s.downcase == value.to_s.downcase\n end\n end\n\n # Finally, if there is no local default vocabulary, the term has no associated URI and must be ignored.\n add_warning(element, \"Term #{value} is not defined\", RDF::RDFA.UnresolvedTerm)\n nil\n end", "def valid_id?(value)\n digits_only?(value)\n end", "def valid?\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n allowed_values = [\"TERM\", \"NUMBERRANGE\", \"NUMBERHISTOGRAM\", \"DATERANGE\", \"DATEHISTOGRAM\", \"ID\"]\n if @term_type && !allowed_values.include?(@term_type)\n return false\n end\n \n \n \n \n \n \n \n end", "def term\r\n Riddle::Query.escape params[:term]\r\n end", "def term\r\n Riddle::Query.escape params[:term]\r\n end", "def text_id\n \"#{name} (##{id})\"\n end", "def terms_id_term_post(id_term, opts = {})\n data, _status_code, _headers = terms_id_term_post_with_http_info(id_term, opts)\n data\n end", "def at_id(id)\n detect { |title| title.id == id }\n end", "def set_term_relationship\n @term_relationship = TermRelationship.find(params[:id])\n end", "def unfriendly_id?; end", "def term?\n type.in?(%i[tag metatag wildcard all none])\n end", "def id_safe(text)\n\t\ttext.gsub(/[ .?!]/, ' ' => '-', '.' => '', '?' => '', '!' => '').gsub(/-{2,}/, '-').downcase.to_s\n\tend", "def parse_taxon_ids full_document\n full_document.gsub(/%t(\\d+)/) do\n try_linking_taxon_id $1\n end\n end", "def term_acceptable(t)\n if t.length < 3\n return false # too short, unacceptable\n elsif @stopwords.include?(t)\n return false # stopword, unacceptable\n else\n if (t =~ /\\d/) != 0\n return true # doesn't start with digit, acceptable\n else\n return 10*t.scan(/\\d/).length < 4*t.length # < 40% digits, acceptable\n end\n end\n end", "def named?\n id.kind_of?(String)\n end", "def renumber_terms(doc)\n logger.info(\"Renumbering terms\")\n\n doc.xpath('//a:term', a: NS).each_with_index do |term, i|\n term['id'] = \"trm#{i}\"\n end\n end", "def ids\n @ids ||= term.list_ids.sort\n end", "def find_term_references(doc, terms)\n logger.info(\"+ Finding references to terms\")\n\n i = 0\n\n # sort terms by the length of the defined term, desc,\n # so that we don't find short terms inside longer\n # terms\n terms = terms.to_a.sort_by { |pair| -pair[1].size }\n\n # look for each term\n for term_id, term in terms\n doc.xpath('//a:body//text()', a: NS).each do |text|\n # replace all occurrences in this text node\n\n # unless we're already inside a def or term element\n next if ([\"def\", \"term\"].include?(text.parent.name))\n\n # don't link to a term inside its own definition\n owner = find_up(text, 'subsection')\n next if owner and owner.at_xpath(\".//a:def[@refersTo='##{term_id}']\", a: NS)\n\n while posn = (text.content =~ /\\b#{Regexp::escape(term)}\\b/)\n # <p>A delegation under subsection (1) shall not prevent the <term refersTo=\"#term-Minister\" id=\"trm357\">Minister</term> from exercising the power himself or herself.</p>\n node = doc.create_element('term', term, refersTo: \"##{term_id}\", id: \"trm#{i}\")\n\n pre = (posn > 0) ? text.content[0..posn-1] : nil\n post = text.content[posn+term.length..-1]\n\n text.before(node)\n node.before(doc.create_text_node(pre)) if pre\n text.content = post\n\n i += 1\n end\n end\n end\n end", "def term_type=(term_type)\n allowed_values = [\"TERM\", \"NUMBERRANGE\", \"NUMBERHISTOGRAM\", \"DATERANGE\", \"DATEHISTOGRAM\", \"ID\"]\n if term_type && !allowed_values.include?(term_type)\n fail ArgumentError, \"invalid value for 'term_type', must be one of #{allowed_values}.\"\n end\n @term_type = term_type\n end", "def sub_id() @tag.sub( /.*_/, '' ) end", "def sub_id() @tag.sub( /.*_/, '' ) end", "def term\n eat_ws_and_comments\n if peek == \"'\" # quoted\n return quote_term\n elsif peek == \"`\" # quasiquote\n return quasi_term\n elsif peek == \",\"\n return unquote_term\n elsif str = string_term\n return str\n end\n # We begin by trying the various collections\n [:list_term, :array_term, :hash_term].each do |coll|\n coll = method coll\n value = coll.call\n return value unless value.nil?\n end\n # Then it must be a basic term\n naive_term\n end", "def id!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 27 )\n\n type = ID\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 357:6: 'id'\n match( \"id\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 27 )\n\n end", "def adopt_registration_term\n if external_term_id? && ( registration_term.blank? || registration_term.external_id != external_term_id )\n self.registration_term = RegistrationTerm.find_by_external_id( external_term_id )\n end\n true\n end", "def id?\n true\n end", "def lookup_id(arg)\n all_by_id[arg]\n end", "def qid\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 45 )\n return_value = QidReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n char_literal196 = nil\n id195 = nil\n id197 = nil\n\n tree_for_char_literal196 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 451:7: id ( '.' id )*\n @state.following.push( TOKENS_FOLLOWING_id_IN_qid_3118 )\n id195 = id\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, id195.tree )\n end\n # at line 451:10: ( '.' id )*\n while true # decision 84\n alt_84 = 2\n look_84_0 = @input.peek( 1 )\n\n if ( look_84_0 == T__90 )\n alt_84 = 1\n\n end\n case alt_84\n when 1\n # at line 451:11: '.' id\n char_literal196 = match( T__90, TOKENS_FOLLOWING_T__90_IN_qid_3121 )\n if @state.backtracking == 0\n\n tree_for_char_literal196 = @adaptor.create_with_payload( char_literal196 )\n @adaptor.add_child( root_0, tree_for_char_literal196 )\n\n end\n @state.following.push( TOKENS_FOLLOWING_id_IN_qid_3123 )\n id197 = id\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, id197.tree )\n end\n\n else\n break # out of loop for decision 84\n end\n end # loop for decision 84\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 45 )\n\n end\n \n return return_value\n end", "def occurrence_id \n # An identifier for the Occurrence (as opposed to a particular digital record of the occurrence).\n # In the absence of a persistent global unique identifier, construct one from a combination of identifiers in the record that will most closely make the occurrenceID globally unique.\n # For a specimen in the absence of a bona fide global unique identifier, for example, use the form: \"urn:catalog:[institutionCode]:[collectionCode]:[catalogNumber].\n # Examples: \"urn:lsid:nhm.ku.edu:Herps:32\", \"urn:catalog:FMNH:Mammal:145732\" \n\n #if v = @obj.identifiers.that_are_global.andand.first\n # v.cached_display_name\n #else\n \"urn:catalog:#{institution_code}:#{collection_code}:#{catalog_number}\"\n #end\n end", "def term; end", "def look_up(term='')\n\n NSLog(\"Something just tried to look up the term #{term}\")\n false\n\n end", "def terms_id_term_post_with_http_info(id_term, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TermsApi.terms_id_term_post ...'\n end\n # verify the required parameter 'id_term' is set\n if @api_client.config.client_side_validation && id_term.nil?\n fail ArgumentError, \"Missing the required parameter 'id_term' when calling TermsApi.terms_id_term_post\"\n end\n # resource path\n local_var_path = '/terms/{id_term}'.sub('{' + 'id_term' + '}', id_term.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'expand'] = opts[:'expand'] if !opts[:'expand'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])\n\n # form parameters\n form_params = {}\n form_params['language'] = opts[:'language'] if !opts[:'language'].nil?\n form_params['file_content'] = opts[:'file_content'] if !opts[:'file_content'].nil?\n\n # http body (model)\n post_body = nil\n auth_names = ['api_key']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'TermsOfService')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TermsApi#terms_id_term_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def handle_naive_term(term, file, line, col)\n # First check to see if it's a number\n value = number? term\n return Token.new value, file, line, col if value\n # Ok, so it must be a symbol, a keyword, a literal or an identifier.\n if @literals.has_key?(s=term.to_sym) # special keyword\n T(file, line, col, @literals[s])\n elsif term[0] == \":\" # Symbol\n error file, line, col, \": is not a valid symbol\", term.size == 1\n A(file, line, col, :quote, term[1..-1].to_sym)\n elsif term[-1] == \":\" # Keyword\n A(file, line, col, :keyword, term.to_sym)\n else # identifier\n T(file, line, col, term.to_sym)\n end\n end", "def id_persisted?(test_id)\n rdf_subject = new(test_id).rdf_subject\n\n ActiveTriples::Repositories.has_subject?(rdf_subject)\n end", "def set_people_term\n @people_term = PeopleTerm.find(params[:id])\n end", "def quoted_id\n id\n end", "def singular?(word, term: :noun)\n case term.to_sym\n when :noun, :n\n Noun[word].singular?\n when :verb, :v\n Verb[word].singular?\n else\n raise Error, \"Unknown option '#{term}' as a term\"\n end\n end", "def some_id( id )\n id.blank? ? '' : \"[#{ id }]\"\n end", "def put_concepts( id , title )\n @ct[id] = title\n words = title.scan(LanguageModel::PTN_TERM).map{|w|w.downcase}\n if words.length > MAX_WORDS_IN_TERM then $lgr.error(\"Length exceeded!\") end\n h = @ch #Current Position in Rec\n words.each_with_index do |w,i|\n w.downcase!\n if h[w] == nil #value doesn't exist\n if last_index?(words,i)\n h[w] = id\n else\n h = h[w] = { }\n end\n elsif h[w].class == Fixnum #terminal value exists (final word)\n if last_index?(words,i)\n return :exists\n else\n h = h[w] = { :_key_ => h[w] } #current concept is longer than existing concept\n end\n else #non-terminal value exists (h[w].class == Hash)\n h = h[w]\n end\n #p \"h: \"+h.inspect\n end#do\n #p \"@ch : \"[email protected]\n end", "def term\n return unless lecture.present?\n lecture.term\n end", "def start_identifier?(text = T.unsafe(nil)); end", "def is_ambiguously_invalid?\n !is_valid? && (id == cached_valid_taxon_name_id)\n end", "def look_up(term)\n # First, let's convert our user input to lowercase.\n term = term.downcase\n # If the word doesn't exist in my hash, let the user know.\n if !@words[term] \n return \"Sorry, I don't have a definition for \\\"#{term}\\\"...\"\n # Otherwise, spit out my definition. \n else\n @words[term].definition\n end\n\n end", "def to_term_record(term_or_word)\n return term_or_word if term_or_word.respond_to?(:word)\n return @term_hash[term_or_word]\n end", "def id_truncated?\n !@trace_id_upper64.nil?\n end", "def handle_known_template_id(template_id)\n case template_id\n when VARIABLE_TEMPLATE\n @derivation_operator = HQMF::DataCriteria::INTERSECT if @derivation_operator == HQMF::DataCriteria::XPRODUCT\n @definition ||= 'derived'\n @variable = true\n @negation = false\n when SATISFIES_ANY_TEMPLATE\n @definition = HQMF::DataCriteria::SATISFIES_ANY\n @negation = false\n when SATISFIES_ALL_TEMPLATE\n @definition = HQMF::DataCriteria::SATISFIES_ALL\n @derivation_operator = HQMF::DataCriteria::INTERSECT\n @negation = false\n else\n return false\n end\n true\n end", "def set_common_term\n @common_term = CommonTerm.find(params[:id])\n end", "def term_includes_r99_sf20?(term)\n !!term.try(:[], :positiveIndicators).find do |indicator|\n indicator.try(:[], 'type').try(:[], 'code') == '+R99' && indicator.try(:[], 'reason').try(:[], 'code') == 'SF20%'\n end\n end" ]
[ "0.700985", "0.693333", "0.63347673", "0.6329925", "0.61253047", "0.5950052", "0.59488124", "0.5922546", "0.58130115", "0.5794899", "0.57727516", "0.56985354", "0.56934303", "0.5676261", "0.5670401", "0.5670401", "0.565743", "0.5654547", "0.56097806", "0.55670273", "0.553752", "0.54884285", "0.5466162", "0.54566866", "0.5449907", "0.5402023", "0.5376698", "0.5286207", "0.5285461", "0.5282929", "0.5276701", "0.52602357", "0.52581704", "0.52581704", "0.5242154", "0.522744", "0.52262616", "0.5221741", "0.52194315", "0.52069736", "0.51982975", "0.51795644", "0.5174507", "0.51711303", "0.516509", "0.5145543", "0.51374775", "0.5118423", "0.5094748", "0.5094372", "0.50855243", "0.5084589", "0.5082908", "0.5082217", "0.5077662", "0.5055573", "0.50505954", "0.50505954", "0.50285393", "0.50273275", "0.50167394", "0.5005571", "0.5004276", "0.49997455", "0.49866548", "0.4984086", "0.4977971", "0.497053", "0.49494797", "0.49391136", "0.49358052", "0.4934638", "0.492748", "0.492748", "0.49184123", "0.49173823", "0.49147186", "0.49018857", "0.49011192", "0.48982745", "0.48982468", "0.48928198", "0.4891403", "0.489078", "0.48841134", "0.48821464", "0.4878491", "0.48778862", "0.48773387", "0.48754975", "0.48750094", "0.48738265", "0.48722202", "0.4869083", "0.48680294", "0.48659983", "0.48635837", "0.48539704", "0.48521906", "0.48505756" ]
0.80330396
0